summaryrefslogtreecommitdiffstats
path: root/common/os
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2011-02-09 15:38:37 +0000
committerAdam Tkac <atkac@redhat.com>2011-02-09 15:38:37 +0000
commitb48642369217f870e8571b27196d165aca61d75a (patch)
treeee867b8a00e736fa9a085c1f515eb88b5fdba3d7 /common/os
parent68481c19ebfcaed4526c70dac5c14a27f061262a (diff)
downloadtigervnc-b48642369217f870e8571b27196d165aca61d75a.tar.gz
tigervnc-b48642369217f870e8571b27196d165aca61d75a.zip
[Bugfix] Improve compatibility with ancient GNUTLS implementations even more.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4278 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/os')
-rw-r--r--common/os/tls.cxx5
-rw-r--r--common/os/tls.h13
2 files changed, 18 insertions, 0 deletions
diff --git a/common/os/tls.cxx b/common/os/tls.cxx
index 5ef8898a..cd67ce78 100644
--- a/common/os/tls.cxx
+++ b/common/os/tls.cxx
@@ -38,6 +38,11 @@ using namespace std;
#ifndef HAVE_GNUTLS_X509_CRT_PRINT
+/* Ancient GNUTLS... */
+#if !defined(GNUTLS_VERSION_NUMBER) && !defined(LIBGNUTLS_VERSION_NUMBER)
+#define GNUTLS_DIG_SHA1 GNUTLS_DIG_SHA
+#endif
+
#define UNKNOWN_SUBJECT(err) \
do { \
ss << "unknown subject (" << gnutls_strerror(err) << "), "; \
diff --git a/common/os/tls.h b/common/os/tls.h
index a6d09da4..6dd0f324 100644
--- a/common/os/tls.h
+++ b/common/os/tls.h
@@ -26,6 +26,19 @@
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
+#ifndef HAVE_GNUTLS_DATUM_T
+typedef gnutls_datum gnutls_datum_t;
+#endif
+#ifndef HAVE_GNUTLS_CRT_T
+typedef gnutls_x509_crt gnutls_x509_crt_t;
+#endif
+#ifndef HAVE_GNUTLS_PK_ALGORITHM_T
+typedef gnutls_pk_algorithm gnutls_pk_algorithm_t;
+#endif
+#ifndef HAVE_GNUTLS_SIGN_ALGORITHM_T
+typedef gnutls_sign_algorithm gnutls_sign_algorithm_t;
+#endif
+
#ifndef HAVE_GNUTLS_X509_CRT_PRINT
#ifdef WIN32
#error "Please install more recent GNUTLS with gnutls_x509_crt_print() function"