mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-08-22 11:09:52 +00:00
pk: ignore opaque EC keys in pk_setup when they are not supported
Signed-off-by: Valerio Setti <[email protected]>
This commit is contained in:
+4
-1
@@ -181,9 +181,12 @@ int mbedtls_pk_setup_opaque(mbedtls_pk_context *ctx,
|
|||||||
type = psa_get_key_type(&attributes);
|
type = psa_get_key_type(&attributes);
|
||||||
psa_reset_key_attributes(&attributes);
|
psa_reset_key_attributes(&attributes);
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_PK_HAVE_ECC_KEYS)
|
||||||
if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(type)) {
|
if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(type)) {
|
||||||
info = &mbedtls_ecdsa_opaque_info;
|
info = &mbedtls_ecdsa_opaque_info;
|
||||||
} else if (type == PSA_KEY_TYPE_RSA_KEY_PAIR) {
|
} else
|
||||||
|
#endif /* MBEDTLS_PK_HAVE_ECC_KEYS */
|
||||||
|
if (type == PSA_KEY_TYPE_RSA_KEY_PAIR) {
|
||||||
info = &mbedtls_rsa_opaque_info;
|
info = &mbedtls_rsa_opaque_info;
|
||||||
} else {
|
} else {
|
||||||
return MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE;
|
return MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE;
|
||||||
|
|||||||
Reference in New Issue
Block a user