forked from wolfSSL/wolfssl
Sniffer Fix
Drop a handshake message if it is split across TLS records. The likely messages dropped are certificate and certificate request, which are ignored by the sniffer.
This commit is contained in:
@@ -245,7 +245,8 @@ static const char* const msgTable[] =
|
|||||||
|
|
||||||
/* 81 */
|
/* 81 */
|
||||||
"Bad Decrypt Size",
|
"Bad Decrypt Size",
|
||||||
"Extended Master Secret Hash Error"
|
"Extended Master Secret Hash Error",
|
||||||
|
"Handshake Message Split Across TLS Records"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -2060,8 +2061,9 @@ static int DoHandShake(const byte* input, int* sslBytes,
|
|||||||
startBytes = *sslBytes;
|
startBytes = *sslBytes;
|
||||||
|
|
||||||
if (*sslBytes < size) {
|
if (*sslBytes < size) {
|
||||||
SetError(HANDSHAKE_INPUT_STR, error, session, FATAL_ERROR_STATE);
|
Trace(SPLIT_HANDSHAKE_MSG_STR);
|
||||||
return -1;
|
*sslBytes = 0;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A session's arrays are released when the handshake is completed. */
|
/* A session's arrays are released when the handshake is completed. */
|
||||||
|
@@ -118,6 +118,7 @@
|
|||||||
|
|
||||||
#define BAD_DECRYPT_SIZE 81
|
#define BAD_DECRYPT_SIZE 81
|
||||||
#define EXTENDED_MASTER_HASH_STR 82
|
#define EXTENDED_MASTER_HASH_STR 82
|
||||||
|
#define SPLIT_HANDSHAKE_MSG_STR 83
|
||||||
/* !!!! also add to msgTable in sniffer.c and .rc file !!!! */
|
/* !!!! also add to msgTable in sniffer.c and .rc file !!!! */
|
||||||
|
|
||||||
|
|
||||||
|
@@ -99,5 +99,6 @@ STRINGTABLE
|
|||||||
|
|
||||||
81, "Bad Decrypt Size"
|
81, "Bad Decrypt Size"
|
||||||
82, "Extended Master Secret Hash Error"
|
82, "Extended Master Secret Hash Error"
|
||||||
|
83, "Handshake Message Split Across TLS Records"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user