summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorChrisTX <chris@rev-crew.info>2012-08-08 23:43:07 +0200
committerattilamolnar <attilamolnar@hush.com>2012-08-20 17:26:26 +0200
commit67dbc3131fe050de6991ddc6a854e363f1076fbe (patch)
tree84de2019d8a4a25b527086bd79e282914380dad5 /src/modules
parentd43db424fef044cb3c77274046d203fae7224bf4 (diff)
listensocket: Fix the two aliasing warnings
m_ssl_gnutls: Fix three warnings: 1. libgcrypt will emit a warning to stdout during runtime that it has not been properly initialized 2. Resolve a warning about invalid narrowing inside a { } block. This is not valid as of C++11. 3. Resolve a warning about a wrong format specifier being used
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 7d8e9581e..bf48a49d1 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -180,6 +180,8 @@ class ModuleSSLGnuTLS : public Module
ModuleSSLGnuTLS()
: starttls(this), capHandler(this, "tls"), iohook(this, "ssl/gnutls", SERVICE_IOHOOK)
{
+ gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
+
sessions = new issl_session[ServerInstance->SE->GetMaxFds()];
gnutls_global_init(); // This must be called once in the program
@@ -319,11 +321,11 @@ class ModuleSSLGnuTLS : public Module
reader.LoadFile(certfile);
std::string cert_string = reader.Contents();
- gnutls_datum_t cert_datum = { (unsigned char*)cert_string.data(), cert_string.length() };
+ gnutls_datum_t cert_datum = { (unsigned char*)cert_string.data(), static_cast<unsigned int>(cert_string.length()) };
reader.LoadFile(keyfile);
std::string key_string = reader.Contents();
- gnutls_datum_t key_datum = { (unsigned char*)key_string.data(), key_string.length() };
+ gnutls_datum_t key_datum = { (unsigned char*)key_string.data(), static_cast<unsigned int>(key_string.length()) };
// If this fails, no SSL port will work. At all. So, do the smart thing - throw a ModuleException
unsigned int certcount = Conf->getInt("certcount", 3);
@@ -350,7 +352,7 @@ class ModuleSSLGnuTLS : public Module
if ((ret = gnutls_priority_init(&priority, priocstr, &prioerror)) < 0)
{
// gnutls did not understand the user supplied string, log and fall back to the default priorities
- ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to set priorities to \"%s\": %s Syntax error at position %d, falling back to default (NORMAL)", priorities.c_str(), gnutls_strerror(ret), (prioerror - priocstr));
+ ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to set priorities to \"%s\": %s Syntax error at position %ld, falling back to default (NORMAL)", priorities.c_str(), gnutls_strerror(ret), (prioerror - priocstr));
gnutls_priority_init(&priority, "NORMAL", NULL);
}