mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-26 02:37:08 +00:00
pk: ignore opaque EC keys in pk_setup when they are not supported
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
35d1dacd82
commit
f7cd419ade
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user