summaryrefslogtreecommitdiffstats
path: root/lib/libtls/tls_server.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2016-08-15 14:04:23 +0000
committerjsing <jsing@openbsd.org>2016-08-15 14:04:23 +0000
commitb7f318e776f45becdb41ac569abf28d21ae83a3b (patch)
tree85474364584446a0428ff6cd773b2d31123535f3 /lib/libtls/tls_server.c
parentMake httpd stricter with respect to TLS configuration - in particular, do (diff)
downloadwireguard-openbsd-b7f318e776f45becdb41ac569abf28d21ae83a3b.tar.xz
wireguard-openbsd-b7f318e776f45becdb41ac569abf28d21ae83a3b.zip
Explicitly pass in an SSL_CTX * to the functions that operate on one,
instead of assuming that they should use the one associated with the TLS context. This allows these functions to be used with the additional SSL contexts that are needed to support server-side SNI. Also rename tls_configure_keypair() to tls_configure_ssl_keypair(), so that these functions have a common prefix. ok reyk@
Diffstat (limited to 'lib/libtls/tls_server.c')
-rw-r--r--lib/libtls/tls_server.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libtls/tls_server.c b/lib/libtls/tls_server.c
index 690af32eaf3..bec9c0608f1 100644
--- a/lib/libtls/tls_server.c
+++ b/lib/libtls/tls_server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls_server.c,v 1.22 2016/08/12 15:10:59 jsing Exp $ */
+/* $OpenBSD: tls_server.c,v 1.23 2016/08/15 14:04:23 jsing Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -73,15 +73,16 @@ tls_configure_server(struct tls *ctx)
goto err;
}
- if (tls_configure_ssl(ctx) != 0)
+ if (tls_configure_ssl(ctx, ctx->ssl_ctx) != 0)
goto err;
- if (tls_configure_keypair(ctx, ctx->ssl_ctx, ctx->config->keypair, 1) != 0)
+ if (tls_configure_ssl_keypair(ctx, ctx->ssl_ctx,
+ ctx->config->keypair, 1) != 0)
goto err;
if (ctx->config->verify_client != 0) {
int verify = SSL_VERIFY_PEER;
if (ctx->config->verify_client == 1)
verify |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
- if (tls_configure_ssl_verify(ctx, verify) == -1)
+ if (tls_configure_ssl_verify(ctx, ctx->ssl_ctx, verify) == -1)
goto err;
}