Skip to content

Commit

Permalink
crypto: add IsOnCurve check (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-reorg authored Jan 30, 2025
1 parent e6d8251 commit c7a29ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v0.5.5

This is a hot fix release, the detail about this fix will be revealed later.
Please upgrade your node to this version if your node is exposed to the public network via p2p.

## v0.5.4

This is a minor release for opBNB Mainnet and Testnet.
Expand Down
3 changes: 3 additions & 0 deletions crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,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
}

Expand Down

0 comments on commit c7a29ca

Please sign in to comment.