summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2017-05-07 01:58:29 +0000
committerjsing <jsing@openbsd.org>2017-05-07 01:58:29 +0000
commite289e929111ce20a2acbb6fe830bb09ec772b1f5 (patch)
treef19f8af8860cb731b9154ab62d30f86346dab1ca
parentAn an initial sequencing/ordering test for libtls. (diff)
downloadwireguard-openbsd-e289e929111ce20a2acbb6fe830bb09ec772b1f5.tar.xz
wireguard-openbsd-e289e929111ce20a2acbb6fe830bb09ec772b1f5.zip
Add a test that calls tls_handshake() on a connection that has already
completed a TLS handshake. This should return a failure, but currently succeeds (hence the regress currently fails).
-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 1f75232dd99..21b25701ebe 100644
--- a/regress/lib/libtls/tls/tlstest.c
+++ b/regress/lib/libtls/tls/tlstest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tlstest.c,v 1.6 2017/05/07 01:56:24 jsing Exp $ */
+/* $OpenBSD: tlstest.c,v 1.7 2017/05/07 01:58:29 jsing Exp $ */
/*
* Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
*
@@ -396,6 +396,12 @@ do_tls_ordering_tests(void)
goto done;
}
+ if (tls_handshake(client) != -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;