From e83b4e8129811f8075c6ab4b3ee700fd0c92ffa7 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Fri, 25 Sep 2015 00:05:10 +0200 Subject: libcrypto: clean up EVP functions --- src/wrapper.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/wrapper.c') diff --git a/src/wrapper.c b/src/wrapper.c index b750702d..76869375 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -112,17 +112,17 @@ void ssh_cipher_clear(struct ssh_cipher_struct *cipher){ return; } - if(cipher->key) { #ifdef HAVE_LIBGCRYPT + if(cipher->key) { for (i = 0; i < (cipher->keylen / sizeof(gcry_cipher_hd_t)); i++) { gcry_cipher_close(cipher->key[i]); } -#elif defined HAVE_LIBCRYPTO - /* destroy the key */ - memset(cipher->key, 0, cipher->keylen); -#endif SAFE_FREE(cipher->key); } +#endif + if (cipher->cleanup != NULL){ + cipher->cleanup(cipher); + } } static void cipher_free(struct ssh_cipher_struct *cipher) { -- cgit