asymmetric_encrypt: check output length only if return code is PSA_SUCCESS.

Signed-off-by: Stephan Koch <koch@oberon.ch>
This commit is contained in:
oberon-sk 2023-02-13 13:42:02 +01:00 committed by Stephan Koch
parent f78a10052c
commit 10c0f770ce

View File

@ -7853,7 +7853,9 @@ void asymmetric_encrypt(int key_type_arg,
output, output_size,
&output_length);
TEST_EQUAL(actual_status, expected_status);
if (actual_status == PSA_SUCCESS) {
TEST_EQUAL(output_length, expected_output_length);
}
/* If the label is empty, the test framework puts a non-null pointer
* in label->x. Test that a null pointer works as well. */
@ -7868,8 +7870,10 @@ void asymmetric_encrypt(int key_type_arg,
output, output_size,
&output_length);
TEST_EQUAL(actual_status, expected_status);
if (actual_status == PSA_SUCCESS) {
TEST_EQUAL(output_length, expected_output_length);
}
}
exit:
/*