summaryrefslogtreecommitdiff
path: root/src/modules/ssl.h
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-06 22:37:52 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-06 22:37:52 +0000
commiteaace5ed7cef3a02f905689a1b44a092ca99a6e1 (patch)
treeeb1340e768f23e3ab121ad185e8e61bedb23a32a /src/modules/ssl.h
parenta26502ff51141c3cd74c078876d3322b49a3833c (diff)
Remove Extensible parent from EventHandler
This also fixes SSL certificate support when m_sslinfo is not loaded git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12048 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/ssl.h')
-rw-r--r--src/modules/ssl.h31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/modules/ssl.h b/src/modules/ssl.h
index 68f1910ff..a01d91430 100644
--- a/src/modules/ssl.h
+++ b/src/modules/ssl.h
@@ -25,7 +25,7 @@
* in a unified manner. These classes are attached to ssl-
* connected local users using SSLCertExt
*/
-class ssl_cert
+class ssl_cert : public refcountbase
{
public:
std::string dn;
@@ -118,13 +118,34 @@ class ssl_cert
}
};
-struct SSLCertificateRequest : public Request
+/** Get certificate from a socket (only useful with an SSL module) */
+struct SocketCertificateRequest : public Request
{
- Extensible* const item;
+ StreamSocket* const sock;
+ ssl_cert* cert;
+
+ SocketCertificateRequest(StreamSocket* ss, Module* Me, Module* hook)
+ : Request(Me, hook, "GET_SSL_CERT"), sock(ss), cert(NULL)
+ {
+ Send();
+ }
+
+ std::string GetFingerprint()
+ {
+ if (cert)
+ return cert->GetFingerprint();
+ return "";
+ }
+};
+
+/** Get certificate from a user (requires m_sslinfo) */
+struct UserCertificateRequest : public Request
+{
+ User* const user;
ssl_cert* cert;
- SSLCertificateRequest(Extensible* e, Module* Me, Module* info = ServerInstance->Modules->Find("m_sslinfo.so"))
- : Request(Me, info, "GET_CERT"), item(e), cert(NULL)
+ UserCertificateRequest(User* u, Module* Me, Module* info = ServerInstance->Modules->Find("m_sslinfo.so"))
+ : Request(Me, info, "GET_USER_CERT"), user(u), cert(NULL)
{
Send();
}