1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +03:00

libcrypto: clean up EVP functions

This commit is contained in:
Aris Adamantiadis
2015-09-25 00:05:10 +02:00
parent 392e09e3de
commit e83b4e8129
3 changed files with 221 additions and 389 deletions

View File

@@ -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) {