diff options
Diffstat (limited to 'src/wrapper.c')
| -rw-r--r-- | src/wrapper.c | 10 |
1 files changed, 5 insertions, 5 deletions
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) { |
