mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-07-30 16:26:33 +08:00
tests: ssl_helpers: run ssl_context reset check only when the SSL context is setup
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
parent
c668f4e68e
commit
4f92a63e4a
@ -1035,6 +1035,8 @@ int mbedtls_test_ssl_endpoint_init(
|
||||
void mbedtls_test_ssl_endpoint_free(
|
||||
mbedtls_test_ssl_endpoint *ep)
|
||||
{
|
||||
// mbedtls_ssl_session_reset() requires the SSL to be setup.
|
||||
if (ep->ssl.conf != NULL) {
|
||||
mbedtls_ssl_context ssl_before;
|
||||
|
||||
/* Dump the SSL context before resetting it */
|
||||
@ -1043,6 +1045,7 @@ void mbedtls_test_ssl_endpoint_free(
|
||||
mbedtls_ssl_session_reset(&(ep->ssl));
|
||||
/* Check that required fields were properly reset */
|
||||
mbedtls_test_ssl_check_context_after_session_reset(&ssl_before, &(ep->ssl));
|
||||
}
|
||||
mbedtls_ssl_free(&(ep->ssl));
|
||||
mbedtls_ssl_config_free(&(ep->conf));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user