Skip to content

Commit b6027dd

Browse files
Vge0rgeadeaarm
authored andcommitted
CC3XX: RSA key parsing fix in PSA interface implementation
When deciding to skip the leading zero in the DER encoding of an RSA key, correctly test the contents of the memory and not the address of the pointer, i.e. fix a mishandling of double pointers. Signed-off-by: Georgios Vasilakis <[email protected]> Change-Id: I8aff8d8b814600df242252e62ee54405a5405422
1 parent 401cf81 commit b6027dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ext/cryptocell-312-runtime/codesafe/src/psa_driver_api/src/cc3xx_internal_rsa_util.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ static void skip_leading_zero(uint8_t **ptr, size_t *ptr_size)
7575
return;
7676
}
7777

78-
if (*ptr[0] == 0 && (*ptr[1] & 0x80)) {
79-
*ptr += 1;
78+
if ((*ptr)[0] == 0 && ((*ptr)[1] & 0x80)) {
79+
*ptr++;
8080
*ptr_size -= 1;
8181
}
8282
}

0 commit comments

Comments
 (0)