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

Signed-off-by: Stephan Koch <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
This commit is contained in:
oberon-sk
2023-02-28 15:13:35 +00:00
committed by Dave Rodgman
parent 7a5168e90d
commit 8a23f49ebc
+6 -2
View File
@@ -4173,7 +4173,9 @@ void asymmetric_encrypt(int key_type_arg,
output, output_size,
&output_length);
TEST_EQUAL(actual_status, expected_status);
TEST_EQUAL(output_length, expected_output_length);
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. */
@@ -4188,7 +4190,9 @@ void asymmetric_encrypt(int key_type_arg,
output, output_size,
&output_length);
TEST_EQUAL(actual_status, expected_status);
TEST_EQUAL(output_length, expected_output_length);
if (actual_status == PSA_SUCCESS) {
TEST_EQUAL(output_length, expected_output_length);
}
}
exit: