Merge pull request #2069 from dgarske/fix_8192

Fixes for handling 6144 and 8192 bit with TLS v1.3
This commit is contained in:
toddouska
2019-02-07 15:02:40 -08:00
committed by GitHub
2 changed files with 9 additions and 2 deletions

View File

@ -9648,6 +9648,7 @@ int TLSX_Parse(WOLFSSL* ssl, byte* input, word16 length, byte msgType,
#ifdef WOLFSSL_TLS13 #ifdef WOLFSSL_TLS13
if (IsAtLeastTLSv1_3(ssl->ctx->method->version) && if (IsAtLeastTLSv1_3(ssl->ctx->method->version) &&
msgType != client_hello && msgType != client_hello &&
msgType != server_hello &&
msgType != encrypted_extensions) { msgType != encrypted_extensions) {
return EXT_NOT_ALLOWED; return EXT_NOT_ALLOWED;
} }
@ -9655,6 +9656,11 @@ int TLSX_Parse(WOLFSSL* ssl, byte* input, word16 length, byte msgType,
msgType == encrypted_extensions) { msgType == encrypted_extensions) {
return EXT_NOT_ALLOWED; return EXT_NOT_ALLOWED;
} }
else if (IsAtLeastTLSv1_3(ssl->ctx->method->version) &&
msgType == server_hello &&
!ssl->options.downgrade) {
return EXT_NOT_ALLOWED;
}
#endif #endif
ret = EC_PARSE(ssl, input + offset, size, isRequest); ret = EC_PARSE(ssl, input + offset, size, isRequest);
break; break;

View File

@ -1163,8 +1163,9 @@ enum Misc {
HELLO_EXT_EXTMS = 0x0017, /* ID for the extended master secret ext */ HELLO_EXT_EXTMS = 0x0017, /* ID for the extended master secret ext */
SECRET_LEN = WOLFSSL_MAX_MASTER_KEY_LENGTH, SECRET_LEN = WOLFSSL_MAX_MASTER_KEY_LENGTH,
/* pre RSA and all master */ /* pre RSA and all master */
#if defined(WOLFSSL_MYSQL_COMPATIBLE) #if defined(WOLFSSL_MYSQL_COMPATIBLE) || \
ENCRYPT_LEN = 1024, /* allow larger static buffer with mysql */ (defined(USE_FAST_MATH) && defined(FP_MAX_BITS) && FP_MAX_BITS > 8192)
ENCRYPT_LEN = 1024, /* allow 8192 bit static buffer */
#else #else
ENCRYPT_LEN = 512, /* allow 4096 bit static buffer */ ENCRYPT_LEN = 512, /* allow 4096 bit static buffer */
#endif #endif