summaryrefslogtreecommitdiff
path: root/src/common/aes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/aes.c')
-rw-r--r--src/common/aes.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/aes.c b/src/common/aes.c
index 4d4a2d773a..0c4f9b9bca 100644
--- a/src/common/aes.c
+++ b/src/common/aes.c
@@ -16,8 +16,8 @@
#include <ws2tcpip.h>
#endif
+#include "compat_openssl.h"
#include <openssl/opensslv.h>
-#include "crypto.h"
#include "crypto_openssl_mgt.h"
#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,0,0)
@@ -41,6 +41,7 @@ ENABLE_GCC_WARNING(redundant-decls)
#include "util.h"
#include "torlog.h"
#include "di_ops.h"
+#include "crypto_util.h"
#ifdef ANDROID
/* Android's OpenSSL seems to have removed all of its Engine support. */
@@ -116,7 +117,11 @@ aes_cipher_free_(aes_cnt_cipher_t *cipher_)
if (!cipher_)
return;
EVP_CIPHER_CTX *cipher = (EVP_CIPHER_CTX *) cipher_;
+#ifdef OPENSSL_1_1_API
+ EVP_CIPHER_CTX_reset(cipher);
+#else
EVP_CIPHER_CTX_cleanup(cipher);
+#endif
EVP_CIPHER_CTX_free(cipher);
}
void