Skip to content

Commit 412654a

Browse files
committed
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.
1 parent 4728469 commit 412654a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/suites/test_suite_psa_crypto.function

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3206,7 +3206,7 @@ void asymmetric_decrypt( int key_type_arg,
32063206
size_t output_length = ~0;
32073207
psa_key_policy_t policy = PSA_KEY_POLICY_INIT;
32083208

3209-
output_size = key_data->len;
3209+
output_size = expected_data->len;
32103210
ASSERT_ALLOC( output, output_size );
32113211

32123212
PSA_ASSERT( psa_crypto_init( ) );

0 commit comments

Comments
 (0)