mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Only guard with CRYPTO_CLIENT when version >= 4
In 4.x the semantics of MBEDTLS_PSA_CRYPTO_C and MBEDTLS_PSA_CRYPTO_CLIENT are different compared with 3.6. Where this is a problem, make guards more version-specific so that we are guarding with MBEDTLS_PSA_CRYPTO_C for 3.6 and MBEDTLS_PSA_CRYPTO_CLIENT for 4.x, keeping each branch the same as it was formerly. Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
@ -11,7 +11,10 @@
|
|||||||
|
|
||||||
#include "test/helpers.h"
|
#include "test/helpers.h"
|
||||||
|
|
||||||
#if defined(MBEDTLS_PSA_CRYPTO_CLIENT)
|
#if ((MBEDTLS_VERSION_MAJOR < 4) \
|
||||||
|
&& defined(MBEDTLS_PSA_CRYPTO_C)) \
|
||||||
|
|| (MBEDTLS_VERSION_MAJOR >= 4 \
|
||||||
|
&& defined(MBEDTLS_PSA_CRYPTO_CLIENT))
|
||||||
#include "test/psa_helpers.h"
|
#include "test/psa_helpers.h"
|
||||||
#include <psa/crypto.h>
|
#include <psa/crypto.h>
|
||||||
#endif
|
#endif
|
||||||
@ -40,7 +43,8 @@
|
|||||||
mbedtls_psa_crypto_free(); \
|
mbedtls_psa_crypto_free(); \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
#elif defined(MBEDTLS_PSA_CRYPTO_CLIENT) /* MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C */
|
#elif MBEDTLS_VERSION_MAJOR >= 4 && \
|
||||||
|
defined(MBEDTLS_PSA_CRYPTO_CLIENT) /* MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C */
|
||||||
#define PSA_INIT() PSA_ASSERT(psa_crypto_init())
|
#define PSA_INIT() PSA_ASSERT(psa_crypto_init())
|
||||||
#define PSA_DONE() mbedtls_psa_crypto_free();
|
#define PSA_DONE() mbedtls_psa_crypto_free();
|
||||||
#else /* MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C */
|
#else /* MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C */
|
||||||
@ -48,7 +52,10 @@
|
|||||||
#define PSA_DONE() ((void) 0)
|
#define PSA_DONE() ((void) 0)
|
||||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||||
|
|
||||||
#if defined(MBEDTLS_PSA_CRYPTO_CLIENT)
|
#if ((MBEDTLS_VERSION_MAJOR < 4) \
|
||||||
|
&& defined(MBEDTLS_PSA_CRYPTO_C)) \
|
||||||
|
|| (MBEDTLS_VERSION_MAJOR >= 4 \
|
||||||
|
&& defined(MBEDTLS_PSA_CRYPTO_CLIENT))
|
||||||
|
|
||||||
#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C)
|
#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C)
|
||||||
|
|
||||||
@ -319,7 +326,7 @@ uint64_t mbedtls_test_parse_binary_string(data_t *bin_string);
|
|||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
#endif /* MBEDTLS_PSA_CRYPTO_CLIENT */
|
#endif /* MBEDTLS_PSA_CRYPTO_CLIENT || MBEDTLS_PSA_CRYPTO_C */
|
||||||
|
|
||||||
/** \def USE_PSA_INIT
|
/** \def USE_PSA_INIT
|
||||||
*
|
*
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
|
|
||||||
#if ((MBEDTLS_VERSION_MAJOR < 4) \
|
#if ((MBEDTLS_VERSION_MAJOR < 4) \
|
||||||
&& defined(MBEDTLS_PSA_CRYPTO_C)) \
|
&& defined(MBEDTLS_PSA_CRYPTO_C)) \
|
||||||
|| defined(MBEDTLS_PSA_CRYPTO_CLIENT)
|
|| (MBEDTLS_VERSION_MAJOR >= 4 \
|
||||||
|
&& defined(MBEDTLS_PSA_CRYPTO_CLIENT))
|
||||||
|
|
||||||
#include <mbedtls/asn1.h>
|
#include <mbedtls/asn1.h>
|
||||||
#include <psa/crypto.h>
|
#include <psa/crypto.h>
|
||||||
|
Reference in New Issue
Block a user