Skip to content

Commit 562619f

Browse files
committed
[TEMPORARY] library: future changes for mbedtls_pk_get_type
This is a temporary placeholder commit that will be implemented once the referenced function will be implemented in tf-psa-crypto Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
1 parent 3ddf7fb commit 562619f

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

library/ssl_tls.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5607,11 +5607,13 @@ void mbedtls_ssl_config_free(mbedtls_ssl_config *conf)
56075607
unsigned char mbedtls_ssl_sig_from_pk(mbedtls_pk_context *pk)
56085608
{
56095609
#if defined(MBEDTLS_RSA_C)
5610+
/* TODO: replace with mbedtls_pk_get_type() */
56105611
if (mbedtls_pk_can_do(pk, MBEDTLS_PK_RSA)) {
56115612
return MBEDTLS_SSL_SIG_RSA;
56125613
}
56135614
#endif
56145615
#if defined(MBEDTLS_KEY_EXCHANGE_ECDSA_CERT_REQ_ANY_ALLOWED_ENABLED)
5616+
/* TODO: replace with mbedtls_pk_get_type() */
56155617
if (mbedtls_pk_can_do(pk, MBEDTLS_PK_ECDSA)) {
56165618
return MBEDTLS_SSL_SIG_ECDSA;
56175619
}

library/x509write_crt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ int mbedtls_x509write_crt_der(mbedtls_x509write_cert *ctx,
408408

409409
/* There's no direct way of extracting a signature algorithm
410410
* (represented as an element of mbedtls_pk_type_t) from a PK instance. */
411+
/* TODO: replace with mbedtls_pk_get_type() */
411412
if (mbedtls_pk_can_do(ctx->issuer_key, MBEDTLS_PK_RSA)) {
412413
pk_alg = MBEDTLS_PK_SIGALG_RSA_PKCS1V15;
413414
} else if (mbedtls_pk_can_do(ctx->issuer_key, MBEDTLS_PK_ECDSA)) {

library/x509write_csr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ static int x509write_csr_der_internal(mbedtls_x509write_csr *ctx,
218218
return MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED;
219219
}
220220

221+
/* TODO: replace with mbedtls_pk_get_type() */
221222
if (mbedtls_pk_can_do(ctx->key, MBEDTLS_PK_RSA)) {
222223
pk_alg = MBEDTLS_PK_SIGALG_RSA_PKCS1V15;
223224
} else if (mbedtls_pk_can_do(ctx->key, MBEDTLS_PK_ECDSA)) {

0 commit comments

Comments
 (0)