mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Generate test wrappers for psa_generate_random()
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
@ -171,6 +171,8 @@ class PSAWrapperGenerator(c_wrapper_generator.Base):
|
|||||||
'psa_hash_verify',
|
'psa_hash_verify',
|
||||||
'psa_hash_compute',
|
'psa_hash_compute',
|
||||||
'psa_hash_compare'):
|
'psa_hash_compare'):
|
||||||
|
|
||||||
|
if function_name == 'psa_generate_random':
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -326,7 +326,13 @@ psa_status_t mbedtls_test_wrap_psa_generate_random(
|
|||||||
uint8_t *arg0_output,
|
uint8_t *arg0_output,
|
||||||
size_t arg1_output_size)
|
size_t arg1_output_size)
|
||||||
{
|
{
|
||||||
|
#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
|
||||||
|
MBEDTLS_TEST_MEMORY_POISON(arg0_output, arg1_output_size);
|
||||||
|
#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
|
||||||
psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
|
psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
|
||||||
|
#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
|
||||||
|
MBEDTLS_TEST_MEMORY_UNPOISON(arg0_output, arg1_output_size);
|
||||||
|
#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user