summaryrefslogtreecommitdiff
path: root/regress/lib/libtls
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2017-05-07 03:25:27 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2017-05-07 03:25:27 +0000
commit92e2dab630cbc7823c52934c8cf29e17dc1a191e (patch)
treeab83bb3ceb8121740b52df19c696581ec72d95e5 /regress/lib/libtls
parent391550b1a2be6e6ad5939cf1101eec4d6d27c000 (diff)
Add a (currently failing) call to tls_handshake() on a client context that
has not yet been connected. We expect this to fail, but it should fail gracefully.
Diffstat (limited to 'regress/lib/libtls')
-rw-r--r--regress/lib/libtls/tls/tlstest.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/regress/lib/libtls/tls/tlstest.c b/regress/lib/libtls/tls/tlstest.c
index 020b098a88a..fcc40262c32 100644
--- a/regress/lib/libtls/tls/tlstest.c
+++ b/regress/lib/libtls/tls/tlstest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tlstest.c,v 1.8 2017/05/07 03:22:15 jsing Exp $ */
+/* $OpenBSD: tlstest.c,v 1.9 2017/05/07 03:25:26 jsing Exp $ */
/*
* Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
*
@@ -383,6 +383,13 @@ do_tls_ordering_tests(void)
tls_config_free(client_cfg);
tls_config_free(server_cfg);
+ if (tls_handshake(client) != -1) {
+ printf("FAIL: TLS handshake succeeded on unconnnected "
+ "client context\n");
+ failure = 1;
+ goto done;
+ }
+
if (tls_accept_cbs(server, &server_cctx, server_read, server_write,
NULL) == -1)
errx(1, "failed to accept: %s", tls_error(server));