Here is an excerpt from ‘X690 8.3.2 Encoding of an integer rule’.
8.3.2 If the contents octets of an integer value encoding consist of more than one octet,
then the bits of the first octet and bit 8 of the second octet:
a) shall not all be ones; and
b) shall not all be zero.
NOTE – These rules ensure that an integer value is always encoded in the smallest possible number of octets.
That is,
Integer encoding 02020001 is invalid, 020101 is valid. (which means 1)
Likewise Integer encoding 0202FFFF is invalid, 0201FF is valid (which means -1)
The ‘mbedtls_ecdsa_read_signature’ function allows the above invalid encoding.
I’ve attached simple test programs with a small variation of mbedtls/programs/pkey/ecdsa.c
Hi @Roku
CLA is a “Contributor’s License Agreement.”
If this is a personal contribution, the easiest way to do this is if you create an mbed account and accept this click through agreement. Alternatively, you can find a slightly different agreement to sign here, which can be signed and returned to us, and is applicable if you don’t want to create an Mbed account or alternatively if this is a corporate contribution.
Since you already have an Mbed acount, and I am assuming this is a personal contribution, the simplest way id for you to accept the click through agreement.
Regards,
Mbed TLS Team member
Ron