diff options
| author | 2012-03-22 18:35:25 -0400 | |
|---|---|---|
| committer | 2012-03-22 18:35:25 -0400 | |
| commit | 7f433a45bf0f4178df90cb1ccfbf3a878cab2ea7 (patch) | |
| tree | 1f496abe86bb965a5d7138b8d38db9d7c0907d19 /src/modules | |
| parent | m_ident: register service to actually make module work (diff) | |
m_ssl_gnutls: remove DH parameter generation
While the gnutls documentation recommends that DH parameters be
regenerated, this does not actually improve security and may freeze the
ircd for a significant amount of time (50s in some reports). Remove it.
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index e65f93fbb..3486025db 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -720,7 +720,6 @@ class ModuleSSLGnuTLS : public Module GnuTLSProvider iohook; CommandStartTLS starttls; - int once_in_a_while; std::string sslports; reference<DH_info> dh; @@ -728,7 +727,7 @@ class ModuleSSLGnuTLS : public Module public: ModuleSSLGnuTLS() - : capHandler(this, "tls"), iohook(this), starttls(this, iohook), once_in_a_while(0) + : capHandler(this, "tls"), iohook(this), starttls(this, iohook) { gnutls_global_init(); // This must be called once in the program } @@ -739,7 +738,7 @@ class ModuleSSLGnuTLS : public Module ServerInstance->GenRandom = &randhandler; - Implementation eventlist[] = { I_On005Numeric, I_OnModuleRehash, I_OnUserConnect, I_OnEvent, I_OnGarbageCollect }; + Implementation eventlist[] = { I_On005Numeric, I_OnModuleRehash, I_OnUserConnect, I_OnEvent }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); ServerInstance->Modules->AddService(iohook); @@ -824,25 +823,6 @@ class ModuleSSLGnuTLS : public Module } } - void OnGarbageCollect() - { - // Generate Diffie Hellman parameters - for use with DHE - // kx algorithms. These should be discarded and regenerated - // once a day, once a week or once a month. Depending on the - // security requirements. - if (once_in_a_while++ & 0xFF) - return; - - dh = new DH_info(dh->bits); - reference<x509_cred> cred = iohook.def_creds; - iohook.def_creds = new x509_cred(cred, dh); - for(std::map<std::string, reference<x509_cred> >::iterator i = iohook.creds.begin(); i != iohook.creds.end(); i++) - { - cred = i->second; - i->second = new x509_cred(cred, dh); - } - } - ~ModuleSSLGnuTLS() { iohook.creds.clear(); |
