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
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));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user