[glib-networking: 14/129] openssl/gtlsclientconnection: adapt to OpenSSL 1.1.0+



commit fc1963b8a84b133f077fb203037ef181eb85d8a8
Author: Igor Gnatenko <ignatenko src gnome org>
Date:   Fri Oct 21 17:39:47 2016 +0200

    openssl/gtlsclientconnection: adapt to OpenSSL 1.1.0+
    
    Signed-off-by: Igor Gnatenko <ignatenko src gnome org>

 tls/openssl/gtlsclientconnection-openssl.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/tls/openssl/gtlsclientconnection-openssl.c b/tls/openssl/gtlsclientconnection-openssl.c
index 4608f7e..cb9e647 100644
--- a/tls/openssl/gtlsclientconnection-openssl.c
+++ b/tls/openssl/gtlsclientconnection-openssl.c
@@ -381,7 +381,11 @@ retrieve_certificate (SSL       *ssl,
 
       key = g_tls_certificate_openssl_get_key (G_TLS_CERTIFICATE_OPENSSL (cert));
       /* increase ref count */
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
       CRYPTO_add (&key->references, 1, CRYPTO_LOCK_EVP_PKEY);
+#else
+      EVP_PKEY_up_ref (key);
+#endif
       *pkey = key;
 
       *x509 = X509_dup (g_tls_certificate_openssl_get_cert (G_TLS_CERTIFICATE_OPENSSL (cert)));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]