mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-29 12:32:48 +00:00
psa_sim_crypto_[client/server]: check if CRYPTO_C is enabled
CRYPTO_C must or must-not be enabled on client and server sides as follows: - if it's enabled while building the client side it's a failure; - it it's NOT enabled while building the server it's a failure. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
51b2c86852
commit
75129e2ce3
@ -26,6 +26,10 @@
|
||||
|
||||
static psa_handle_t handle = -1;
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
#error "Error: MBEDTLS_PSA_CRYPTO_C must be disabled on client build"
|
||||
#endif
|
||||
|
||||
int psa_crypto_call(int function,
|
||||
uint8_t *in_params, size_t in_params_len,
|
||||
uint8_t **out_params, size_t *out_params_len)
|
||||
|
@ -17,6 +17,10 @@
|
||||
|
||||
#include "service.h"
|
||||
|
||||
#if !defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
#error "Error: MBEDTLS_PSA_CRYPTO_C must be enabled on server build"
|
||||
#endif
|
||||
|
||||
// Returns 1 for success, 0 for failure
|
||||
int psa_crypto_init_wrapper(
|
||||
uint8_t *in_params, size_t in_params_len,
|
||||
|
@ -268,6 +268,10 @@ sub server_implementations_header
|
||||
#include "psa_sim_serialise.h"
|
||||
|
||||
#include "service.h"
|
||||
|
||||
#if !defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
#error "Error: MBEDTLS_PSA_CRYPTO_C must be enabled on server build"
|
||||
#endif
|
||||
EOF
|
||||
}
|
||||
|
||||
@ -301,6 +305,10 @@ sub client_calls_header
|
||||
PRINT("Client: " fmt, ##__VA_ARGS__)
|
||||
|
||||
static psa_handle_t handle = -1;
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
#error "Error: MBEDTLS_PSA_CRYPTO_C must be disabled on client build"
|
||||
#endif
|
||||
EOF
|
||||
|
||||
$code .= debug_functions() if $debug;
|
||||
|
Loading…
x
Reference in New Issue
Block a user