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.
This commit is contained in:
Jaeden Amero 2019-02-06 12:57:46 +00:00
parent 4728469f53
commit 412654a605

View File

@ -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( ) );