summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls_server.c
diff options
context:
space:
mode:
authorjsing <>2016-08-15 14:04:23 +0000
committerjsing <>2016-08-15 14:04:23 +0000
commitb625f466ed086e94acecb66a8ddd3309cb0e3006 (patch)
tree0f8db1f8992ad067c26b92b7063f1d0e0e260bb8 /src/lib/libtls/tls_server.c
parent27106e2b77c6e7da64be6b4849b458e997106b07 (diff)
downloadopenbsd-b625f466ed086e94acecb66a8ddd3309cb0e3006.tar.gz
openbsd-b625f466ed086e94acecb66a8ddd3309cb0e3006.tar.bz2
openbsd-b625f466ed086e94acecb66a8ddd3309cb0e3006.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 'src/lib/libtls/tls_server.c')
-rw-r--r--src/lib/libtls/tls_server.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libtls/tls_server.c b/src/lib/libtls/tls_server.c
index 690af32eaf..bec9c0608f 100644
--- a/src/lib/libtls/tls_server.c
+++ b/src/lib/libtls/tls_server.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_server.c,v 1.22 2016/08/12 15:10:59 jsing Exp $ */ 1/* $OpenBSD: tls_server.c,v 1.23 2016/08/15 14:04:23 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -73,15 +73,16 @@ tls_configure_server(struct tls *ctx)
73 goto err; 73 goto err;
74 } 74 }
75 75
76 if (tls_configure_ssl(ctx) != 0) 76 if (tls_configure_ssl(ctx, ctx->ssl_ctx) != 0)
77 goto err; 77 goto err;
78 if (tls_configure_keypair(ctx, ctx->ssl_ctx, ctx->config->keypair, 1) != 0) 78 if (tls_configure_ssl_keypair(ctx, ctx->ssl_ctx,
79 ctx->config->keypair, 1) != 0)
79 goto err; 80 goto err;
80 if (ctx->config->verify_client != 0) { 81 if (ctx->config->verify_client != 0) {
81 int verify = SSL_VERIFY_PEER; 82 int verify = SSL_VERIFY_PEER;
82 if (ctx->config->verify_client == 1) 83 if (ctx->config->verify_client == 1)
83 verify |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT; 84 verify |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
84 if (tls_configure_ssl_verify(ctx, verify) == -1) 85 if (tls_configure_ssl_verify(ctx, ctx->ssl_ctx, verify) == -1)
85 goto err; 86 goto err;
86 } 87 }
87 88