]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/ssl.h
Fix MySQL crash on module unload with empty query queue
[user/henk/code/inspircd.git] / src / modules / ssl.h
index a01d91430e84ef5d296c9d3741cc32f7c32e40e6..e66e423aabd52d2c245a8e3210af91c9132394eb 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -34,6 +34,8 @@ class ssl_cert : public refcountbase
        std::string fingerprint;
        bool trusted, invalid, unknownsigner, revoked;
 
+       ssl_cert() : trusted(false), invalid(true), unknownsigner(true), revoked(false) {}
+
        /** Get certificate distinguished name
         * @return Certificate DN
         */
@@ -104,6 +106,11 @@ class ssl_cert : public refcountbase
                return revoked;
        }
 
+       bool IsCAVerified()
+       {
+               return trusted && !invalid && !revoked && !unknownsigner && error.empty();
+       }
+
        std::string GetMetaLine()
        {
                std::stringstream value;
@@ -124,8 +131,8 @@ struct SocketCertificateRequest : public Request
        StreamSocket* const sock;
        ssl_cert* cert;
 
-       SocketCertificateRequest(StreamSocket* ss, Module* Me, Module* hook)
-               : Request(Me, hook, "GET_SSL_CERT"), sock(ss), cert(NULL)
+       SocketCertificateRequest(StreamSocket* ss, Module* Me)
+               : Request(Me, ss->GetIOHook(), "GET_SSL_CERT"), sock(ss), cert(NULL)
        {
                Send();
        }
@@ -158,15 +165,4 @@ struct UserCertificateRequest : public Request
        }
 };
 
-struct SSLCertSubmission : public Request
-{
-       Extensible* const item;
-       ssl_cert* const cert;
-       SSLCertSubmission(Extensible* is, Module* Me, Module* Target, ssl_cert* Cert)
-               : Request(Me, Target, "SET_CERT"), item(is), cert(Cert)
-       {
-               Send();
-       }
-};
-
 #endif