mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-05-09 03:04:24 +02:00
psa_util: invert check order for leading zeros in convert_der_to_raw_single_int()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
@@ -489,7 +489,7 @@ static int convert_der_to_raw_single_int(unsigned char *der, size_t der_len,
|
||||
}
|
||||
|
||||
/* Skip possible leading zero */
|
||||
if ((*p == 0x00) && (unpadded_len > 0)) {
|
||||
if ((unpadded_len > 0) && (*p == 0x00)) {
|
||||
p++;
|
||||
unpadded_len--;
|
||||
/* It should never happen that the input number is all zeros. */
|
||||
|
||||
Reference in New Issue
Block a user