Additional workaround for PR#2771
If OPENSSL_MAX_TLS1_2_CIPHER_LENGTH is set then limit the size of client ciphersuites to this value. A value of 50 should be sufficient. Document workarounds in CHANGES.
This commit is contained in:
@@ -467,6 +467,15 @@ static int ssl23_client_hello(SSL *s)
|
||||
SSLerr(SSL_F_SSL23_CLIENT_HELLO,SSL_R_NO_CIPHERS_AVAILABLE);
|
||||
return -1;
|
||||
}
|
||||
#ifdef OPENSSL_MAX_TLS1_2_CIPHER_LENGTH
|
||||
/* Some servers hang if client hello > 256 bytes
|
||||
* as hack workaround chop number of supported ciphers
|
||||
* to keep it well below this if we use TLS v1.2
|
||||
*/
|
||||
if (TLS1_get_version(s) >= TLS1_2_VERSION
|
||||
&& i > OPENSSL_MAX_TLS1_2_CIPHER_LENGTH)
|
||||
i = OPENSSL_MAX_TLS1_2_CIPHER_LENGTH & ~1;
|
||||
#endif
|
||||
s2n(i,p);
|
||||
p+=i;
|
||||
|
||||
|
Reference in New Issue
Block a user