]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_openssl.cpp
[Taros] Add m_sakick.so
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_openssl.cpp
index 389fffb85fca173d7123b38a2234abf28449cf01..b5a2741f9b41846fee190bddf4feec4eb4a4d9ad 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -677,7 +677,7 @@ class ModuleSSLOpenSSL : public Module
                        return;
 
                // Bugfix, only send this numeric for *our* SSL users
-               if (dest->GetExt("ssl", dummy) || ((IS_LOCAL(dest) && dest->GetIOHook() == this)))
+               if (dest->GetExt("ssl", dummy))
                {
                        ServerInstance->SendWhoisLine(source, dest, 320, "%s %s :is using a secure connection", source->nick.c_str(), dest->nick.c_str());
                }
@@ -775,7 +775,7 @@ class ModuleSSLOpenSSL : public Module
        {
                // This occurs AFTER OnUserConnect so we can be sure the
                // protocol module has propagated the NICK message.
-               if ((user->GetExt("ssl", dummy)) && (IS_LOCAL(user)))
+               if ((user->GetIOHook() == this) && (IS_LOCAL(user)))
                {
                        // Tell whatever protocol module we're using that we need to inform other servers of this metadata NOW.
                        ServerInstance->PI->SendMetaData(user, TYPE_USER, "SSL", "on");
@@ -798,7 +798,7 @@ class ModuleSSLOpenSSL : public Module
 
        virtual void OnBufferFlushed(User* user)
        {
-               if (user->GetExt("ssl"))
+               if (user->GetIOHook() == this)
                {
                        issl_session* session = &sessions[user->GetFd()];
                        if (session && session->outbuf.size())
@@ -871,7 +871,7 @@ class ModuleSSLOpenSSL : public Module
                        certinfo->data.insert(std::make_pair("fingerprint",irc::hex(md, n)));
                }
 
-               if ((ASN1_UTCTIME_cmp_time_t(X509_get_notAfter(cert), time(NULL)) == -1) || (ASN1_UTCTIME_cmp_time_t(X509_get_notBefore(cert), time(NULL)) == 0))
+               if ((ASN1_UTCTIME_cmp_time_t(X509_get_notAfter(cert), ServerInstance->Time()) == -1) || (ASN1_UTCTIME_cmp_time_t(X509_get_notBefore(cert), ServerInstance->Time()) == 0))
                {
                        certinfo->data.insert(std::make_pair("error","Not activated, or expired certificate"));
                }
@@ -882,7 +882,7 @@ class ModuleSSLOpenSSL : public Module
        void Prioritize()
        {
                Module* server = ServerInstance->Modules->Find("m_spanningtree.so");
-               ServerInstance->Modules->SetPriority(this, I_OnPostConnect, PRIO_AFTER, &server);
+               ServerInstance->Modules->SetPriority(this, I_OnPostConnect, PRIORITY_AFTER, &server);
        }
 
 };