mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-05-06 01:44:06 +02:00
Free psa crypto at the end of programs when initialized
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
@@ -334,12 +334,12 @@ exit:
|
||||
#endif
|
||||
|
||||
mbedtls_net_free(&server_fd);
|
||||
|
||||
mbedtls_x509_crt_free(&cacert);
|
||||
mbedtls_ssl_free(&ssl);
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
mbedtls_ctr_drbg_free(&ctr_drbg);
|
||||
mbedtls_entropy_free(&entropy);
|
||||
mbedtls_psa_crypto_free();
|
||||
|
||||
#if defined(_WIN32)
|
||||
mbedtls_printf(" + Press Enter to exit this program.\n");
|
||||
|
||||
@@ -404,6 +404,7 @@ exit:
|
||||
#endif
|
||||
mbedtls_ctr_drbg_free(&ctr_drbg);
|
||||
mbedtls_entropy_free(&entropy);
|
||||
mbedtls_psa_crypto_free();
|
||||
|
||||
#if defined(_WIN32)
|
||||
printf(" Press Enter to exit this program.\n");
|
||||
|
||||
@@ -274,7 +274,6 @@ int main(void)
|
||||
|
||||
exit:
|
||||
mbedtls_net_free(&server_fd);
|
||||
|
||||
mbedtls_ssl_free(&ssl);
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
mbedtls_ctr_drbg_free(&ctr_drbg);
|
||||
@@ -282,6 +281,7 @@ exit:
|
||||
#if defined(MBEDTLS_X509_CRT_PARSE_C)
|
||||
mbedtls_x509_crt_free(&ca);
|
||||
#endif
|
||||
mbedtls_psa_crypto_free();
|
||||
|
||||
mbedtls_exit(ret);
|
||||
}
|
||||
|
||||
@@ -284,12 +284,12 @@ exit:
|
||||
#endif
|
||||
|
||||
mbedtls_net_free(&server_fd);
|
||||
|
||||
mbedtls_x509_crt_free(&cacert);
|
||||
mbedtls_ssl_free(&ssl);
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
mbedtls_ctr_drbg_free(&ctr_drbg);
|
||||
mbedtls_entropy_free(&entropy);
|
||||
mbedtls_psa_crypto_free();
|
||||
|
||||
#if defined(_WIN32)
|
||||
mbedtls_printf(" + Press Enter to exit this program.\n");
|
||||
|
||||
@@ -1017,6 +1017,8 @@ int main(int argc, char *argv[])
|
||||
printf("Finished. No valid base64 code found\n");
|
||||
}
|
||||
|
||||
mbedtls_psa_crypto_free();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -378,13 +378,13 @@ int main(void)
|
||||
exit:
|
||||
mbedtls_net_free(&client_fd);
|
||||
mbedtls_net_free(&listen_fd);
|
||||
|
||||
mbedtls_x509_crt_free(&srvcert);
|
||||
mbedtls_pk_free(&pkey);
|
||||
mbedtls_ssl_free(&ssl);
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
mbedtls_ctr_drbg_free(&ctr_drbg);
|
||||
mbedtls_entropy_free(&entropy);
|
||||
mbedtls_psa_crypto_free();
|
||||
|
||||
#if defined(_WIN32)
|
||||
mbedtls_printf(" Press Enter to exit this program.\n");
|
||||
|
||||
@@ -801,6 +801,7 @@ exit:
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
mbedtls_ctr_drbg_free(&ctr_drbg);
|
||||
mbedtls_entropy_free(&entropy);
|
||||
mbedtls_psa_crypto_free();
|
||||
|
||||
#if defined(_WIN32)
|
||||
mbedtls_printf(" + Press Enter to exit this program.\n");
|
||||
|
||||
@@ -487,14 +487,12 @@ exit:
|
||||
mbedtls_ctr_drbg_free(&ctr_drbg);
|
||||
mbedtls_entropy_free(&entropy);
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
|
||||
mbedtls_net_free(&listen_fd);
|
||||
|
||||
mbedtls_mutex_free(&debug_mutex);
|
||||
|
||||
#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
|
||||
mbedtls_memory_buffer_alloc_free();
|
||||
#endif
|
||||
mbedtls_psa_crypto_free();
|
||||
|
||||
#if defined(_WIN32)
|
||||
mbedtls_printf(" Press Enter to exit this program.\n");
|
||||
|
||||
@@ -357,7 +357,6 @@ exit:
|
||||
|
||||
mbedtls_net_free(&client_fd);
|
||||
mbedtls_net_free(&listen_fd);
|
||||
|
||||
mbedtls_x509_crt_free(&srvcert);
|
||||
mbedtls_pk_free(&pkey);
|
||||
mbedtls_ssl_free(&ssl);
|
||||
@@ -367,6 +366,7 @@ exit:
|
||||
#endif
|
||||
mbedtls_ctr_drbg_free(&ctr_drbg);
|
||||
mbedtls_entropy_free(&entropy);
|
||||
mbedtls_psa_crypto_free();
|
||||
|
||||
#if defined(_WIN32)
|
||||
mbedtls_printf(" Press Enter to exit this program.\n");
|
||||
|
||||
Reference in New Issue
Block a user