diff options
Diffstat (limited to 'test/ssl_test_ctx.c')
-rw-r--r-- | test/ssl_test_ctx.c | 29 |
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. */ |