aboutsummaryrefslogtreecommitdiffstats
path: root/test/ssl_test_ctx.c
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2017-11-05 17:46:48 +0100
committerBernd Edlinger <bernd.edlinger@hotmail.de>2017-11-05 17:46:48 +0100
commitcf72c7579201086cee303eadcb60bd28eff78dd9 (patch)
tree35c096098b2527a814c95cc674bb54747e3054a0 /test/ssl_test_ctx.c
parentb82acc3c1a7f304c9df31841753a0fa76b5b3cda (diff)
downloadopenssl-cf72c7579201086cee303eadcb60bd28eff78dd9.tar.gz
Implement Maximum Fragment Length TLS extension.
Based on patch from Tomasz Moń: https://groups.google.com/forum/#!topic/mailing.openssl.dev/fQxXvCg1uQY Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/1008)
Diffstat (limited to 'test/ssl_test_ctx.c')
-rw-r--r--test/ssl_test_ctx.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/ssl_test_ctx.c b/test/ssl_test_ctx.c
index 569aef0fa7..62417ac2c1 100644
--- a/test/ssl_test_ctx.c
+++ b/test/ssl_test_ctx.c
@@ -472,6 +472,34 @@ IMPLEMENT_SSL_TEST_INT_OPTION(SSL_TEST_CTX, test, app_data_size)
IMPLEMENT_SSL_TEST_INT_OPTION(SSL_TEST_CTX, test, max_fragment_size)
+/* Maximum-Fragment-Length TLS extension mode */
+static const test_enum ssl_max_fragment_len_mode[] = {
+ {"None", TLSEXT_max_fragment_length_DISABLED},
+ { "512", TLSEXT_max_fragment_length_512},
+ {"1024", TLSEXT_max_fragment_length_1024},
+ {"2048", TLSEXT_max_fragment_length_2048},
+ {"4096", TLSEXT_max_fragment_length_4096}
+};
+
+__owur static int parse_max_fragment_len_mode(SSL_TEST_CLIENT_CONF *client_conf,
+ const char *value)
+{
+ int ret_value;
+
+ if (!parse_enum(ssl_max_fragment_len_mode,
+ OSSL_NELEM(ssl_max_fragment_len_mode), &ret_value, value)) {
+ return 0;
+ }
+ client_conf->max_fragment_len_mode = ret_value;
+ return 1;
+}
+
+const char *ssl_max_fragment_len_name(int MFL_mode)
+{
+ return enum_name(ssl_max_fragment_len_mode,
+ OSSL_NELEM(ssl_max_fragment_len_mode), MFL_mode);
+}
+
/* Expected key and signature types */
@@ -639,6 +667,7 @@ static const ssl_test_client_option ssl_test_client_options[] = {
{ "RenegotiateCiphers", &parse_client_reneg_ciphers},
{ "SRPUser", &parse_client_srp_user },
{ "SRPPassword", &parse_client_srp_password },
+ { "MaxFragmentLenExt", &parse_max_fragment_len_mode },
};
/* Nested server options. */