From 412654a605aae954cd844325c1ff74125c5ac49c Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Wed, 6 Feb 2019 12:57:46 +0000 Subject: [PATCH] psa: Expect output-buffer-sized RSA-decryption When RSA decrypting, unlike with RSA encrypting, we sometimes expect the output length will be less than the key size. For instance, in the case where the plaintext is zero-length we expect the output length of the decryption to be zero-length as well, not key size in length. For must-fail tests, we don't expect output-buffer-sized RSA-decryption, only that the output length is less than or equal to the output size, so these tests remain unchanged. Change the must-pass tests to expect that the actual output size is equal to the expected length of the output buffer instead of always being the key size. --- tests/suites/test_suite_psa_crypto.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index a9d76dbe6e..8b0b839fac 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -3206,7 +3206,7 @@ void asymmetric_decrypt( int key_type_arg, size_t output_length = ~0; psa_key_policy_t policy = PSA_KEY_POLICY_INIT; - output_size = key_data->len; + output_size = expected_data->len; ASSERT_ALLOC( output, output_size ); PSA_ASSERT( psa_crypto_init( ) );