check s length in signature. closes #8

This commit is contained in:
Andrea Franz 2021-11-09 11:45:30 +01:00
parent dd57e754e7
commit b0e0482ba9
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,10 @@ func ParseSignature(message, resp []byte) (*Signature, error) {
return nil, err
}
if len(s) > 32 {
s = s[len(s)-32:]
}
v, err := calculateV(message, pubKey, r, s)
if err != nil {
return nil, err