mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
psa_util: skip leading zeros in der format with "if" instead of "while"
This is possible because we know that DER format can have at most 1 leading zero. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
@ -494,8 +494,8 @@ static int convert_der_to_raw_single_int(unsigned char *der, size_t der_len,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Skip leading zeros */
|
||||
while (*p == 0x00) {
|
||||
/* Skip possible leading zero */
|
||||
if (*p == 0x00) {
|
||||
p++;
|
||||
unpadded_len--;
|
||||
/* It should never happen that the input number is all zeros. */
|
||||
|
Reference in New Issue
Block a user