mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-25 13:43:31 +00:00
Remove the manually written poisoning wrapper
This fixes the build with ASan + MBEDTLS_TEST_HOOKS. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
90d14d7fc2
commit
8e7960b685
@ -1,8 +1,11 @@
|
|||||||
/** Memory poisoning wrappers for PSA functions.
|
/** Support for memory poisoning wrappers for PSA functions.
|
||||||
*
|
*
|
||||||
* These wrappers poison the input and output buffers of each function
|
* The wrappers poison the input and output buffers of each function
|
||||||
* before calling it, to ensure that it does not access the buffers
|
* before calling it, to ensure that it does not access the buffers
|
||||||
* except by calling the approved buffer-copying functions.
|
* except by calling the approved buffer-copying functions.
|
||||||
|
*
|
||||||
|
* This header declares support functions. The wrappers themselves are
|
||||||
|
* decalred in the automatically generated file `test/psa_test_wrappers.h`.
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright The Mbed TLS Contributors
|
* Copyright The Mbed TLS Contributors
|
||||||
@ -32,16 +35,6 @@ void mbedtls_poison_test_hooks_setup(void);
|
|||||||
*/
|
*/
|
||||||
void mbedtls_poison_test_hooks_teardown(void);
|
void mbedtls_poison_test_hooks_teardown(void);
|
||||||
|
|
||||||
psa_status_t wrap_psa_cipher_encrypt(mbedtls_svc_key_id_t key,
|
|
||||||
psa_algorithm_t alg,
|
|
||||||
const uint8_t *input,
|
|
||||||
size_t input_length,
|
|
||||||
uint8_t *output,
|
|
||||||
size_t output_size,
|
|
||||||
size_t *output_length);
|
|
||||||
|
|
||||||
#define psa_cipher_encrypt(...) wrap_psa_cipher_encrypt(__VA_ARGS__)
|
|
||||||
|
|
||||||
#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_TEST_MEMORY_CAN_POISON */
|
#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_TEST_MEMORY_CAN_POISON */
|
||||||
|
|
||||||
#endif /* PSA_MEMORY_POISONING_WRAPPERS_H */
|
#endif /* PSA_MEMORY_POISONING_WRAPPERS_H */
|
||||||
|
@ -27,27 +27,5 @@ void mbedtls_poison_test_hooks_teardown(void)
|
|||||||
psa_output_post_copy_hook = NULL;
|
psa_output_post_copy_hook = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
psa_status_t wrap_psa_cipher_encrypt(mbedtls_svc_key_id_t key,
|
|
||||||
psa_algorithm_t alg,
|
|
||||||
const uint8_t *input,
|
|
||||||
size_t input_length,
|
|
||||||
uint8_t *output,
|
|
||||||
size_t output_size,
|
|
||||||
size_t *output_length)
|
|
||||||
{
|
|
||||||
MBEDTLS_TEST_MEMORY_POISON(input, input_length);
|
|
||||||
MBEDTLS_TEST_MEMORY_POISON(output, output_size);
|
|
||||||
psa_status_t status = psa_cipher_encrypt(key,
|
|
||||||
alg,
|
|
||||||
input,
|
|
||||||
input_length,
|
|
||||||
output,
|
|
||||||
output_size,
|
|
||||||
output_length);
|
|
||||||
MBEDTLS_TEST_MEMORY_UNPOISON(input, input_length);
|
|
||||||
MBEDTLS_TEST_MEMORY_UNPOISON(output, output_size);
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_PSA_CRYPTO_C &&
|
#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_PSA_CRYPTO_C &&
|
||||||
MBEDTLS_TEST_MEMORY_CAN_POISON */
|
MBEDTLS_TEST_MEMORY_CAN_POISON */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user