Skip to content

Commit 2febc1c

Browse files
committed
ProcessServerHello: verify extension lengths
F-428
1 parent 186aaad commit 2febc1c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/sniffer.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3847,6 +3847,11 @@ static int ProcessServerHello(int msgSz, const byte* input, int* sslBytes,
38473847
case EXT_MAX_FRAGMENT_LENGTH:
38483848
{
38493849
word16 max_fragment = MAX_RECORD_SIZE;
3850+
if (extLen != 1) {
3851+
SetError(SERVER_HELLO_INPUT_STR, error, session,
3852+
FATAL_ERROR_STATE);
3853+
return WOLFSSL_FATAL_ERROR;
3854+
}
38503855
switch (input[0]) {
38513856
case WOLFSSL_MFL_2_8 : max_fragment = 256; break;
38523857
case WOLFSSL_MFL_2_9 : max_fragment = 512; break;
@@ -3862,6 +3867,11 @@ static int ProcessServerHello(int msgSz, const byte* input, int* sslBytes,
38623867
}
38633868
#endif
38643869
case EXT_SUPPORTED_VERSIONS:
3870+
if (extLen < 2) {
3871+
SetError(SERVER_HELLO_INPUT_STR, error, session,
3872+
FATAL_ERROR_STATE);
3873+
return WOLFSSL_FATAL_ERROR;
3874+
}
38653875
session->sslServer->version.major = input[0];
38663876
session->sslServer->version.minor = input[1];
38673877
session->sslClient->version.major = input[0];

0 commit comments

Comments
 (0)