From 41e8006fa2e287a8c20520a4e7b739f6a6458d09 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Tue, 24 Aug 2021 16:00:51 +0200 Subject: [PATCH] psa: Remove buggy report of RSA public exponent for opaque keys The report of RSA public exponent for opaque keys is not supported. Do not attempt to compute the RSA public exponent of an RSA opaque key associated to a driver implementing the new driver interface when MBEDTLS_PSA_CRYPTO_SE_C is disabled. Signed-off-by: Ronald Cron --- library/psa_crypto.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 3a49c12a8..2c562ce2a 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -1288,14 +1288,11 @@ psa_status_t psa_get_key_attributes( mbedtls_svc_key_id_t key, defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_PUBLIC_KEY) case PSA_KEY_TYPE_RSA_KEY_PAIR: case PSA_KEY_TYPE_RSA_PUBLIC_KEY: -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) /* TODO: reporting the public exponent for opaque keys * is not yet implemented. * https://github.com/ARMmbed/mbed-crypto/issues/216 */ - if( psa_key_slot_is_external( slot ) ) - break; -#endif /* MBEDTLS_PSA_CRYPTO_SE_C */ + if( ! psa_key_lifetime_is_external( slot->attr.lifetime ) ) { mbedtls_rsa_context *rsa = NULL;