From 5f223beeaee91d8827454475c4ef6f679af4385d Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 13 Aug 2013 14:10:04 +0200 Subject: m_ssl_gnutls Fix feature testing and cipher suite related errors on older GnuTLS versions Use the (old) LIBGNUTLS_VERSION_* defines as a fallback when GNUTLS_VERSION_* is unavailable Fixes #595 reported by @rhylan --- src/modules/extra/m_ssl_gnutls.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 41e9d0c3d..1f1297ef9 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -44,8 +44,14 @@ /* $LinkerFlags: rpath("pkg-config --libs gnutls") pkgconflibs("gnutls","/libgnutls.so","-lgnutls") exec("libgcrypt-config --libs") */ /* $NoPedantic */ +#ifndef GNUTLS_VERSION_MAJOR +#define GNUTLS_VERSION_MAJOR LIBGNUTLS_VERSION_MAJOR +#define GNUTLS_VERSION_MINOR LIBGNUTLS_VERSION_MINOR +#define GNUTLS_VERSION_PATCH LIBGNUTLS_VERSION_PATCH +#endif + // These don't exist in older GnuTLS versions -#if ((GNUTLS_VERSION_MAJOR > 2) || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR > 1) || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR == 1 && GNUTLS_VERSION_MICRO >= 7)) +#if ((GNUTLS_VERSION_MAJOR > 2) || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR > 1) || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR == 1 && GNUTLS_VERSION_PATCH >= 7)) #define GNUTLS_NEW_PRIO_API #endif @@ -570,6 +576,8 @@ class ModuleSSLGnuTLS : public Module #ifdef GNUTLS_NEW_PRIO_API gnutls_priority_set(session->sess, priority); + #else + gnutls_set_default_priority(session->sess); #endif gnutls_credentials_set(session->sess, GNUTLS_CRD_CERTIFICATE, x509_cred); gnutls_dh_set_prime_bits(session->sess, dh_bits); -- cgit v1.2.3