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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user