From 498d8e6c15189ec733fb92144cf323650fe8ce30 Mon Sep 17 00:00:00 2001 From: Eric Blankenhorn Date: Fri, 24 Aug 2018 07:53:35 -0500 Subject: [PATCH] Fix for old certs not discarded when server does not resume session --- src/internal.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/internal.c b/src/internal.c index d2b932619..74c0176ea 100644 --- a/src/internal.c +++ b/src/internal.c @@ -9751,6 +9751,14 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx, WOLFSSL_START(WC_FUNC_CERTIFICATE_DO); WOLFSSL_ENTER("DoCertificate"); +#ifdef SESSION_CERTS + /* Reset the session cert chain count in case the session resume failed. */ + ssl->session.chain.count = 0; + #ifdef WOLFSSL_ALT_CERT_CHAINS + ssl->session.altChain.count = 0; + #endif +#endif /* SESSION_CERTS */ + ret = ProcessPeerCerts(ssl, input, inOutIdx, size); #ifdef OPENSSL_EXTRA