diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2015-09-25 00:05:10 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2015-09-25 00:05:10 +0200 |
commit | e83b4e8129811f8075c6ab4b3ee700fd0c92ffa7 (patch) | |
tree | b8b1fa82ce689f9774b365467dddf2f13d946cdb /src/wrapper.c | |
parent | 392e09e3de50ff95089e547c0ef10984d8adbc67 (diff) | |
download | libssh-e83b4e8129811f8075c6ab4b3ee700fd0c92ffa7.tar.gz libssh-e83b4e8129811f8075c6ab4b3ee700fd0c92ffa7.tar.xz libssh-e83b4e8129811f8075c6ab4b3ee700fd0c92ffa7.zip |
libcrypto: clean up EVP functions
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) { |