mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-10-23 00:57:56 +00:00
tests: ssl_helpers: run ssl_context reset check only when the SSL context is setup
Signed-off-by: Valerio Setti <[email protected]>
This commit is contained in:
committed by
Gilles Peskine
parent
2c35acc231
commit
9c2ef6a4da
@@ -934,16 +934,17 @@ void mbedtls_test_ssl_endpoint_free(
|
||||
{
|
||||
test_ssl_endpoint_certificate_free(ep);
|
||||
|
||||
mbedtls_ssl_context ssl_before;
|
||||
// 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 */
|
||||
memcpy(&ssl_before, &(ep->ssl), sizeof(mbedtls_ssl_context));
|
||||
|
||||
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));
|
||||
/* Dump the SSL context before resetting it */
|
||||
memcpy(&ssl_before, &(ep->ssl), sizeof(mbedtls_ssl_context));
|
||||
|
||||
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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user