mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-07 06:42:56 +03:00
Allow alternative names for overridden PSA headers
Integrators of Mbed TLS may override the header files "psa/crypto_platform.h" and "psa/crypto_struct.h" by overwriting the files or by placing alternative versions earlier in the include file search path. These two methods are sometimes inconvenient, so allow a third method which doesn't require overwriting files or having a precise order for the include path: integrators can now specify alternative names for the headers. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@@ -22,7 +22,11 @@
|
||||
#ifndef PSA_CRYPTO_H
|
||||
#define PSA_CRYPTO_H
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_PLATFORM_FILE)
|
||||
#include MBEDTLS_PSA_CRYPTO_PLATFORM_FILE
|
||||
#else
|
||||
#include "crypto_platform.h"
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -4677,7 +4681,11 @@ psa_status_t psa_verify_hash_abort(
|
||||
|
||||
/* The file "crypto_struct.h" contains definitions for
|
||||
* implementation-specific structs that are declared above. */
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_STRUCT_FILE)
|
||||
#include MBEDTLS_PSA_CRYPTO_STRUCT_FILE
|
||||
#else
|
||||
#include "crypto_struct.h"
|
||||
#endif
|
||||
|
||||
/* The file "crypto_extra.h" contains vendor-specific definitions. This
|
||||
* can include vendor-defined algorithms, extra functions, etc. */
|
||||
|
@@ -34,7 +34,11 @@
|
||||
#define PSA_CRYPTO_TYPES_H
|
||||
#include "mbedtls/private_access.h"
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_PLATFORM_FILE)
|
||||
#include MBEDTLS_PSA_CRYPTO_PLATFORM_FILE
|
||||
#else
|
||||
#include "crypto_platform.h"
|
||||
#endif
|
||||
|
||||
/* If MBEDTLS_PSA_CRYPTO_C is defined, make sure MBEDTLS_PSA_CRYPTO_CLIENT
|
||||
* is defined as well to include all PSA code.
|
||||
|
Reference in New Issue
Block a user