summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2017-05-07 03:22:15 +0000
committerjsing <jsing@openbsd.org>2017-05-07 03:22:15 +0000
commitab92895268e4ceb74632c322eaa3c105cec9267c (patch)
treed5296c2aebe5c98b7e4716b74eec586b3b9f46de
parentReturn an error if tls_handshake() is called on a TLS context that has (diff)
downloadwireguard-openbsd-ab92895268e4ceb74632c322eaa3c105cec9267c.tar.xz
wireguard-openbsd-ab92895268e4ceb74632c322eaa3c105cec9267c.zip
Also test calling tls_handshake() on a server connection context that has
already completed a TLS handshake.
-rw-r--r--regress/lib/libtls/tls/tlstest.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/regress/lib/libtls/tls/tlstest.c b/regress/lib/libtls/tls/tlstest.c
index 21b25701ebe..020b098a88a 100644
--- a/regress/lib/libtls/tls/tlstest.c
+++ b/regress/lib/libtls/tls/tlstest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tlstest.c,v 1.7 2017/05/07 01:58:29 jsing Exp $ */
+/* $OpenBSD: tlstest.c,v 1.8 2017/05/07 03:22:15 jsing Exp $ */
/*
* Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
*
@@ -402,6 +402,12 @@ do_tls_ordering_tests(void)
goto done;
}
+ if (tls_handshake(server_cctx) != -1) {
+ printf("FAIL: TLS handshake succeeded twice\n");
+ failure = 1;
+ goto done;
+ }
+
if (do_client_server_close("ordering", client, server_cctx) != 0) {
failure = 1;
goto done;