fix: critical security fixes in core/codec (S0) (#5479)

This commit is contained in:
Kevin Wan
2026-03-15 16:40:15 +08:00
committed by GitHub
parent ec802e25a6
commit d1a014955c
6 changed files with 291 additions and 42 deletions

View File

@@ -35,7 +35,7 @@ func ComputeKey(pubKey, priKey *big.Int) (*big.Int, error) {
return nil, ErrInvalidPubKey
}
if pubKey.Sign() <= 0 && p.Cmp(pubKey) <= 0 {
if pubKey.Sign() <= 0 || p.Cmp(pubKey) <= 0 {
return nil, ErrPubKeyOutOfBound
}