aboutsummaryrefslogtreecommitdiffstats
path: root/test/ssl_test_ctx.c
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2017-03-14 13:48:54 +0100
committerEmilia Kasper <emilia@openssl.org>2017-03-14 15:07:50 +0100
commitea1ecd9831cfe8de9dbeafdfec344b8c944c9b84 (patch)
tree0bc72e3a4ca7d40ba0cc943099195af509b0ee1d /test/ssl_test_ctx.c
parent4b5f7e7555340db28b285452cfd0cafe1854de2a (diff)
downloadopenssl-ea1ecd9831cfe8de9dbeafdfec344b8c944c9b84.tar.gz
Port SRP tests to the new test framework
Also add negative tests for password mismatch. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test/ssl_test_ctx.c')
-rw-r--r--test/ssl_test_ctx.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ssl_test_ctx.c b/test/ssl_test_ctx.c
index d668f51f51..3e3be9e058 100644
--- a/test/ssl_test_ctx.c
+++ b/test/ssl_test_ctx.c
@@ -322,6 +322,12 @@ IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, alpn_protocols)
IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_SERVER_CONF, server, alpn_protocols)
IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CTX, test, expected_alpn_protocol)
+/* SRP options */
+IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, srp_user)
+IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_SERVER_CONF, server, srp_user)
+IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, srp_password)
+IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_SERVER_CONF, server, srp_password)
+
/* Handshake mode */
static const test_enum ssl_handshake_modes[] = {
@@ -576,6 +582,8 @@ static const ssl_test_client_option ssl_test_client_options[] = {
{ "ALPNProtocols", &parse_client_alpn_protocols },
{ "CTValidation", &parse_ct_validation },
{ "RenegotiateCiphers", &parse_client_reneg_ciphers},
+ { "SRPUser", &parse_client_srp_user },
+ { "SRPPassword", &parse_client_srp_password },
};
/* Nested server options. */
@@ -590,6 +598,8 @@ static const ssl_test_server_option ssl_test_server_options[] = {
{ "ALPNProtocols", &parse_server_alpn_protocols },
{ "BrokenSessionTicket", &parse_server_broken_session_ticket },
{ "CertStatus", &parse_certstatus },
+ { "SRPUser", &parse_server_srp_user },
+ { "SRPPassword", &parse_server_srp_password },
};
/*
@@ -615,6 +625,12 @@ static void ssl_test_extra_conf_free_data(SSL_TEST_EXTRA_CONF *conf)
OPENSSL_free(conf->server.alpn_protocols);
OPENSSL_free(conf->server2.alpn_protocols);
OPENSSL_free(conf->client.reneg_ciphers);
+ OPENSSL_free(conf->server.srp_user);
+ OPENSSL_free(conf->server.srp_password);
+ OPENSSL_free(conf->server2.srp_user);
+ OPENSSL_free(conf->server2.srp_password);
+ OPENSSL_free(conf->client.srp_user);
+ OPENSSL_free(conf->client.srp_password);
}
static void ssl_test_ctx_free_extra_data(SSL_TEST_CTX *ctx)