summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2017-09-11 17:07:50 +0200
committerLemonBoy <thatlemon@gmail.com>2017-09-11 17:19:20 +0200
commit36d8b974fc42ed8eb1ff88811e09d0910ae61187 (patch)
tree82610deb7678a959331598e518f8f19ef6924574 /src/core
parent96d5a4669d696d57a511119963ae5c651346e167 (diff)
downloadirssi-36d8b974fc42ed8eb1ff88811e09d0910ae61187.zip
Restore compatibility with old OpenSSL versions
Let's implement X509_STORE_up_ref on our own.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/network-openssl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/network-openssl.c b/src/core/network-openssl.c
index feb2295d..7ec902fb 100644
--- a/src/core/network-openssl.c
+++ b/src/core/network-openssl.c
@@ -45,6 +45,19 @@
#define ASN1_STRING_data(x) ASN1_STRING_get0_data(x)
#endif
+/* OpenSSL 1.1.0 also introduced some useful additions to the api */
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER)
+static int X509_STORE_up_ref(X509_STORE *vfy)
+{
+ int n;
+
+ n = CRYPTO_add(&vfy->references, 1, CRYPTO_LOCK_X509_STORE);
+ g_assert(n > 1);
+
+ return (n > 1) ? 1 : 0;
+}
+#endif
+
/* ssl i/o channel object */
typedef struct
{