pk: guard mbedtls_pk_wrap_as_opaque() with CRYPTO_CLIENT instead of USE_PSA

Albeit this function is very likely to be deprecated soon (#8848)
it is still used in test suites to generate opaque keys so its
guard must be aligned as well in order to have a better test
coverage of opaque keys.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti 2024-02-20 16:44:28 +01:00
parent b15e54ec26
commit 9190522b08
2 changed files with 4 additions and 4 deletions

View File

@ -1152,7 +1152,7 @@ int mbedtls_pk_write_pubkey(unsigned char **p, unsigned char *start,
const mbedtls_pk_context *key);
#endif /* MBEDTLS_PK_WRITE_C */
#if defined(MBEDTLS_USE_PSA_CRYPTO)
#if defined(MBEDTLS_PSA_CRYPTO_CLIENT)
/**
* \brief Turn an EC or RSA key into an opaque one.
*
@ -1177,7 +1177,7 @@ int mbedtls_pk_wrap_as_opaque(mbedtls_pk_context *pk,
psa_algorithm_t alg,
psa_key_usage_t usage,
psa_algorithm_t alg2);
#endif /* MBEDTLS_USE_PSA_CRYPTO */
#endif /* MBEDTLS_PSA_CRYPTO_CLIENT */
#ifdef __cplusplus
}

View File

@ -1080,7 +1080,7 @@ mbedtls_pk_type_t mbedtls_pk_get_type(const mbedtls_pk_context *ctx)
return ctx->pk_info->type;
}
#if defined(MBEDTLS_USE_PSA_CRYPTO)
#if defined(MBEDTLS_PSA_CRYPTO_CLIENT)
/*
* Load the key to a PSA key slot,
* then turn the PK context into a wrapper for that key slot.
@ -1199,5 +1199,5 @@ int mbedtls_pk_wrap_as_opaque(mbedtls_pk_context *pk,
#endif /* !MBEDTLS_PK_HAVE_ECC_KEYS && !MBEDTLS_RSA_C */
return MBEDTLS_ERR_PK_TYPE_MISMATCH;
}
#endif /* MBEDTLS_USE_PSA_CRYPTO */
#endif /* MBEDTLS_PSA_CRYPTO_CLIENT */
#endif /* MBEDTLS_PK_C */