summaryrefslogtreecommitdiffstats
path: root/libvncclient/tls.c
diff options
context:
space:
mode:
authorVic Lee <llyzs@163.com>2011-04-27 23:43:11 +0800
committerJohannes Schindelin <johannes.schindelin@gmx.de>2011-04-27 18:43:54 +0200
commitd8fca9d013a8da92499cb3889dd0f53d3b4e437f (patch)
treeb188492e82aeeee78c155f237eb562d75266b33f /libvncclient/tls.c
parentf25a886cba4dc0e2e2a246b23340c48e7388465b (diff)
downloadlibtdevnc-d8fca9d013a8da92499cb3889dd0f53d3b4e437f.tar.gz
libtdevnc-d8fca9d013a8da92499cb3889dd0f53d3b4e437f.zip
Replace deprecated GnuTLS functions gnutls_*_set_priority with gnutls_priority_set_direct.
The functions gnutls_*_set_priority we used were marked deprecated since latest GnuTLS version 2.12. However the replacement function gnutls_priority_set_direct is available since 2.2, which is even lower than our version requirement 2.4 in configure. The patch just replace the deprecate function to fix the compile warning. Signed-off-by: Vic Lee <llyzs@163.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'libvncclient/tls.c')
-rw-r--r--libvncclient/tls.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libvncclient/tls.c b/libvncclient/tls.c
index a926c8c..5d29362 100644
--- a/libvncclient/tls.c
+++ b/libvncclient/tls.c
@@ -31,10 +31,8 @@
#ifdef LIBVNCSERVER_WITH_CLIENT_TLS
-static const int rfbCertTypePriority[] = { GNUTLS_CRT_X509, 0 };
-static const int rfbProtoPriority[]= { GNUTLS_TLS1_1, GNUTLS_TLS1_0, GNUTLS_SSL3, 0 };
-static const int rfbKXPriority[] = {GNUTLS_KX_DHE_DSS, GNUTLS_KX_RSA, GNUTLS_KX_DHE_RSA, GNUTLS_KX_SRP, 0};
-static const int rfbKXAnon[] = {GNUTLS_KX_ANON_DH, 0};
+static const char *rfbTLSPriority = "NORMAL:+DHE-DSS:+RSA:+DHE-RSA:+SRP";
+static const char *rfbAnonTLSPriority= "NORMAL:+ANON-DH";
#define DH_BITS 1024
static gnutls_dh_params_t rfbDHParams;
@@ -133,6 +131,7 @@ static rfbBool
InitializeTLSSession(rfbClient* client, rfbBool anonTLS)
{
int ret;
+ const char *p;
if (client->tlsSession) return TRUE;
@@ -142,12 +141,10 @@ InitializeTLSSession(rfbClient* client, rfbBool anonTLS)
return FALSE;
}
- if ((ret = gnutls_set_default_priority(client->tlsSession)) < 0 ||
- (ret = gnutls_kx_set_priority(client->tlsSession, anonTLS ? rfbKXAnon : rfbKXPriority)) < 0 ||
- (ret = gnutls_certificate_type_set_priority(client->tlsSession, rfbCertTypePriority)) < 0 ||
- (ret = gnutls_protocol_set_priority(client->tlsSession, rfbProtoPriority)) < 0)
+ if ((ret = gnutls_priority_set_direct(client->tlsSession,
+ anonTLS ? rfbAnonTLSPriority : rfbTLSPriority, &p)) < 0)
{
- rfbClientLog("Warning: Failed to set TLS priority: %s.\n", gnutls_strerror(ret));
+ rfbClientLog("Warning: Failed to set TLS priority: %s (%s).\n", gnutls_strerror(ret), p);
}
gnutls_transport_set_ptr(client->tlsSession, (gnutls_transport_ptr_t)client);