From 0a3d6534c7c135543f938f1573d69f1657191970 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Mon, 31 Jul 2017 14:23:12 +0900 Subject: [PATCH] add SanityCheckMsgReceived in ProcessOldClientHello --- src/internal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 872f78652..186dd4289 100644 --- a/src/internal.c +++ b/src/internal.c @@ -22521,6 +22521,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, word16 i, j; ProtocolVersion pv; Suites clSuites; + int ret = -1; (void)inSz; WOLFSSL_MSG("Got old format client hello"); @@ -22660,7 +22661,6 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, ssl->options.haveSessionId = 1; /* DoClientHello uses same resume code */ if (ssl->options.resuming) { /* let's try */ - int ret = -1; WOLFSSL_SESSION* session = GetSession(ssl, ssl->arrays->masterSecret, 1); #ifdef HAVE_SESSION_TICKET @@ -22702,7 +22702,9 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, } } - return MatchSuite(ssl, &clSuites); + ret = MatchSuite(ssl, &clSuites); + if (ret != 0)return ret; + return SanityCheckMsgReceived(ssl, client_hello); } #endif /* OLD_HELLO_ALLOWED */