Skip to content

Commit

Permalink
crypto: add IsOnCurve check (#13627)
Browse files Browse the repository at this point in the history
  • Loading branch information
shohamc1 authored Jan 30, 2025
1 parent b95a16d commit 44732ef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions erigon-lib/crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ func UnmarshalPubkeyStd(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 44732ef

Please sign in to comment.