aboutsummaryrefslogtreecommitdiffstats
path: root/test/ssl_test_ctx.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-02-15 09:25:52 +0000
committerMatt Caswell <matt@openssl.org>2017-02-17 10:28:01 +0000
commit9b92f161708e31de87cf8df0d58e3f99bd7d1724 (patch)
tree4439bb9f660184cef9a8d1a2530a8e5fb51e296b /test/ssl_test_ctx.c
parent398206375688f053774ab0622a59db69fb2e2b99 (diff)
downloadopenssl-9b92f161708e31de87cf8df0d58e3f99bd7d1724.tar.gz
Add some KeyUpdate tests
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2609)
Diffstat (limited to 'test/ssl_test_ctx.c')
-rw-r--r--test/ssl_test_ctx.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ssl_test_ctx.c b/test/ssl_test_ctx.c
index c5b9a3ebe6..66fb31ce5a 100644
--- a/test/ssl_test_ctx.c
+++ b/test/ssl_test_ctx.c
@@ -322,6 +322,8 @@ static const test_enum ssl_handshake_modes[] = {
{"Resume", SSL_TEST_HANDSHAKE_RESUME},
{"RenegotiateServer", SSL_TEST_HANDSHAKE_RENEG_SERVER},
{"RenegotiateClient", SSL_TEST_HANDSHAKE_RENEG_CLIENT},
+ {"KeyUpdateServer", SSL_TEST_HANDSHAKE_KEY_UPDATE_SERVER},
+ {"KeyUpdateClient", SSL_TEST_HANDSHAKE_KEY_UPDATE_CLIENT},
};
__owur static int parse_handshake_mode(SSL_TEST_CTX *test_ctx, const char *value)
@@ -345,6 +347,24 @@ const char *ssl_handshake_mode_name(ssl_handshake_mode_t mode)
IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, reneg_ciphers)
+/* KeyUpdateType */
+
+static const test_enum ssl_key_update_types[] = {
+ {"KeyUpdateRequested", SSL_KEY_UPDATE_REQUESTED},
+ {"KeyUpdateNotRequested", SSL_KEY_UPDATE_NOT_REQUESTED},
+};
+
+__owur static int parse_key_update_type(SSL_TEST_CTX *test_ctx, const char *value)
+{
+ int ret_value;
+ if (!parse_enum(ssl_key_update_types, OSSL_NELEM(ssl_key_update_types),
+ &ret_value, value)) {
+ return 0;
+ }
+ test_ctx->key_update_type = ret_value;
+ return 1;
+}
+
/* CT Validation */
static const test_enum ssl_ct_validation_modes[] = {
@@ -522,6 +542,7 @@ static const ssl_test_ctx_option ssl_test_ctx_options[] = {
{ "ExpectedNPNProtocol", &parse_test_expected_npn_protocol },
{ "ExpectedALPNProtocol", &parse_test_expected_alpn_protocol },
{ "HandshakeMode", &parse_handshake_mode },
+ { "KeyUpdateType", &parse_key_update_type },
{ "ResumptionExpected", &parse_test_resumption_expected },
{ "ApplicationData", &parse_test_app_data_size },
{ "MaxFragmentSize", &parse_test_max_fragment_size },