crypto: add IsOnCurve check (#31100)

release/1.14
Felix Lange 18 hours ago
parent db93d49880
commit 159fb1a1db
  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