detect server forcing compression on client w/o support

This commit is contained in:
toddouska
2016-09-07 09:17:14 -07:00
parent 33f24ebaa8
commit a5db13cd01
2 changed files with 10 additions and 1 deletions

View File

@@ -11162,6 +11162,9 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e)
case MATCH_SUITE_ERROR :
return "can't match cipher suite";
case COMPRESSION_ERROR :
return "compression mismatch error";
case BUILD_MSG_ERROR :
return "build message failure";
@@ -13048,6 +13051,11 @@ static void PickHashSigAlgo(WOLFSSL* ssl,
ssl->options.cipherSuite = cs1;
compression = input[i++];
if (compression != NO_COMPRESSION && !ssl->options.usingCompression) {
WOLFSSL_MSG("Server forcing compression w/o support");
return COMPRESSION_ERROR;
}
if (compression != ZLIB_COMPRESSION && ssl->options.usingCompression) {
WOLFSSL_MSG("Server refused compression, turning off");
ssl->options.usingCompression = 0; /* turn off if server refused */

View File

@@ -153,7 +153,8 @@ enum wolfSSL_ErrorCodes {
/* begin negotiation parameter errors */
UNSUPPORTED_SUITE = -500, /* unsupported cipher suite */
MATCH_SUITE_ERROR = -501 /* can't match cipher suite */
MATCH_SUITE_ERROR = -501, /* can't match cipher suite */
COMPRESSION_ERROR = -502 /* compression mismatch */
/* end negotiation parameter errors only 10 for now */
/* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */