]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_gnutls.cpp
Fix whitelist check for a badchan redirect (#1676).
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_gnutls.cpp
index 8bd73b2bb6f824e3e00f266a4149fe50ea827e1c..5785b1ab4d8ecba76f6586d60c432f2163574eaf 100644 (file)
 #include "modules/ssl.h"
 #include <memory>
 
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+#endif
+
 // Fix warnings about the use of commas at end of enumerator lists on C++03.
 #if defined __clang__
 # pragma clang diagnostic ignored "-Wc++11-extensions"
 #elif defined __GNUC__
-# if __GNUC__ < 6
+# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8))
+#  pragma GCC diagnostic ignored "-Wpedantic"
+# else
 #  pragma GCC diagnostic ignored "-pedantic"
 # endif
 #endif
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>
 
+#ifdef __GNUC__
+# pragma GCC diagnostic pop
+#endif
+
 #ifndef GNUTLS_VERSION_NUMBER
 #define GNUTLS_VERSION_NUMBER LIBGNUTLS_VERSION_NUMBER
 #define GNUTLS_VERSION LIBGNUTLS_VERSION
@@ -189,10 +199,8 @@ namespace GnuTLS
                                hash = GNUTLS_DIG_MD5;
                        else if (stdalgo::string::equalsci(hashname, "sha1"))
                                hash = GNUTLS_DIG_SHA1;
-#ifdef INSPIRCD_GNUTLS_ENABLE_SHA256_FINGERPRINT
                        else if (stdalgo::string::equalsci(hashname, "sha256"))
                                hash = GNUTLS_DIG_SHA256;
-#endif
                        else
                                throw Exception("Unknown hash type " + hashname);
 #endif
@@ -1387,7 +1395,7 @@ class ModuleSSLGnuTLS : public Module
 
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Provides SSL support for clients", VF_VENDOR);
+               return Version("Provides SSL support via GnuTLS", VF_VENDOR);
        }
 
        ModResult OnCheckReady(LocalUser* user) CXX11_OVERRIDE