Fix structures initialized too late in tests

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2022-11-27 21:32:37 +01:00
parent 2336555444
commit 391005cb3b

View File

@ -54,11 +54,11 @@ void pkcs7_verify( char *pkcs7_file, char *crt, char *filetobesigned, int do_has
mbedtls_pkcs7 pkcs7;
mbedtls_x509_crt x509;
USE_PSA_INIT();
mbedtls_pkcs7_init( &pkcs7 );
mbedtls_x509_crt_init( &x509 );
USE_PSA_INIT();
res = mbedtls_x509_crt_parse_file( &x509, crt );
TEST_EQUAL( res, 0 );
@ -127,12 +127,12 @@ void pkcs7_verify_multiple_signers( char *pkcs7_file, char *crt1, char *crt2, ch
mbedtls_x509_crt x509_1;
mbedtls_x509_crt x509_2;
USE_PSA_INIT();
mbedtls_pkcs7_init( &pkcs7 );
mbedtls_x509_crt_init( &x509_1 );
mbedtls_x509_crt_init( &x509_2 );
USE_PSA_INIT();
res = mbedtls_pk_load_file( pkcs7_file, &pkcs7_buf, &buflen );
TEST_EQUAL( res, 0 );