]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free() shims
authorAram Sargsyan <aram@isc.org>
Fri, 25 Feb 2022 08:41:36 +0000 (08:41 +0000)
committerAram Sargsyan <aram@isc.org>
Wed, 2 Mar 2022 09:31:50 +0000 (09:31 +0000)
LibreSSL 3.5.0 fails to compile with these shims. We could have just
removed the LibreSSL check from the pre-processor condition, but it
seems that these shims are no longer needed because all the supported
versions of OpenSSL and LibreSSL have those functions.

According to EVP_ENCRYPTINIT(3) manual page in LibreSSL,
EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free() first appeared in
OpenSSL 0.9.8b, and have been available since OpenBSD 4.5.

(cherry picked from commit a3789053682b57a2031de8c544134f1923e76cf3)

lib/isc/aes.c

index 85636e6be6524aa8c1fa2da41f2e267cd8b2949e..a0e23c5dfbd63f791a5a0290c0cba179a16527b2 100644 (file)
 #include <isc/types.h>
 #include <isc/util.h>
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
-#define EVP_CIPHER_CTX_new()   &(_context), EVP_CIPHER_CTX_init(&_context)
-#define EVP_CIPHER_CTX_free(c) RUNTIME_CHECK(EVP_CIPHER_CTX_cleanup(c) == 1)
-#endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L || \
-       * defined(LIBRESSL_VERSION_NUMBER) */
-
 void
 isc_aes128_crypt(const unsigned char *key, const unsigned char *in,
                 unsigned char *out) {
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
-       EVP_CIPHER_CTX _context;
-#endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L || \
-       * defined(LIBRESSL_VERSION_NUMBER) */
        EVP_CIPHER_CTX *c;
        int len;
 
@@ -52,10 +42,6 @@ isc_aes128_crypt(const unsigned char *key, const unsigned char *in,
 void
 isc_aes192_crypt(const unsigned char *key, const unsigned char *in,
                 unsigned char *out) {
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
-       EVP_CIPHER_CTX _context;
-#endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L || \
-       * defined(LIBRESSL_VERSION_NUMBER) */
        EVP_CIPHER_CTX *c;
        int len;
 
@@ -72,10 +58,6 @@ isc_aes192_crypt(const unsigned char *key, const unsigned char *in,
 void
 isc_aes256_crypt(const unsigned char *key, const unsigned char *in,
                 unsigned char *out) {
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
-       EVP_CIPHER_CTX _context;
-#endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L || \
-       * defined(LIBRESSL_VERSION_NUMBER) */
        EVP_CIPHER_CTX *c;
        int len;