From d5258faa29c9e36608a0aedd5ef99365fc0dbb4f Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 7 Feb 2019 12:27:42 +0000 Subject: [PATCH] Adapt mbedtls_ssl_session_copy() to removal of `peer_cert` field --- library/ssl_tls.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index c739fe776..40d597569 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -375,6 +375,8 @@ int mbedtls_ssl_session_copy( mbedtls_ssl_session *dst, memcpy( dst, src, sizeof( mbedtls_ssl_session ) ); #if defined(MBEDTLS_X509_CRT_PARSE_C) + +#if defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) if( src->peer_cert != NULL ) { int ret; @@ -393,8 +395,7 @@ int mbedtls_ssl_session_copy( mbedtls_ssl_session *dst, return( ret ); } } - -#if !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) +#else /* MBEDTLS_SSL_KEEP_PEER_CERTIFICATE */ if( src->peer_cert_digest != NULL ) { dst->peer_cert_digest_len = src->peer_cert_digest_len;