diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2014-09-29 09:30:32 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2014-09-29 09:30:32 +0000 |
commit | f51d27c122864f8234004b4645c5b8e5ea0a48dd (patch) | |
tree | a4d9b82301f13f5b42ad40b1adcc02777eb72cde /lib/libressl/ressl_config.c | |
parent | 14269828f753e4ca4a29ee1794ca95e10c88df23 (diff) |
When freeing the config, explicitly call ressl_config_clear_keys() rather
than rerolling our own key clearing code.
ok tedu@
Diffstat (limited to 'lib/libressl/ressl_config.c')
-rw-r--r-- | lib/libressl/ressl_config.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libressl/ressl_config.c b/lib/libressl/ressl_config.c index 319bba330da..106527c109e 100644 --- a/lib/libressl/ressl_config.c +++ b/lib/libressl/ressl_config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ressl_config.c,v 1.10 2014/09/28 14:46:09 jsing Exp $ */ +/* $OpenBSD: ressl_config.c,v 1.11 2014/09/29 09:30:31 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> * @@ -84,16 +84,17 @@ ressl_config_free(struct ressl_config *config) { if (config == NULL) return; + + ressl_config_clear_keys(config); + free((char *)config->ca_file); free((char *)config->ca_path); free((char *)config->cert_file); free(config->cert_mem); free((char *)config->ciphers); free((char *)config->key_file); - if (config->key_mem != NULL) { - explicit_bzero(config->key_mem, config->key_len); - free(config->key_mem); - } + free(config->key_mem); + free(config); } |