Skip to content

Commit

Permalink
Refactor ECDSA error log
Browse files Browse the repository at this point in the history
  • Loading branch information
J3imip committed Jan 6, 2025
1 parent 4fbe21b commit 32c6100
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/types/signature_algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ func verifyECDSA(data, sig []byte, publicKey *ecdsa.PublicKey) error {
case 56:
index = 28
default:
return fmt.Errorf("ECDSA signature length is not 64 or 56, but %d, with key %s", len(sig), publicKey.Curve.Params().Name)
return fmt.Errorf(
"unexpected ECDSA signature length, got %d bytes for %s curve",
len(sig),
publicKey.Curve.Params().Name,
)
}

r, s := new(big.Int).SetBytes(sig[:index]), new(big.Int).SetBytes(sig[index:])
Expand Down

0 comments on commit 32c6100

Please sign in to comment.