Skip to content

Commit 3ddf7fb

Browse files
committed
library: x509: replace mbedtls_pk_can_do() with mbedtls_pk_can_do_psa()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
1 parent e403ff3 commit 3ddf7fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/x509_crt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "psa_util_internal.h"
3939
#include "mbedtls/psa_util.h"
4040
#include "pk_internal.h"
41+
#include "mbedtls_utils.h"
4142

4243
#include "mbedtls/platform.h"
4344

@@ -2111,7 +2112,9 @@ static int x509_crt_check_signature(const mbedtls_x509_crt *child,
21112112
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
21122113

21132114
/* Skip expensive computation on obvious mismatch */
2114-
if (!mbedtls_pk_can_do(&parent->pk, (mbedtls_pk_type_t) child->sig_pk)) {
2115+
if (!mbedtls_pk_can_do_psa(&parent->pk,
2116+
mbedtls_psa_alg_from_pk_sigalg(child->sig_pk, hash_alg),
2117+
PSA_KEY_USAGE_VERIFY_HASH)) {
21152118
return -1;
21162119
}
21172120

0 commit comments

Comments
 (0)