Add missing calls to USE_PSA_DONE

Some functions were not deinitializing the PSA subsystem. This could
lead to resource leaks at the level of individual test cases, and
possibly at the level of the whole test suite depending on the order
and selection of test cases.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2021-02-02 21:04:06 +01:00
parent 9de97e21fe
commit 1f186ff330
2 changed files with 5 additions and 0 deletions

View File

@ -3850,6 +3850,7 @@ void ssl_tls_prf( int type, data_t * secret, data_t * random,
exit:
mbedtls_free( output );
USE_PSA_DONE( );
}
/* END_CASE */

View File

@ -667,6 +667,7 @@ exit:
mbedtls_x509_crt_free( &crt );
mbedtls_x509_crt_free( &ca );
mbedtls_x509_crl_free( &crl );
USE_PSA_DONE( );
}
/* END_CASE */
@ -733,6 +734,7 @@ void x509_verify_callback( char *crt_file, char *ca_file, char *name,
exit:
mbedtls_x509_crt_free( &crt );
mbedtls_x509_crt_free( &ca );
USE_PSA_DONE( );
}
/* END_CASE */
@ -1049,6 +1051,7 @@ void mbedtls_x509_crt_verify_max( char *ca_file, char *chain_dir, int nb_int,
exit:
mbedtls_x509_crt_free( &chain );
mbedtls_x509_crt_free( &trusted );
USE_PSA_DONE( );
}
/* END_CASE */
@ -1092,6 +1095,7 @@ void mbedtls_x509_crt_verify_chain( char *chain_paths, char *trusted_ca,
exit:
mbedtls_x509_crt_free( &trusted );
mbedtls_x509_crt_free( &chain );
USE_PSA_DONE( );
}
/* END_CASE */