Revision: 4264
http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4264&view=rev
Author: dcommander
Date: 2011-02-08 23:43:55 +0000 (Tue, 08 Feb 2011)
Log Message:
-----------
Attempt to restore compatibility with older GnuTLS versions
Modified Paths:
--------------
trunk/common/rfb/CSecurityTLS.cxx
Modified: trunk/common/rfb/CSecurityTLS.cxx
===================================================================
--- trunk/common/rfb/CSecurityTLS.cxx 2011-02-08 23:43:17 UTC (rev 4263)
+++ trunk/common/rfb/CSecurityTLS.cxx 2011-02-08 23:43:55 UTC (rev 4264)
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2004 Red Hat Inc.
* Copyright (C) 2005 Martin Koegler
* Copyright (C) 2010 TigerVNC Team
@@ -28,6 +28,17 @@
#error "This header should not be compiled without HAVE_GNUTLS defined"
#endif
+#if !defined(GNUTLS_VERSION_NUMBER) || (GNUTLS_VERSION_NUMBER < 0x020708)
+#define GNUTLS_CERT_NOT_ACTIVATED 512
+#define GNUTLS_CERT_EXPIRED 1024
+#endif
+
+#if !defined(GNUTLS_VERSION_NUMBER) || (GNUTLS_VERSION_NUMBER < 0x020301)
+#define GNUTLS_CRT_PRINT_ONELINE 1
+#endif
+
+
+
#include <stdlib.h>
#ifndef WIN32
#include <unistd.h>
@@ -237,7 +248,7 @@
const gnutls_datum *cert_list;
unsigned int cert_list_size = 0;
unsigned int i;
- gnutls_datum_t info;
+ gnutls_datum info;
if (anon)
return;
@@ -273,6 +284,7 @@
if (gnutls_x509_crt_import(crt, &cert_list[i],GNUTLS_X509_FMT_DER) < 0)
throw AuthFailureException("decoding of certificate failed");
+ #if defined(GNUTLS_VERSION_NUMBER) && (GNUTLS_VERSION_NUMBER >= 0x010706)
if (gnutls_x509_crt_print(crt, GNUTLS_CRT_PRINT_ONELINE, &info)) {
/*
* GNUTLS doesn't correctly export gnutls_free symbol which is
@@ -286,6 +298,7 @@
#endif
throw AuthFailureException("Could not find certificate to display");
}
+ #endif
if (gnutls_x509_crt_check_hostname(crt, client->getServerName()) == 0) {
char buf[255];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Tigervnc-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits