Generate test wrappers

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
Thomas Daubney 2024-01-30 14:04:47 +00:00
parent 6adbb2a351
commit 27b48a312f
2 changed files with 13 additions and 0 deletions

View File

@ -154,6 +154,9 @@ class PSAWrapperGenerator(c_wrapper_generator.Base):
'psa_sign_hash',
'psa_verify_hash'):
return True
if function_name in ('psa_asymmetric_encrypt',
'pas_asymmetric_decrypt'):
return True
return False
def _write_function_call(self, out: typing_util.Writable,

View File

@ -221,7 +221,17 @@ psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt(
size_t arg7_output_size,
size_t *arg8_output_length)
{
#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length);
MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size);
#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
psa_status_t status = (psa_asymmetric_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_salt, arg5_salt_length, arg6_output, arg7_output_size, arg8_output_length);
#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length);
MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size);
#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
return status;
}