ssl_test_lib: add guards for pk_wrap_as_opaque()

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti 2024-02-28 10:45:43 +01:00
parent b484e37d91
commit 90eca2adb0
2 changed files with 4 additions and 0 deletions

View file

@ -275,6 +275,7 @@ int key_opaque_set_alg_usage(const char *alg1, const char *alg2,
return 0; return 0;
} }
#if defined(MBEDTLS_PK_C)
int pk_wrap_as_opaque(mbedtls_pk_context *pk, psa_algorithm_t psa_alg, psa_algorithm_t psa_alg2, int pk_wrap_as_opaque(mbedtls_pk_context *pk, psa_algorithm_t psa_alg, psa_algorithm_t psa_alg2,
psa_key_usage_t psa_usage, mbedtls_svc_key_id_t *key_id) psa_key_usage_t psa_usage, mbedtls_svc_key_id_t *key_id)
{ {
@ -303,6 +304,7 @@ int pk_wrap_as_opaque(mbedtls_pk_context *pk, psa_algorithm_t psa_alg, psa_algor
return 0; return 0;
} }
#endif /* MBEDTLS_PK_C */
#endif /* MBEDTLS_USE_PSA_CRYPTO */ #endif /* MBEDTLS_USE_PSA_CRYPTO */
#if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK) #if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK)

View file

@ -236,6 +236,7 @@ int key_opaque_set_alg_usage(const char *alg1, const char *alg2,
psa_key_usage_t *usage, psa_key_usage_t *usage,
mbedtls_pk_type_t key_type); mbedtls_pk_type_t key_type);
#if defined(MBEDTLS_PK_C)
/** Turn a non-opaque PK context into an opaque one with folowing steps: /** Turn a non-opaque PK context into an opaque one with folowing steps:
* - extract the key data and attributes from the PK context. * - extract the key data and attributes from the PK context.
* - import the key material into PSA. * - import the key material into PSA.
@ -258,6 +259,7 @@ int key_opaque_set_alg_usage(const char *alg1, const char *alg2,
*/ */
int pk_wrap_as_opaque(mbedtls_pk_context *pk, psa_algorithm_t psa_alg, psa_algorithm_t psa_alg2, int pk_wrap_as_opaque(mbedtls_pk_context *pk, psa_algorithm_t psa_alg, psa_algorithm_t psa_alg2,
psa_key_usage_t psa_usage, mbedtls_svc_key_id_t *key_id); psa_key_usage_t psa_usage, mbedtls_svc_key_id_t *key_id);
#endif /* MBEDTLS_PK_C */
#endif /* MBEDTLS_USE_PSA_CRYPTO */ #endif /* MBEDTLS_USE_PSA_CRYPTO */
#if defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) #if defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG)