summaryrefslogtreecommitdiffstats
path: root/test/ssl_test_ctx.c
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2016-08-16 15:11:08 +0200
committerEmilia Kasper <emilia@openssl.org>2016-08-18 12:46:00 +0200
commit6dc9974547427261db25758612b6a570083d52e6 (patch)
tree4dfaa8518da53208c3f109a3062feb540f6c742e /test/ssl_test_ctx.c
parent9d8c2dfe14cb371d242c04a52182aa0aee25ed18 (diff)
Port multi-buffer tests
Make maximum fragment length configurable and add various fragmentation tests, in addition to the existing multi-buffer tests. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/ssl_test_ctx.c')
-rw-r--r--test/ssl_test_ctx.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/ssl_test_ctx.c b/test/ssl_test_ctx.c
index 8c953a3add..ac90f199b2 100644
--- a/test/ssl_test_ctx.c
+++ b/test/ssl_test_ctx.c
@@ -17,6 +17,8 @@
#include "testutil.h"
static const int default_app_data_size = 256;
+/* Default set to be as small as possible to exercise fragmentation. */
+static const int default_max_fragment_size = 512;
static int parse_boolean(const char *value, int *result)
{
@@ -389,11 +391,17 @@ IMPLEMENT_SSL_TEST_BOOL_OPTION(SSL_TEST_CTX, test, resumption_expected)
IMPLEMENT_SSL_TEST_BOOL_OPTION(SSL_TEST_SERVER_CONF, server, broken_session_ticket)
/***********************/
-/* Applicationdata */
+/* ApplicationData */
/***********************/
IMPLEMENT_SSL_TEST_INT_OPTION(SSL_TEST_CTX, test, app_data_size)
+/***********************/
+/* MaxFragmentSize */
+/***********************/
+
+IMPLEMENT_SSL_TEST_INT_OPTION(SSL_TEST_CTX, test, max_fragment_size)
+
/*************************************************************/
/* Known test options and their corresponding parse methods. */
/*************************************************************/
@@ -417,6 +425,7 @@ static const ssl_test_ctx_option ssl_test_ctx_options[] = {
{ "HandshakeMode", &parse_handshake_mode },
{ "ResumptionExpected", &parse_test_resumption_expected },
{ "ApplicationData", &parse_test_app_data_size },
+ { "MaxFragmentSize", &parse_test_max_fragment_size },
};
/* Nested client options. */
@@ -456,6 +465,7 @@ SSL_TEST_CTX *SSL_TEST_CTX_new()
ret = OPENSSL_zalloc(sizeof(*ret));
TEST_check(ret != NULL);
ret->app_data_size = default_app_data_size;
+ ret->max_fragment_size = default_max_fragment_size;
return ret;
}