wycheproof-ecdsa-missing-zero
ECDSA: Missing zero
Some implementations of ECDSA and DSA incorrectly encode r and s by not including leading zeros in the ASN encoding of integers when necessary. Hence, some implementations (e.g. jdk) allow signatures with incorrect ASN encodings assuming that the signature is otherwise valid.
REJECT
Your service should reject this one.
Stated as the outcome to assert against, so a suite compares with this rather than hardcoding a result and getting it backwards.
While signatures are more malleable if such signatures are accepted, this typically leads to no vulnerability, since a badly encoded signature can be reencoded correctly. Demonstrated by 43 test vectors across 33 vector documents in Project Wycheproof.
Provenance
- Kind
- hardeningDefensible practice with no normative source. Judge it for yourself.
- Source
- wycheproof
- Clause
- FIPS 186-5 §6
- CVE
- none
- Weakness
- none
Test keys only. Nothing here is a statement about any particular service: the expected outcome above is what an application ought to do, not evidence that yours does.