Blame SOURCES/openssl-1.0.2k-long-hello.patch

7779df
diff -up openssl-1.0.2k/ssl/s3_srvr.c.long-hello openssl-1.0.2k/ssl/s3_srvr.c
7779df
--- openssl-1.0.2k/ssl/s3_srvr.c.long-hello	2017-03-09 17:59:26.000000000 +0100
7779df
+++ openssl-1.0.2k/ssl/s3_srvr.c	2017-03-30 09:11:35.639338753 +0200
7779df
@@ -899,6 +899,23 @@ int ssl3_send_hello_request(SSL *s)
7779df
     return ssl_do_write(s);
7779df
 }
7779df
 
7779df
+/*
7779df
+ * Maximum size (excluding the Handshake header) of a ClientHello message,
7779df
+ * calculated as follows:
7779df
+ *
7779df
+ *  2 + # client_version
7779df
+ *  32 + # only valid length for random
7779df
+ *  1 + # length of session_id
7779df
+ *  32 + # maximum size for session_id
7779df
+ *  2 + # length of cipher suites
7779df
+ *  2^16-2 + # maximum length of cipher suites array
7779df
+ *  1 + # length of compression_methods
7779df
+ *  2^8-1 + # maximum length of compression methods
7779df
+ *  2 + # length of extensions
7779df
+ *  2^16-1 # maximum length of extensions
7779df
+ */
7779df
+#define CLIENT_HELLO_MAX_LENGTH         131396
7779df
+
7779df
 int ssl3_get_client_hello(SSL *s)
7779df
 {
7779df
     int i, j, ok, al = SSL_AD_INTERNAL_ERROR, ret = -1, cookie_valid = 0;
7779df
@@ -930,7 +947,7 @@ int ssl3_get_client_hello(SSL *s)
7779df
                                    SSL3_ST_SR_CLNT_HELLO_B,
7779df
                                    SSL3_ST_SR_CLNT_HELLO_C,
7779df
                                    SSL3_MT_CLIENT_HELLO,
7779df
-                                   SSL3_RT_MAX_PLAIN_LENGTH, &ok;;
7779df
+                                   CLIENT_HELLO_MAX_LENGTH, &ok;;
7779df
 
7779df
     if (!ok)
7779df
         return ((int)n);