diff options
| author | jsing <> | 2018-04-07 16:35:34 +0000 |
|---|---|---|
| committer | jsing <> | 2018-04-07 16:35:34 +0000 |
| commit | 111c0ba098842c9337026115c4d68b9a0f312b9d (patch) | |
| tree | 00255fc63c35caf51fe96345ab5612a005915c5f /src/lib/libtls/tls_config.c | |
| parent | 9e6acdbfc336b22b66a0a01c53019f7f4ac612d9 (diff) | |
| download | openbsd-111c0ba098842c9337026115c4d68b9a0f312b9d.tar.gz openbsd-111c0ba098842c9337026115c4d68b9a0f312b9d.tar.bz2 openbsd-111c0ba098842c9337026115c4d68b9a0f312b9d.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 '')
| -rw-r--r-- | src/lib/libtls/tls_config.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/libtls/tls_config.c b/src/lib/libtls/tls_config.c index d32176fe6e..07019252a7 100644 --- a/src/lib/libtls/tls_config.c +++ b/src/lib/libtls/tls_config.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls_config.c,v 1.51 2018/03/20 15:40:10 jsing Exp $ */ | 1 | /* $OpenBSD: tls_config.c,v 1.52 2018/04/07 16:35:34 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -189,10 +189,7 @@ tls_config_clear_keys(struct tls_config *config) | |||
| 189 | struct tls_keypair *kp; | 189 | struct tls_keypair *kp; |
| 190 | 190 | ||
| 191 | for (kp = config->keypair; kp != NULL; kp = kp->next) | 191 | for (kp = config->keypair; kp != NULL; kp = kp->next) |
| 192 | tls_keypair_clear(kp); | 192 | tls_keypair_clear_key(kp); |
| 193 | |||
| 194 | tls_config_set_ca_mem(config, NULL, 0); | ||
| 195 | tls_config_set_crl_mem(config, NULL, 0); | ||
| 196 | } | 193 | } |
| 197 | 194 | ||
| 198 | int | 195 | int |
