summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls_internal.h
diff options
context:
space:
mode:
authorjsing <>2018-04-07 16:35:34 +0000
committerjsing <>2018-04-07 16:35:34 +0000
commitfa406a4e78813492e56384a03893357a094f6793 (patch)
tree00255fc63c35caf51fe96345ab5612a005915c5f /src/lib/libtls/tls_internal.h
parent769107a3cc2677b916ec7283d1b1c89df9fbb318 (diff)
downloadopenbsd-fa406a4e78813492e56384a03893357a094f6793.tar.gz
openbsd-fa406a4e78813492e56384a03893357a094f6793.tar.bz2
openbsd-fa406a4e78813492e56384a03893357a094f6793.zip
Correct tls_config_clear_keys() behaviour.
Previously this incorrectly called tls_keypair_clear(), which results in the private key being cleared, along with the certificate, OCSP staple and pubkey hash. This breaks OCSP stapling if tls_config_clear_keys() is called following tls_configure(), as is done by httpd. Fix this by calling tls_keypair_clear_key() so that only the private key is cleared, leaving the other public data untouched. While here, remove tls_keypair_clear() and fold the necessary parts into tls_keypair_free(). ok beck@
Diffstat (limited to 'src/lib/libtls/tls_internal.h')
-rw-r--r--src/lib/libtls/tls_internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libtls/tls_internal.h b/src/lib/libtls/tls_internal.h
index 0d7e2289d3..b236204e81 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.71 2018/03/19 16:34:47 jsing Exp $ */ 1/* $OpenBSD: tls_internal.h,v 1.72 2018/04/07 16:35:34 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>
@@ -199,7 +199,7 @@ int tls_set_mem(char **_dest, size_t *_destlen, const void *_src,
199int tls_set_string(const char **_dest, const char *_src); 199int tls_set_string(const char **_dest, const char *_src);
200 200
201struct tls_keypair *tls_keypair_new(void); 201struct tls_keypair *tls_keypair_new(void);
202void tls_keypair_clear(struct tls_keypair *_keypair); 202void tls_keypair_clear_key(struct tls_keypair *_keypair);
203void tls_keypair_free(struct tls_keypair *_keypair); 203void tls_keypair_free(struct tls_keypair *_keypair);
204int tls_keypair_set_cert_file(struct tls_keypair *_keypair, 204int tls_keypair_set_cert_file(struct tls_keypair *_keypair,
205 struct tls_error *_error, const char *_cert_file); 205 struct tls_error *_error, const char *_cert_file);