]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/ssl.h
SVSNICK should not translate nicks to UIDs
[user/henk/code/inspircd.git] / src / modules / ssl.h
index 17fa6b3f6cea1e66014756911c24857871e2990f..e66e423aabd52d2c245a8e3210af91c9132394eb 100644 (file)
@@ -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