Adapt ssl_clear_peer_cert() to removal of peer_cert field

This commit is contained in:
Hanno Becker 2019-02-07 13:17:53 +00:00
parent d5258faa29
commit 5062897507

View file

@ -6189,14 +6189,14 @@ static int ssl_check_peer_crt_unchanged( mbedtls_ssl_context *ssl,
static void ssl_clear_peer_cert( mbedtls_ssl_session *session )
{
#if defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE)
if( session->peer_cert != NULL )
{
mbedtls_x509_crt_free( session->peer_cert );
mbedtls_free( session->peer_cert );
session->peer_cert = NULL;
}
#if !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE)
#else
if( session->peer_cert_digest != NULL )
{
/* Zeroization is not necessary. */
@ -6205,7 +6205,7 @@ static void ssl_clear_peer_cert( mbedtls_ssl_session *session )
session->peer_cert_digest_type = MBEDTLS_MD_NONE;
session->peer_cert_digest_len = 0;
}
#endif /* MBEDTLS_SSL_KEEP_PEER_CERTIFICATE */
#endif /* !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE */
}
/*