Skip to content

Commit 8df8dc0

Browse files
committed
library: x509: replace mbedtls_pk_can_do() with mbedtls_pk_can_do_psa()
Signed-off-by: Valerio Setti <[email protected]>
1 parent 1e241c4 commit 8df8dc0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/x509_crt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2111,7 +2111,9 @@ static int x509_crt_check_signature(const mbedtls_x509_crt *child,
21112111
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
21122112

21132113
/* Skip expensive computation on obvious mismatch */
2114-
if (!mbedtls_pk_can_do(&parent->pk, (mbedtls_pk_type_t) child->sig_pk)) {
2114+
if (!mbedtls_pk_can_do_psa(&parent->pk,
2115+
mbedtls_psa_alg_from_pk_sigalg(child->sig_pk, hash_alg),
2116+
PSA_KEY_USAGE_VERIFY_HASH)) {
21152117
return -1;
21162118
}
21172119

0 commit comments

Comments
 (0)