mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-29 17:27:03 +00:00
psa: Make sure MBEDTLS_PSA_CRYPTO_CLIENT is defined
Make sure MBEDTLS_PSA_CRYPTO_CLIENT is defined when MBEDTLS_PSA_CRYPTO_C is defined and guard PSA client code only with MBEDTLS_PSA_CRYPTO_CLIENT. The definition of MBEDTLS_PSA_CRYPTO_CLIENT is done in crypto_types.h before the definition of psa_key_attributes_t. That way as PSA crypto client code is related to key attributes we can be quite confident that MBEDTLS_PSA_CRYPTO_CLIENT will be defined when needed. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
336678bccc
commit
395889f9b7
|
@ -35,6 +35,13 @@
|
||||||
|
|
||||||
#include "crypto_platform.h"
|
#include "crypto_platform.h"
|
||||||
|
|
||||||
|
/* If MBEDTLS_PSA_CRYPTO_C is defined, make sure MBEDTLS_PSA_CRYPTO_CLIENT
|
||||||
|
* is defined as well to include all PSA code.
|
||||||
|
*/
|
||||||
|
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||||
|
#define MBEDTLS_PSA_CRYPTO_CLIENT
|
||||||
|
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
/** \defgroup error Error codes
|
/** \defgroup error Error codes
|
||||||
|
|
|
@ -19,12 +19,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) || defined(MBEDTLS_PSA_CRYPTO_C)
|
|
||||||
|
|
||||||
#include "psa_crypto_service_integration.h"
|
#include "psa_crypto_service_integration.h"
|
||||||
#include "psa/crypto.h"
|
#include "psa/crypto.h"
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_PSA_CRYPTO_CLIENT)
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "mbedtls/platform.h"
|
#include "mbedtls/platform.h"
|
||||||
#if !defined(MBEDTLS_PLATFORM_C)
|
#if !defined(MBEDTLS_PLATFORM_C)
|
||||||
|
@ -81,4 +80,4 @@ psa_status_t psa_get_key_domain_parameters(
|
||||||
return( PSA_SUCCESS );
|
return( PSA_SUCCESS );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MBEDTLS_PSA_CRYPTO_CLIENT || MBEDTLS_PSA_CRYPTO_C */
|
#endif /* MBEDTLS_PSA_CRYPTO_CLIENT */
|
||||||
|
|
|
@ -33,13 +33,6 @@
|
||||||
#include "psa/crypto.h"
|
#include "psa/crypto.h"
|
||||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
||||||
|
|
||||||
/* If MBEDTLS_PSA_CRYPTO_C is defined, make sure MBEDTLS_PSA_CRYPTO_CLIENT
|
|
||||||
* is defined to run tests with dependency on MBEDTLS_PSA_CRYPTO_CLIENT.
|
|
||||||
*/
|
|
||||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
|
||||||
#define MBEDTLS_PSA_CRYPTO_CLIENT
|
|
||||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
|
||||||
|
|
||||||
/* Test code may use deprecated identifiers only if the preprocessor symbol
|
/* Test code may use deprecated identifiers only if the preprocessor symbol
|
||||||
* MBEDTLS_TEST_DEPRECATED is defined. When building tests, set
|
* MBEDTLS_TEST_DEPRECATED is defined. When building tests, set
|
||||||
* MBEDTLS_TEST_DEPRECATED explicitly if MBEDTLS_DEPRECATED_WARNING is
|
* MBEDTLS_TEST_DEPRECATED explicitly if MBEDTLS_DEPRECATED_WARNING is
|
||||||
|
|
Loading…
Reference in a new issue