1
1

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>
Этот коммит содержится в:
Jon Simons 2017-07-14 19:47:48 -04:00 коммит произвёл Andreas Schneider
родитель a5bc81d406
Коммит e66f370682
2 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

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