mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
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
This commit is contained in:
parent
1be212b865
commit
5f223beeae
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user