[glib-networking: 98/129] Make it build with old openssl versions



commit 976f0a8fdccaa09f512f2ebdd21031d5303bd01d
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Feb 26 11:17:35 2018 +0100

    Make it build with old openssl versions

 tls/openssl/gtlsclientconnection-openssl.c | 10 ++++++++++
 tls/openssl/gtlsserverconnection-openssl.c | 10 ++++++++++
 2 files changed, 20 insertions(+)
---
diff --git a/tls/openssl/gtlsclientconnection-openssl.c b/tls/openssl/gtlsclientconnection-openssl.c
index a71ac2f..7aa47ce 100644
--- a/tls/openssl/gtlsclientconnection-openssl.c
+++ b/tls/openssl/gtlsclientconnection-openssl.c
@@ -431,6 +431,7 @@ set_cipher_list (GTlsClientConnectionOpenssl *client)
   SSL_CTX_set_cipher_list (priv->ssl_ctx, cipher_list);
 }
 
+#ifdef SSL_CTX_set1_sigalgs_list
 static void
 set_signature_algorithm_list (GTlsClientConnectionOpenssl *client)
 {
@@ -445,7 +446,9 @@ set_signature_algorithm_list (GTlsClientConnectionOpenssl *client)
 
   SSL_CTX_set1_sigalgs_list (priv->ssl_ctx, signature_algorithm_list);
 }
+#endif
 
+#ifdef SSL_CTX_set1_curves_list
 static void
 set_curve_list (GTlsClientConnectionOpenssl *client)
 {
@@ -460,6 +463,7 @@ set_curve_list (GTlsClientConnectionOpenssl *client)
 
   SSL_CTX_set1_curves_list (priv->ssl_ctx, curve_list);
 }
+#endif
 
 static gboolean
 g_tls_client_connection_openssl_initable_init (GInitable       *initable,
@@ -517,8 +521,14 @@ g_tls_client_connection_openssl_initable_init (GInitable       *initable,
   SSL_CTX_set_client_cert_cb (priv->ssl_ctx, retrieve_certificate);
 
   set_cipher_list (client);
+
+#ifdef SSL_CTX_set1_sigalgs_list
   set_signature_algorithm_list (client);
+#endif
+
+#ifdef SSL_CTX_set1_curves_list
   set_curve_list (client);
+#endif
 
   priv->ssl = SSL_new (priv->ssl_ctx);
   if (priv->ssl == NULL)
diff --git a/tls/openssl/gtlsserverconnection-openssl.c b/tls/openssl/gtlsserverconnection-openssl.c
index 8b595ff..73feb94 100644
--- a/tls/openssl/gtlsserverconnection-openssl.c
+++ b/tls/openssl/gtlsserverconnection-openssl.c
@@ -238,6 +238,7 @@ set_cipher_list (GTlsServerConnectionOpenssl *server)
   SSL_CTX_set_cipher_list (priv->ssl_ctx, cipher_list);
 }
 
+#ifdef SSL_CTX_set1_sigalgs_list
 static void
 set_signature_algorithm_list (GTlsServerConnectionOpenssl *server)
 {
@@ -252,7 +253,9 @@ set_signature_algorithm_list (GTlsServerConnectionOpenssl *server)
 
   SSL_CTX_set1_sigalgs_list (priv->ssl_ctx, signature_algorithm_list);
 }
+#endif
 
+#ifdef SSL_CTX_set1_curves_list
 static void
 set_curve_list (GTlsServerConnectionOpenssl *server)
 {
@@ -267,6 +270,7 @@ set_curve_list (GTlsServerConnectionOpenssl *server)
 
   SSL_CTX_set1_curves_list (priv->ssl_ctx, curve_list);
 }
+#endif
 
 static gboolean
 g_tls_server_connection_openssl_initable_init (GInitable       *initable,
@@ -363,8 +367,14 @@ g_tls_server_connection_openssl_initable_init (GInitable       *initable,
   SSL_CTX_add_session (priv->ssl_ctx, priv->session);
 
   set_cipher_list (server);
+
+#ifdef SSL_CTX_set1_sigalgs_list
   set_signature_algorithm_list (server);
+#endif
+
+#ifdef SSL_CTX_set1_curves_list
   set_curve_list (server);
+#endif
 
 #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
 # ifdef SSL_CTX_set_ecdh_auto


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