From 94cc26dfa6ba5d400c7b5731ca7dbcacb33b65e4 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 7 Feb 2019 12:26:46 +0000 Subject: [PATCH] Adapt session ticket implementation to removal of `peer_cert` field --- library/ssl_ticket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/ssl_ticket.c b/library/ssl_ticket.c index e4054b4e5..a93a6ba14 100644 --- a/library/ssl_ticket.c +++ b/library/ssl_ticket.c @@ -292,8 +292,9 @@ static int ssl_load_session( mbedtls_ssl_session *session, /* Non-NULL pointer fields of `session` are meaningless * and potentially harmful. Zeroize them for safety. */ #if defined(MBEDTLS_X509_CRT_PARSE_C) +#if defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) session->peer_cert = NULL; -#if !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) +#else session->peer_cert_digest = NULL; #endif /* !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE */ #endif /* MBEDTLS_X509_CRT_PARSE_C */