crypto: add IsOnCurve check (#31100)

pull/30043/merge
Felix Lange 17 hours ago committed by GitHub
parent 7d0e197def
commit fa9a2ff868
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      crypto/crypto.go

@ -178,6 +178,9 @@ func UnmarshalPubkey(pub []byte) (*ecdsa.PublicKey, error) {
if x == nil {
return nil, errInvalidPubkey
}
if !S256().IsOnCurve(x, y) {
return nil, errInvalidPubkey
}
return &ecdsa.PublicKey{Curve: S256(), X: x, Y: y}, nil
}

Loading…
Cancel
Save