aboutsummaryrefslogtreecommitdiff
path: root/test/ssl_test.c
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2016-06-03 17:49:04 +0200
committerEmilia Kasper <emilia@openssl.org>2016-06-13 16:13:13 +0200
commit74726750ef041ba5fdf0516cbd060a202f7092c1 (patch)
treeb136ba0cdd4e05abf40716a372fcdc03faaacebc /test/ssl_test.c
parent81fc33c951b645f31727dc811e02200bde4a0982 (diff)
downloadopenssl-74726750ef041ba5fdf0516cbd060a202f7092c1.zip
openssl-74726750ef041ba5fdf0516cbd060a202f7092c1.tar.gz
openssl-74726750ef041ba5fdf0516cbd060a202f7092c1.tar.bz2
Port DTLS version negotiation tests
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/ssl_test.c')
-rw-r--r--test/ssl_test.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/test/ssl_test.c b/test/ssl_test.c
index 0062c51..176f6a1 100644
--- a/test/ssl_test.c
+++ b/test/ssl_test.c
@@ -177,10 +177,25 @@ static int execute_test(SSL_TEST_FIXTURE fixture)
SSL_TEST_CTX *test_ctx = NULL;
HANDSHAKE_RESULT result;
- server_ctx = SSL_CTX_new(TLS_server_method());
- server2_ctx = SSL_CTX_new(TLS_server_method());
- client_ctx = SSL_CTX_new(TLS_client_method());
- OPENSSL_assert(server_ctx != NULL && server2_ctx != NULL && client_ctx != NULL);
+ test_ctx = SSL_TEST_CTX_create(conf, fixture.test_app);
+ if (test_ctx == NULL)
+ goto err;
+
+#ifndef OPENSSL_NO_DTLS
+ if (test_ctx->method == SSL_TEST_METHOD_DTLS) {
+ server_ctx = SSL_CTX_new(DTLS_server_method());
+ server2_ctx = SSL_CTX_new(DTLS_server_method());
+ client_ctx = SSL_CTX_new(DTLS_client_method());
+ }
+#endif
+ if (test_ctx->method == SSL_TEST_METHOD_TLS) {
+ server_ctx = SSL_CTX_new(TLS_server_method());
+ server2_ctx = SSL_CTX_new(TLS_server_method());
+ client_ctx = SSL_CTX_new(TLS_client_method());
+ }
+
+ OPENSSL_assert(server_ctx != NULL && server2_ctx != NULL &&
+ client_ctx != NULL);
OPENSSL_assert(CONF_modules_load(conf, fixture.test_app, 0) > 0);