mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-10 05:03:02 +03:00
asymmetric_encrypt: check output length only if return code is PSA_SUCCESS.
Signed-off-by: Stephan Koch <koch@oberon.ch> Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
@@ -4173,7 +4173,9 @@ void asymmetric_encrypt(int key_type_arg,
|
|||||||
output, output_size,
|
output, output_size,
|
||||||
&output_length);
|
&output_length);
|
||||||
TEST_EQUAL(actual_status, expected_status);
|
TEST_EQUAL(actual_status, expected_status);
|
||||||
|
if (actual_status == PSA_SUCCESS) {
|
||||||
TEST_EQUAL(output_length, expected_output_length);
|
TEST_EQUAL(output_length, expected_output_length);
|
||||||
|
}
|
||||||
|
|
||||||
/* If the label is empty, the test framework puts a non-null pointer
|
/* If the label is empty, the test framework puts a non-null pointer
|
||||||
* in label->x. Test that a null pointer works as well. */
|
* in label->x. Test that a null pointer works as well. */
|
||||||
@@ -4188,8 +4190,10 @@ void asymmetric_encrypt(int key_type_arg,
|
|||||||
output, output_size,
|
output, output_size,
|
||||||
&output_length);
|
&output_length);
|
||||||
TEST_EQUAL(actual_status, expected_status);
|
TEST_EQUAL(actual_status, expected_status);
|
||||||
|
if (actual_status == PSA_SUCCESS) {
|
||||||
TEST_EQUAL(output_length, expected_output_length);
|
TEST_EQUAL(output_length, expected_output_length);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user