From a92fb0eb4279a0033508b56057bc7e2f66f51128 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 21 Dec 2021 14:52:56 -0800 Subject: [PATCH] Fix for session resumption to ensure use of the right cipher suite. ZD13297 --- src/internal.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index eb315b3b6..8c599022a 100644 --- a/src/internal.c +++ b/src/internal.c @@ -29404,7 +29404,17 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, } #endif - if (ret == 0) { + if (ret == 0 && ssl->options.resuming) { + /* for resumption use the cipher suite from session */ + ssl->options.cipherSuite0 = session->cipherSuite0; + ssl->options.cipherSuite = session->cipherSuite; + ret = SetCipherSpecs(ssl); + if (ret == 0) { + ret = PickHashSigAlgo(ssl, clSuites->hashSigAlgo, + clSuites->hashSigAlgoSz); + } + } + else if (ret == 0) { if (MatchSuite(ssl, clSuites) < 0) { WOLFSSL_MSG("Unsupported cipher suite, ClientHello"); ret = UNSUPPORTED_SUITE;