Browse Source

[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
tags/v1.0.90
Adam Tkac 13 years ago
parent
commit
b486423692
4 changed files with 26 additions and 1 deletions
  1. 5
    0
      common/os/tls.cxx
  2. 13
    0
      common/os/tls.h
  3. 5
    0
      common/rfb/CSecurityTLS.cxx
  4. 3
    1
      configure.ac

+ 5
- 0
common/os/tls.cxx View File

@@ -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) << "), "; \

+ 13
- 0
common/os/tls.h View File

@@ -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"

+ 5
- 0
common/rfb/CSecurityTLS.cxx View File

@@ -57,6 +57,11 @@
#define WITHOUT_X509_TIMES
#endif

/* Ancient GNUTLS... */
#if !defined(GNUTLS_VERSION_NUMBER) && !defined(LIBGNUTLS_VERSION_NUMBER)
#define WITHOUT_X509_TIMES
#endif

#define TLS_DEBUG

using namespace rfb;

+ 3
- 1
configure.ac View File

@@ -112,7 +112,9 @@ if test "x$enable_gnutls" = xyes; then
[AC_DEFINE(HAVE_GNUTLS_X509_CRT_PRINT, 1, [Is the gnutls_x509_crt_print() function present? ])
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
AC_CHECK_TYPES([gnutls_x509_crt_t, gnutls_datum_t,
gnutls_pk_algorithm_t, gnutls_sign_algorithm_t],
[], [], [#include <gnutls/gnutls.h>])
LIBS=${SAVE_LIBS}
fi
AC_SUBST([GNUTLS_LIBS])

Loading…
Cancel
Save