Skip to content

Commit c7a29ca

Browse files
authored
crypto: add IsOnCurve check (#261)
1 parent e6d8251 commit c7a29ca

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## v0.5.5
4+
5+
This is a hot fix release, the detail about this fix will be revealed later.
6+
Please upgrade your node to this version if your node is exposed to the public network via p2p.
7+
38
## v0.5.4
49

510
This is a minor release for opBNB Mainnet and Testnet.

crypto/crypto.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ func UnmarshalPubkey(pub []byte) (*ecdsa.PublicKey, error) {
197197
if x == nil {
198198
return nil, errInvalidPubkey
199199
}
200+
if !S256().IsOnCurve(x, y) {
201+
return nil, errInvalidPubkey
202+
}
200203
return &ecdsa.PublicKey{Curve: S256(), X: x, Y: y}, nil
201204
}
202205

0 commit comments

Comments
 (0)