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>
diff --git a/include/mbedtls/pk.h b/include/mbedtls/pk.h
index d3d6f6d..919c408 100644
--- a/include/mbedtls/pk.h
+++ b/include/mbedtls/pk.h
@@ -1152,7 +1152,7 @@
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 @@
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
}
diff --git a/library/pk.c b/library/pk.c
index 87b1d8f..d52c77d 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -1080,7 +1080,7 @@
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 @@
#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 */