From cc6e0a650fa94a733d93237869c26450a9dd2680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 5 Dec 2022 12:55:05 +0100 Subject: [PATCH] Fix missing initialisation of PSA Crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the two failures in test_suite_x509parse when both ECP_RESTARTABLE and USE_PSA_CRYPTO are enabled. The failure happened because the operation is dispatched to PSA when restart is disabled (max_ops == 0). Previously it was correct for this test function not to initialize PSA, because it depends on ECP_RESTARTABLE which used to conflict with USE_PSA_CRYPTO, but that's no longer the case. Signed-off-by: Manuel Pégourié-Gonnard --- tests/suites/test_suite_x509parse.function | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function index 2585720ed..dc36b8166 100644 --- a/tests/suites/test_suite_x509parse.function +++ b/tests/suites/test_suite_x509parse.function @@ -579,6 +579,8 @@ void x509_verify_restart( char *crt_file, char *ca_file, mbedtls_x509_crt_init( &crt ); mbedtls_x509_crt_init( &ca ); + USE_PSA_INIT( ); + TEST_ASSERT( mbedtls_x509_crt_parse_file( &crt, crt_file ) == 0 ); TEST_ASSERT( mbedtls_x509_crt_parse_file( &ca, ca_file ) == 0 ); @@ -607,6 +609,7 @@ exit: mbedtls_x509_crt_restart_free( &rs_ctx ); mbedtls_x509_crt_free( &crt ); mbedtls_x509_crt_free( &ca ); + USE_PSA_DONE( ); } /* END_CASE */