]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_gnutls.cpp
m_ssl_gnutls Add compile time option for allowing sha256 certificate fingerprints
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_gnutls.cpp
index cdfe00b9c929705fcdcbeb76e568cbfa8bf6d816..228ceb99470264d7f163836f2e18b4bbf5607b6a 100644 (file)
@@ -157,7 +157,7 @@ public:
        reference<ssl_cert> cert;
        reference<SSLConfig> config;
 
-       issl_session() : socket(NULL), sess(NULL) {}
+       issl_session() : socket(NULL), sess(NULL), status(ISSL_NONE) {}
 };
 
 static SSLConfig* GetSessionConfig(gnutls_session_t sess)
@@ -419,6 +419,10 @@ class ModuleSSLGnuTLS : public Module
                        hash = GNUTLS_DIG_MD5;
                else if (hashname == "sha1")
                        hash = GNUTLS_DIG_SHA1;
+#ifdef INSPIRCD_GNUTLS_ENABLE_SHA256_FINGERPRINT
+               else if (hashname == "sha256")
+                       hash = GNUTLS_DIG_SHA256;
+#endif
                else
                        throw ModuleException("Unknown hash type " + hashname);