diff options
author | 2015-08-22 14:40:25 +0000 | |
---|---|---|
committer | 2015-08-22 14:40:25 +0000 | |
commit | fff13c0cb7ae8f1c81dc584a9eb6080e438bc4d5 (patch) | |
tree | 8aca7fe7f0a623ec7159844c8e8824fb036dc82e /lib/libtls/tls_client.c | |
parent | Make tls_read()/tls_write always set outlen to zero on error - this got (diff) | |
download | wireguard-openbsd-fff13c0cb7ae8f1c81dc584a9eb6080e438bc4d5.tar.xz wireguard-openbsd-fff13c0cb7ae8f1c81dc584a9eb6080e438bc4d5.zip |
Store a reference to the libtls context in the SSL client connection app
data (as is already done for server connections).
From Marko Kreen.
Diffstat (limited to 'lib/libtls/tls_client.c')
-rw-r--r-- | lib/libtls/tls_client.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libtls/tls_client.c b/lib/libtls/tls_client.c index 7c4ca9f306a..295e76c60d7 100644 --- a/lib/libtls/tls_client.c +++ b/lib/libtls/tls_client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_client.c,v 1.17 2015/03/31 12:21:27 jsing Exp $ */ +/* $OpenBSD: tls_client.c,v 1.18 2015/08/22 14:40:25 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> * @@ -225,6 +225,8 @@ tls_connect_fds(struct tls *ctx, int fd_read, int fd_write, tls_set_error(ctx, "ssl connection failure"); goto err; } + SSL_set_app_data(ctx->ssl_conn, ctx); + if (SSL_set_rfd(ctx->ssl_conn, fd_read) != 1 || SSL_set_wfd(ctx->ssl_conn, fd_write) != 1) { tls_set_error(ctx, "ssl file descriptor failure"); |