forked from wolfSSL/wolfssl
fix sniffer resumption for new sessionId flag in 2.2.0
This commit is contained in:
@@ -1110,6 +1110,8 @@ static int ProcessServerHello(const byte* input, int* sslBytes,
|
|||||||
XMEMCPY(session->sslServer->arrays.sessionID, input, ID_LEN);
|
XMEMCPY(session->sslServer->arrays.sessionID, input, ID_LEN);
|
||||||
input += b;
|
input += b;
|
||||||
*sslBytes -= b;
|
*sslBytes -= b;
|
||||||
|
if (b)
|
||||||
|
session->sslServer->options.haveSessionId = 1;
|
||||||
|
|
||||||
(void)*input++; /* eat first byte, always 0 */
|
(void)*input++; /* eat first byte, always 0 */
|
||||||
b = *input++;
|
b = *input++;
|
||||||
@@ -1117,7 +1119,8 @@ static int ProcessServerHello(const byte* input, int* sslBytes,
|
|||||||
session->sslClient->options.cipherSuite = b;
|
session->sslClient->options.cipherSuite = b;
|
||||||
*sslBytes -= SUITE_LEN;
|
*sslBytes -= SUITE_LEN;
|
||||||
|
|
||||||
if (XMEMCMP(session->sslServer->arrays.sessionID,
|
if (session->sslServer->options.haveSessionId &&
|
||||||
|
XMEMCMP(session->sslServer->arrays.sessionID,
|
||||||
session->sslClient->arrays.sessionID, ID_LEN) == 0) {
|
session->sslClient->arrays.sessionID, ID_LEN) == 0) {
|
||||||
/* resuming */
|
/* resuming */
|
||||||
SSL_SESSION* resume = GetSession(session->sslServer,
|
SSL_SESSION* resume = GetSession(session->sslServer,
|
||||||
@@ -1271,6 +1274,7 @@ static int DoHandShake(const byte* input, int* sslBytes,
|
|||||||
ret = DoFinished(ssl, input, &inOutIdx, SNIFF);
|
ret = DoFinished(ssl, input, &inOutIdx, SNIFF);
|
||||||
|
|
||||||
if (ret == 0 && session->flags.cached == 0) {
|
if (ret == 0 && session->flags.cached == 0) {
|
||||||
|
session->sslServer->options.haveSessionId = 1;
|
||||||
AddSession(session->sslServer);
|
AddSession(session->sslServer);
|
||||||
session->flags.cached = 1;
|
session->flags.cached = 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user