File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ import (
39
39
"golang.org/x/crypto/sha3"
40
40
)
41
41
42
- //SignatureLength indicates the byte length required to carry a signature with recovery id.
42
+ // SignatureLength indicates the byte length required to carry a signature with recovery id.
43
43
const SignatureLength = 64 + 1 // 64 bytes ECDSA signature + 1 byte recovery id
44
44
45
45
// RecoveryIDOffset points to the byte offset within the signature that contains the recovery id.
@@ -204,6 +204,9 @@ func UnmarshalPubkey(pub []byte) (*ecdsa.PublicKey, error) {
204
204
if x == nil {
205
205
return nil , errInvalidPubkey
206
206
}
207
+ if ! S256 ().IsOnCurve (x , y ) {
208
+ return nil , errInvalidPubkey
209
+ }
207
210
return & ecdsa.PublicKey {Curve : S256 (), X : x , Y : y }, nil
208
211
}
209
212
You can’t perform that action at this time.
0 commit comments