Skip to content

Commit

Permalink
Merge pull request #71 from aporcupine/patch-1
Browse files Browse the repository at this point in the history
Explicitly check for case where SignatureValue is nil
  • Loading branch information
russellhaering committed Aug 28, 2021
2 parents 3541f5e + ca2b448 commit fb23e0a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ func (ctx *ValidationContext) validateSignature(el *etree.Element, sig *types.Si
if !bytes.Equal(digest, decodedDigestValue) {
return nil, errors.New("Signature could not be verified")
}
if sig.SignatureValue == nil {
return nil, errors.New("Signature could not be verified")
}

// Decode the 'SignatureValue' so we can compare against it
decodedSignature, err := base64.StdEncoding.DecodeString(sig.SignatureValue.Data)
Expand Down

0 comments on commit fb23e0a

Please sign in to comment.