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