diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-11-11 10:38:28 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-11-11 10:38:28 +0100 |
commit | 40a299772ca1ade0c356f4f91941d95fbac09237 (patch) | |
tree | 93c7be1af83346e046a1dce4e7ee009de681db5c /src | |
parent | 693ff4c7fa21a7bf337cd2d30f9bac602ed6beca (diff) |
m_ssl_gnutls Add GnuTLS::Priority::GetDefault()
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index d0b9bbe88..cc61ababc 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -345,6 +345,11 @@ namespace GnuTLS { gnutls_priority_set(sess, priority); } + + static const char* GetDefault() + { + return "NORMAL"; + } }; #else /** Dummy class, used when gnutls_priority_set() is not available @@ -354,7 +359,7 @@ namespace GnuTLS public: Priority(const std::string& priorities) { - if (priorities != "NORMAL") + if (priorities != GetDefault()) throw Exception("You've set a non-default priority string, but GnuTLS lacks support for it"); } @@ -363,6 +368,11 @@ namespace GnuTLS // Always set the default priorities gnutls_set_default_priority(sess); } + + static const char* GetDefault() + { + return "NORMAL"; + } }; #endif @@ -565,7 +575,7 @@ namespace GnuTLS std::auto_ptr<DHParams> dh = DHParams::Import(ReadFile(tag->getString("dhfile", "dhparams.pem"))); // Use default priority string if this tag does not specify one - std::string priostr = tag->getString("priority", "NORMAL"); + std::string priostr = tag->getString("priority", GnuTLS::Priority::GetDefault()); unsigned int mindh = tag->getInt("mindhbits", 1024); std::string hashstr = tag->getString("hash", "md5"); |