crypto/secp256r1: reject the reference pubKey coordinates
This commit is contained in:
parent
21f4932c9b
commit
98f10b0d5e
|
@ -13,6 +13,11 @@ func newPublicKey(x, y *big.Int) *ecdsa.PublicKey {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Check if the given coordinates are the reference point (infinity)
|
||||
if x.Sign() == 0 && y.Sign() == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return &ecdsa.PublicKey{
|
||||
Curve: elliptic.P256(),
|
||||
X: x,
|
||||
|
|
Loading…
Reference in New Issue