wrapper: move EVP_CIPHER_CTX_free call to libcrypto.c
With this change, a HAVE_LIBCRYPTO #ifdef is removed from wrapper.c. Now, the libcrypto-specific logic for EVP_CIPHER_CTX_free is moved into the ssh_cipher_struct cleanup callback handler for those ciphers. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
родитель
a5bc81d406
Коммит
e66f370682
@ -554,6 +554,9 @@ static void evp_cipher_decrypt(struct ssh_cipher_struct *cipher,
|
||||
|
||||
static void evp_cipher_cleanup(struct ssh_cipher_struct *cipher) {
|
||||
EVP_CIPHER_CTX_cleanup(cipher->ctx);
|
||||
if (cipher->ctx != NULL) {
|
||||
EVP_CIPHER_CTX_free(cipher->ctx);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef HAVE_OPENSSL_EVP_AES_CTR
|
||||
|
@ -124,12 +124,6 @@ void ssh_cipher_clear(struct ssh_cipher_struct *cipher){
|
||||
if (cipher->cleanup != NULL) {
|
||||
cipher->cleanup(cipher);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBCRYPTO
|
||||
if (cipher->ctx != NULL) {
|
||||
EVP_CIPHER_CTX_free(cipher->ctx);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void cipher_free(struct ssh_cipher_struct *cipher) {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user