aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDRC <dcommander@users.sourceforge.net>2011-02-08 23:43:55 +0000
committerDRC <dcommander@users.sourceforge.net>2011-02-08 23:43:55 +0000
commitff1e1ff941a103a54a0d16682b4cadcc08e7642c (patch)
tree4ba36d608812f086c1e85144f19c08fd67223a61 /common
parent1b6aba21f179991fee9dafe189ac4ec52d8fe298 (diff)
downloadtigervnc-ff1e1ff941a103a54a0d16682b4cadcc08e7642c.tar.gz
tigervnc-ff1e1ff941a103a54a0d16682b4cadcc08e7642c.zip
Attempt to restore compatibility with older GnuTLS versions
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4264 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common')
-rw-r--r--common/rfb/CSecurityTLS.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/common/rfb/CSecurityTLS.cxx b/common/rfb/CSecurityTLS.cxx
index d0b689a2..8f4910d2 100644
--- a/common/rfb/CSecurityTLS.cxx
+++ b/common/rfb/CSecurityTLS.cxx
@@ -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 @@ void CSecurityTLS::checkSession()
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 @@ void CSecurityTLS::checkSession()
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 @@ void CSecurityTLS::checkSession()
#endif
throw AuthFailureException("Could not find certificate to display");
}
+ #endif
if (gnutls_x509_crt_check_hostname(crt, client->getServerName()) == 0) {
char buf[255];