summaryrefslogtreecommitdiffstats
path: root/lib/libtls/tls_client.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2015-03-31 12:21:27 +0000
committerjsing <jsing@openbsd.org>2015-03-31 12:21:27 +0000
commit5251ab8ebfaae4c128eb38be605d2bdecef0131f (patch)
tree3cd8e6ece0b736d35863138a8100b9ed5941772f /lib/libtls/tls_client.c
parentThere's no good reason to make -m and -c mutually exclusive. (diff)
downloadwireguard-openbsd-5251ab8ebfaae4c128eb38be605d2bdecef0131f.tar.xz
wireguard-openbsd-5251ab8ebfaae4c128eb38be605d2bdecef0131f.zip
Store errors that occur during a tls_accept_socket() call on the context
for the server, rather than on the context for the connection. This makes more sense than the current behaviour does. Issue reported by Tim van der Molen.
Diffstat (limited to 'lib/libtls/tls_client.c')
-rw-r--r--lib/libtls/tls_client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libtls/tls_client.c b/lib/libtls/tls_client.c
index 24140346512..7c4ca9f306a 100644
--- a/lib/libtls/tls_client.c
+++ b/lib/libtls/tls_client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls_client.c,v 1.16 2015/03/21 15:35:15 sthen Exp $ */
+/* $OpenBSD: tls_client.c,v 1.17 2015/03/31 12:21:27 jsing Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -246,7 +246,7 @@ tls_connect_fds(struct tls *ctx, int fd_read, int fd_write,
connecting:
if ((ret = SSL_connect(ctx->ssl_conn)) != 1) {
- err = tls_ssl_error(ctx, ret, "connect");
+ err = tls_ssl_error(ctx, ctx->ssl_conn, ret, "connect");
if (err == TLS_READ_AGAIN || err == TLS_WRITE_AGAIN) {
ctx->flags |= TLS_CONNECTING;
return (err);