diff options
author | 2017-05-07 03:25:26 +0000 | |
---|---|---|
committer | 2017-05-07 03:25:26 +0000 | |
commit | fcb81bb69d5adda0508acaa40ca66fb91a90fe7f (patch) | |
tree | 4ad15058e3690287d79da8bd8454d17f09c30608 | |
parent | Also test calling tls_handshake() on a server connection context that has (diff) | |
download | wireguard-openbsd-fcb81bb69d5adda0508acaa40ca66fb91a90fe7f.tar.xz wireguard-openbsd-fcb81bb69d5adda0508acaa40ca66fb91a90fe7f.zip |
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.
-rw-r--r-- | regress/lib/libtls/tls/tlstest.c | 9 |
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)); |