Merge branch 'mbedtls-2.28-restricted' into bp228_buffer_protection_for_cipher

Signed-off-by: Gábor Mezei <63054694+gabor-mezei-arm@users.noreply.github.com>
This commit is contained in:
Gábor Mezei
2024-03-04 15:39:35 +00:00
committed by GitHub
3 changed files with 67 additions and 37 deletions

View File

@@ -175,6 +175,8 @@ class PSAWrapperGenerator(c_wrapper_generator.Base):
'psa_hash_compute',
'psa_hash_compare'):
return True
if function_name == 'psa_generate_random':
return True
if function_name in ('psa_mac_update',
'psa_mac_sign_finish',
'psa_mac_verify_finish',

View File

@@ -380,7 +380,13 @@ psa_status_t mbedtls_test_wrap_psa_generate_random(
uint8_t *arg0_output,
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);
#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;
}