aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-11-29 22:41:06 +0000
committerGravatar Sadie Powell2022-11-29 22:41:06 +0000
commitd2c6858e87b92bfcffe12155f8145ab7c2db0b41 (patch)
treeb6630dfcdf3f06b188ae8709334c8ac259ff64a4 /src/modules
parentFix asserting when building against libstdc++ in debug mode. (diff)
downloadinspircd++-d2c6858e87b92bfcffe12155f8145ab7c2db0b41.tar.gz
inspircd++-d2c6858e87b92bfcffe12155f8145ab7c2db0b41.tar.bz2
inspircd++-d2c6858e87b92bfcffe12155f8145ab7c2db0b41.zip
Use gnutls_digest_get_id if supported by the GnuTLS library.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 94baab642..e09098825 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -198,9 +198,12 @@ namespace GnuTLS
{
// As older versions of gnutls can't do this, let's disable it where needed.
#ifdef GNUTLS_HAS_MAC_GET_ID
+# if INSPIRCD_GNUTLS_HAS_VERSION(3, 2, 2)
+ hash = gnutls_digest_get_id(hashname.c_str());
+# else
// As gnutls_digest_algorithm_t and gnutls_mac_algorithm_t are mapped 1:1, we can do this
- // There is no gnutls_dig_get_id() at the moment, but it may come later
hash = (gnutls_digest_algorithm_t)gnutls_mac_get_id(hashname.c_str());
+# endif
if (hash == GNUTLS_DIG_UNKNOWN)
throw Exception("Unknown hash type " + hashname);