Fix test function derive_key_exercise()

mbedtls_test_psa_setup_key_derivation_wrap() returns 1 for success, 0
for error, so the test here was wrong.

This is just a hotfix in order to avoid a testing gap. Larger issues not
addressed here:

- I don't think we should just exit and mark the test as passed; if
we're not doing the actual testing this should be marked as SKIP.
- Returning 1 for success and 0 for failure is a violation of our
documented coding guidelines. We're also supposed to test with == 0 or
!= 0. Having consistent conventions is supposed to help avoid errors
like this.

Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
This commit is contained in:
Manuel Pégourié-Gonnard
2023-01-05 10:53:10 +01:00
parent d1a96b6b99
commit 6d08dba4f6
+1 -1
View File
@@ -4866,7 +4866,7 @@ void derive_key_exercise( int alg_arg,
&base_key ) );
/* Derive a key. */
if ( mbedtls_test_psa_setup_key_derivation_wrap( &operation, base_key, alg,
if ( !mbedtls_test_psa_setup_key_derivation_wrap( &operation, base_key, alg,
input1->x, input1->len,
input2->x, input2->len,
capacity ) )