aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2019-05-15 14:49:47 -0700
committerRosen Penev <rosenp@gmail.com>2019-05-15 17:29:50 -0700
commitec46d03854daaef825344519fd4101f1ac3a9244 (patch)
treee372c7d420cbbd104e46c55f1ec6b69da4966033
parent762778b36e4f4827162ff8b58992a794eb1404b7 (diff)
elektra: Fix compilation without deprecated OpenSSL APIs
Signed-off-by: Rosen Penev <rosenp@gmail.com>
-rw-r--r--libs/elektra/Makefile2
-rw-r--r--libs/elektra/patches/010-openssl-deprecated.patch35
2 files changed, 36 insertions, 1 deletions
diff --git a/libs/elektra/Makefile b/libs/elektra/Makefile
index 919718b12..3c2c14671 100644
--- a/libs/elektra/Makefile
+++ b/libs/elektra/Makefile
@@ -15,7 +15,7 @@ PKG_NAME:=elektra
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE.md
PKG_VERSION:=0.8.21
-PKG_RELEASE:=1
+PKG_RELEASE:=2
# Use this for official releasees
PKG_HASH:=51892570f18d1667d0da4d0908a091e41b41c20db9835765677109a3d150cd26
diff --git a/libs/elektra/patches/010-openssl-deprecated.patch b/libs/elektra/patches/010-openssl-deprecated.patch
new file mode 100644
index 000000000..ea7df042b
--- /dev/null
+++ b/libs/elektra/patches/010-openssl-deprecated.patch
@@ -0,0 +1,35 @@
+--- a/src/plugins/crypto/openssl_operations.c
++++ b/src/plugins/crypto/openssl_operations.c
+@@ -25,6 +25,10 @@
+ #include <stdlib.h>
+ #include <string.h>
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#define EVP_CIPHER_CTX_reset EVP_CIPHER_CTX_cleanup
++#endif
++
+ #define KEY_BUFFER_SIZE (ELEKTRA_CRYPTO_SSL_KEYSIZE + ELEKTRA_CRYPTO_SSL_BLOCKSIZE)
+
+ /*
+@@ -144,8 +148,10 @@ int elektraCryptoOpenSSLInit (Key * errorKey ELEKTRA_UNUSED)
+ // initialize OpenSSL according to
+ // https://wiki.openssl.org/index.php/Library_Initialization
+ pthread_mutex_lock (&mutex_ssl);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ OpenSSL_add_all_algorithms ();
+ ERR_load_crypto_strings ();
++#endif
+ pthread_mutex_unlock (&mutex_ssl);
+ return 1;
+ }
+@@ -246,8 +252,8 @@ void elektraCryptoOpenSSLHandleDestroy (elektraCryptoHandle * handle)
+ if (handle)
+ {
+ pthread_mutex_lock (&mutex_ssl);
+- EVP_CIPHER_CTX_cleanup (handle->encrypt);
+- EVP_CIPHER_CTX_cleanup (handle->decrypt);
++ EVP_CIPHER_CTX_reset (handle->encrypt);
++ EVP_CIPHER_CTX_reset (handle->decrypt);
+ EVP_CIPHER_CTX_free (handle->encrypt);
+ EVP_CIPHER_CTX_free (handle->decrypt);
+ pthread_mutex_unlock (&mutex_ssl);