mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
crypto/secp256r1: reject the reference pubKey coordinates
(cherry picked from commit 98f10b0d5e)
This commit is contained in:
parent
2bbf30ff90
commit
ab2f20e8dd
1 changed files with 5 additions and 0 deletions
|
|
@ -13,6 +13,11 @@ func newPublicKey(x, y *big.Int) *ecdsa.PublicKey {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the given coordinates are the reference point (infinity)
|
||||||
|
if x.Sign() == 0 && y.Sign() == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return &ecdsa.PublicKey{
|
return &ecdsa.PublicKey{
|
||||||
Curve: elliptic.P256(),
|
Curve: elliptic.P256(),
|
||||||
X: x,
|
X: x,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue