From 98de35c742498878a27fb29becd3b7154525a60f Mon Sep 17 00:00:00 2001 From: Ivo Timmermans Date: Mon, 27 Mar 2000 22:59:16 +0000 Subject: [PATCH] Upon regeneration, free the old encryption key `securely\' by overwriting it. --- src/encr.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/encr.c b/src/encr.c index 899a46b..e78ed5e 100644 --- a/src/encr.c +++ b/src/encr.c @@ -300,15 +300,11 @@ void recalculate_encryption_keys(void) for(p = conn_list; p != NULL; p = p->next) { if(!p->public_key || !p->public_key->key) + /* We haven't received a key from this host (yet). */ continue; ek = make_shared_key(p->public_key->key); - if(!p->key) - { - p->key = xmalloc(sizeof(enc_key_t)); - p->key->key = NULL; - } - if(p->key->key) - free(p->key->key); + free_key(p->key); + p->key = xmalloc(sizeof(enc_key_t)); p->key->length = strlen(ek); p->key->expiry = p->public_key->expiry; p->key->key = xmalloc(strlen(ek) + 1); -- 2.25.1