summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls_internal.h
diff options
context:
space:
mode:
authorjsing <>2017-09-20 17:05:17 +0000
committerjsing <>2017-09-20 17:05:17 +0000
commit263609dd4f2b34a02f6d2e943f58b18b8eef887a (patch)
treef4080509dd8de2bb329aba671f06b4864aeec78e /src/lib/libtls/tls_internal.h
parent8a110cc82bb2df37088502de9f15ac4c8fea6467 (diff)
downloadopenbsd-263609dd4f2b34a02f6d2e943f58b18b8eef887a.tar.gz
openbsd-263609dd4f2b34a02f6d2e943f58b18b8eef887a.tar.bz2
openbsd-263609dd4f2b34a02f6d2e943f58b18b8eef887a.zip
Keep track of which keypair is in use by a TLS context.
This fixes a bug where by a TLS server with SNI would always only return the OCSP staple for the default keypair, rather than returning the OCSP staple associated with the keypair that was selected via SNI. Issue reported by William Graeber and confirmed by Andreas Bartelt. Fix tested by William Graeber and Andreas Bartelt - thanks!
Diffstat (limited to 'src/lib/libtls/tls_internal.h')
-rw-r--r--src/lib/libtls/tls_internal.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_internal.h b/src/lib/libtls/tls_internal.h
index 9e9443dbaf..f378ea5466 100644
--- a/src/lib/libtls/tls_internal.h
+++ b/src/lib/libtls/tls_internal.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_internal.h,v 1.64 2017/08/10 18:18:30 jsing Exp $ */ 1/* $OpenBSD: tls_internal.h,v 1.65 2017/09/20 17:05:17 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> 3 * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org>
4 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 4 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
@@ -157,12 +157,16 @@ struct tls_ocsp {
157struct tls_sni_ctx { 157struct tls_sni_ctx {
158 struct tls_sni_ctx *next; 158 struct tls_sni_ctx *next;
159 159
160 struct tls_keypair *keypair;
161
160 SSL_CTX *ssl_ctx; 162 SSL_CTX *ssl_ctx;
161 X509 *ssl_cert; 163 X509 *ssl_cert;
162}; 164};
163 165
164struct tls { 166struct tls {
165 struct tls_config *config; 167 struct tls_config *config;
168 struct tls_keypair *keypair;
169
166 struct tls_error error; 170 struct tls_error error;
167 171
168 uint32_t flags; 172 uint32_t flags;