]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules/ssl.h
Only check for a join time if a user is actually in the channel.
[user/henk/code/inspircd.git] / include / modules / ssl.h
index 017502fa90eec67ec5c227e7ae9f001894c8bd90..7af2ce3ee2785d9a917931237bb4281422a27683 100644 (file)
@@ -1,9 +1,10 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
+ *   Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions>
  *   Copyright (C) 2019 B00mX0r <b00mx0r@aureus.pw>
  *   Copyright (C) 2018 Dylan Frank <b00mx0r@aureus.pw>
- *   Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2013, 2017-2019, 2021 Sadie Powell <sadie@witchery.services>
  *   Copyright (C) 2013, 2015-2016 Attila Molnar <attilamolnar@hush.com>
  *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
  *   Copyright (C) 2012 ChrisTX <xpipe@hotmail.de>
@@ -150,6 +151,16 @@ class ssl_cert : public refcountbase
        }
 };
 
+/** I/O hook provider for SSL modules. */
+class SSLIOHookProvider : public IOHookProvider
+{
+public:
+       SSLIOHookProvider(Module* mod, const std::string& Name)
+               : IOHookProvider(mod, "ssl/" + Name, IOH_SSL)
+       {
+       }
+};
+
 class SSLIOHook : public IOHook
 {
  protected:
@@ -185,9 +196,10 @@ class SSLIOHook : public IOHook
  public:
        static SSLIOHook* IsSSL(StreamSocket* sock)
        {
-               IOHook* const iohook = sock->GetIOHook();
-               if ((iohook) && ((iohook->prov->type == IOHookProvider::IOH_SSL)))
-                       return static_cast<SSLIOHook*>(iohook);
+               IOHook* const lasthook = sock->GetLastHook();
+               if (lasthook && (lasthook->prov->type == IOHookProvider::IOH_SSL))
+                       return static_cast<SSLIOHook*>(lasthook);
+
                return NULL;
        }
 
@@ -238,7 +250,7 @@ class SSLIOHook : public IOHook
 class SSLClientCert
 {
  public:
-       /**
+       /**
         * Get the client certificate from a socket
         * @param sock The socket to get the certificate from, the socket does not have to use TLS (SSL)
         * @return The TLS (SSL) client certificate information, NULL if the peer is not using TLS (SSL)
@@ -271,7 +283,7 @@ class SSLClientCert
 class UserCertificateAPIBase : public DataProvider
 {
  public:
-       UserCertificateAPIBase(Module* parent)
+       UserCertificateAPIBase(Module* parent)
                : DataProvider(parent, "m_sslinfo_api")
        {
        }