Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
d554ba44
Commit
d554ba44
authored
Dec 22, 2018
by
Sietse Ringers
Browse files
Fix handling of unexpected attributes in verification
parent
2bbe836a
Changes
2
Show whitespace changes
Inline
Side-by-side
requests.go
View file @
d554ba44
...
...
@@ -369,6 +369,7 @@ func (sr *SignatureRequest) SignatureFromMessage(message interface{}) (*SignedMe
return
&
SignedMessage
{
Signature
:
signature
.
Proofs
,
Indices
:
signature
.
Indices
,
Nonce
:
sr
.
Nonce
,
Context
:
sr
.
Context
,
Message
:
sr
.
Message
,
...
...
verify.go
View file @
d554ba44
...
...
@@ -138,11 +138,6 @@ func (d *Disclosure) DisclosedAttributes(configuration *Configuration, disjuncti
return
false
,
nil
,
errors
.
New
(
"ProofList contained proof of invalid type"
)
}
if
usedAttrs
[
index
.
CredentialIndex
]
==
nil
{
usedAttrs
[
index
.
CredentialIndex
]
=
map
[
int
]
struct
{}{}
}
usedAttrs
[
index
.
CredentialIndex
][
index
.
AttributeIndex
]
=
struct
{}{}
metadata
:=
MetadataFromInt
(
proofd
.
ADisclosed
[
1
],
configuration
)
// index 1 is metadata attribute
attr
,
attrval
,
err
:=
parseAttribute
(
index
.
AttributeIndex
,
metadata
,
proofd
.
ADisclosed
[
index
.
AttributeIndex
])
if
err
!=
nil
{
...
...
@@ -156,6 +151,10 @@ func (d *Disclosure) DisclosedAttributes(configuration *Configuration, disjuncti
}
else
{
list
[
i
]
.
Status
=
AttributeProofStatusInvalidValue
}
if
usedAttrs
[
index
.
CredentialIndex
]
==
nil
{
usedAttrs
[
index
.
CredentialIndex
]
=
map
[
int
]
struct
{}{}
}
usedAttrs
[
index
.
CredentialIndex
][
index
.
AttributeIndex
]
=
struct
{}{}
}
else
{
list
[
i
]
=
&
DisclosedAttribute
{
Status
:
AttributeProofStatusMissing
}
}
...
...
@@ -266,6 +265,7 @@ func (pl ProofList) DisclosedAttributes(configuration *Configuration, disjunctio
// Any attributes still in here do not satisfy any of the specified disjunctions; append them now
for
_
,
attr
:=
range
extraAttrs
{
attr
.
Status
=
AttributeProofStatusExtra
list
=
append
(
list
,
attr
)
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment