Skip to content

Commit 0009b04

Browse files
committed
library: ssl: replace mbedtls_pk_can_do_ext with mbedtls_pk_can_do_psa
Signed-off-by: Valerio Setti <[email protected]>
1 parent e6240f1 commit 0009b04

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

library/ssl_tls.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8147,14 +8147,14 @@ unsigned int mbedtls_ssl_tls12_get_preferred_hash_for_sig_alg(
81478147
mbedtls_md_psa_alg_from_type(md_alg);
81488148

81498149
if (sig_alg_received == MBEDTLS_SSL_SIG_ECDSA &&
8150-
!mbedtls_pk_can_do_ext(ssl->handshake->key_cert->key,
8150+
!mbedtls_pk_can_do_psa(ssl->handshake->key_cert->key,
81518151
PSA_ALG_ECDSA(psa_hash_alg),
81528152
PSA_KEY_USAGE_SIGN_HASH)) {
81538153
continue;
81548154
}
81558155

81568156
if (sig_alg_received == MBEDTLS_SSL_SIG_RSA &&
8157-
!mbedtls_pk_can_do_ext(ssl->handshake->key_cert->key,
8157+
!mbedtls_pk_can_do_psa(ssl->handshake->key_cert->key,
81588158
PSA_ALG_RSA_PKCS1V15_SIGN(
81598159
psa_hash_alg),
81608160
PSA_KEY_USAGE_SIGN_HASH)) {

library/ssl_tls12_server.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,11 +693,11 @@ static int ssl_pick_cert(mbedtls_ssl_context *ssl,
693693
int key_type_matches = 0;
694694
#if defined(MBEDTLS_SSL_ASYNC_PRIVATE)
695695
key_type_matches = ((ssl->conf->f_async_sign_start != NULL ||
696-
mbedtls_pk_can_do_ext(cur->key, pk_alg, pk_usage)) &&
697-
mbedtls_pk_can_do_ext(&cur->cert->pk, pk_alg, pk_usage));
696+
mbedtls_pk_can_do_psa(cur->key, pk_alg, pk_usage)) &&
697+
mbedtls_pk_can_do_psa(&cur->cert->pk, pk_alg, pk_usage));
698698
#else
699699
key_type_matches = (
700-
mbedtls_pk_can_do_ext(cur->key, pk_alg, pk_usage));
700+
mbedtls_pk_can_do_psa(cur->key, pk_alg, pk_usage));
701701
#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */
702702
if (!key_type_matches) {
703703
MBEDTLS_SSL_DEBUG_MSG(3, ("certificate mismatch: key type"));

library/ssl_tls13_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ static int ssl_tls13_pick_key_cert(mbedtls_ssl_context *ssl)
11601160
if (mbedtls_ssl_tls13_check_sig_alg_cert_key_match(
11611161
*sig_alg, &key_cert->cert->pk)
11621162
&& psa_alg != PSA_ALG_NONE &&
1163-
mbedtls_pk_can_do_ext(&key_cert->cert->pk, psa_alg,
1163+
mbedtls_pk_can_do_psa(&key_cert->cert->pk, psa_alg,
11641164
PSA_KEY_USAGE_SIGN_HASH) == 1
11651165
) {
11661166
ssl->handshake->key_cert = key_cert;

0 commit comments

Comments
 (0)