Commit 0a562a37 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Fix improper error message in case of wrong message in ABS

parent 6955da45
......@@ -288,7 +288,17 @@ func verify(configuration *Configuration, proofList gabi.ProofList, context *big
// Verify a signature proof and check if the attributes match the attributes in the original request
func VerifySig(configuration *Configuration, irmaSignature *IrmaSignedMessage, sigRequest *SignatureRequest) *SignatureProofResult {
// First, verify the timestamp, if any
// First check if this signature matches the request
sigRequest.Timestamp = irmaSignature.Timestamp
if !irmaSignature.MatchesNonceAndContext(sigRequest) {
return &SignatureProofResult{
ProofResult: &ProofResult{
ProofStatus: UNMATCHED_REQUEST,
},
}
}
// Verify the timestamp
if irmaSignature.Timestamp != nil {
if err := VerifyTimestamp(irmaSignature, sigRequest.Message, configuration); err != nil {
return &SignatureProofResult{
......@@ -297,16 +307,6 @@ func VerifySig(configuration *Configuration, irmaSignature *IrmaSignedMessage, s
},
}
}
sigRequest.Timestamp = irmaSignature.Timestamp
}
// Then, check if nonce and context of the signature match those of the signature request
if !irmaSignature.MatchesNonceAndContext(sigRequest) {
return &SignatureProofResult{
ProofResult: &ProofResult{
ProofStatus: UNMATCHED_REQUEST,
},
}
}
// Now, cryptographically verify the signature
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment