[gtk-vnc] Drop support for gnutls < 2.2.0



commit e3b5e9c8838c28739d09644d43fe234b4dd16a24
Author: Daniel P. Berrange <berrange redhat com>
Date:   Mon Jun 6 10:23:17 2016 +0100

    Drop support for gnutls < 2.2.0
    
    The 2.2.0 release of gnutls includes gnutls_priority_set_direct
    which we already use conditionally. This release dates from Dec
    2007, so it is reasonable to drop the conditional code for older
    GNUTLS releases.
    
    Signed-off-by: Daniel P. Berrange <berrange redhat com>

 configure.ac        |    2 +-
 src/vncconnection.c |   35 -----------------------------------
 2 files changed, 1 insertions(+), 36 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 60fc378..b0e8448 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,7 +35,7 @@ GDK_PIXBUF_REQUIRED=2.10.0
 AC_SUBST(GDK_PIXBUF_REQUIRED)
 GCRYPT_REQUIRED=1.4.0
 AC_SUBST(GCRYPT_REQUIRED)
-GNUTLS_REQUIRED=1.4.0
+GNUTLS_REQUIRED=2.2.0
 AC_SUBST(GNUTLS_REQUIRED)
 
 PYGTK_REQUIRED=2.0.0
diff --git a/src/vncconnection.c b/src/vncconnection.c
index 3e55c2a..0f439e3 100644
--- a/src/vncconnection.c
+++ b/src/vncconnection.c
@@ -4254,15 +4254,7 @@ static gboolean vnc_connection_perform_auth_sasl(VncConnection *conn)
 static gboolean vnc_connection_start_tls(VncConnection *conn, int anonTLS)
 {
     VncConnectionPrivate *priv = conn->priv;
-#if defined(GNUTLS_VERSION_NUMBER) &&                   \
-    GNUTLS_VERSION_NUMBER >= 0x020200 /* 2.2.0 */
     const char *priority = anonTLS ? "NORMAL:+ANON-DH" : "NORMAL";
-#else
-    static const int cert_type_priority[] = { GNUTLS_CRT_X509, 0 };
-    static const int protocol_priority[]= { GNUTLS_TLS1_1, GNUTLS_TLS1_0, GNUTLS_SSL3, 0 };
-    static const int kx_priority[] = {GNUTLS_KX_DHE_DSS, GNUTLS_KX_RSA, GNUTLS_KX_DHE_RSA, GNUTLS_KX_SRP, 0};
-    static const int kx_anon[] = {GNUTLS_KX_ANON_DH, 0};
-#endif
     int ret;
 
     VNC_DEBUG("Do TLS handshake");
@@ -4277,38 +4269,11 @@ static gboolean vnc_connection_start_tls(VncConnection *conn, int anonTLS)
             return FALSE;
         }
 
-#if defined(GNUTLS_VERSION_NUMBER) &&                   \
-    GNUTLS_VERSION_NUMBER >= 0x020200 /* 2.2.0 */
         if (gnutls_priority_set_direct(priv->tls_session, priority, NULL) < 0) {
             gnutls_deinit(priv->tls_session);
             priv->has_error = TRUE;
             return FALSE;
         }
-#else
-        if (gnutls_set_default_priority(priv->tls_session) < 0) {
-            gnutls_deinit(priv->tls_session);
-            priv->has_error = TRUE;
-            return FALSE;
-        }
-
-        if (gnutls_kx_set_priority(priv->tls_session, anonTLS ? kx_anon : kx_priority) < 0) {
-            gnutls_deinit(priv->tls_session);
-            priv->has_error = TRUE;
-            return FALSE;
-        }
-
-        if (gnutls_certificate_type_set_priority(priv->tls_session, cert_type_priority) < 0) {
-            gnutls_deinit(priv->tls_session);
-            priv->has_error = TRUE;
-            return FALSE;
-        }
-
-        if (gnutls_protocol_set_priority(priv->tls_session, protocol_priority) < 0) {
-            gnutls_deinit(priv->tls_session);
-            priv->has_error = TRUE;
-            return FALSE;
-        }
-#endif
 
         if (anonTLS) {
             gnutls_anon_client_credentials anon_cred = vnc_connection_tls_initialize_anon_cred();


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