X.509: fix test failures

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/tests/suites/test_suite_pkcs7.function b/tests/suites/test_suite_pkcs7.function
index cc032ac..016714b 100644
--- a/tests/suites/test_suite_pkcs7.function
+++ b/tests/suites/test_suite_pkcs7.function
@@ -75,6 +75,7 @@
     mbedtls_pkcs7 pkcs7;
     mbedtls_x509_crt **crts = NULL;
 
+    MD_OR_USE_PSA_INIT();
 
     /* crt_files are space seprated list */
     for (i = 0; i < strlen(crt_files); i++) {
@@ -104,8 +105,6 @@
         mbedtls_x509_crt_init(crts[i]);
     }
 
-    USE_PSA_INIT();
-
     res = mbedtls_pk_load_file(pkcs7_file, &pkcs7_buf, &buflen);
     TEST_EQUAL(res, 0);
 
@@ -164,6 +163,6 @@
     mbedtls_free(crts);
     mbedtls_free(data);
     mbedtls_free(pkcs7_buf);
-    USE_PSA_DONE();
+    MD_OR_USE_PSA_DONE();
 }
 /* END_CASE */