]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_openssl.cpp
Move configuration examples to docs, remove automatic overwrite on make install
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_openssl.cpp
index 8a2737f0e7ca345a73ee061bbb6ff7f285103708..018d7351ef1e66d0495876ee588b43ac53e63c74 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
@@ -14,7 +14,7 @@
 #include "inspircd.h"
 #include <openssl/ssl.h>
 #include <openssl/err.h>
-#include "transport.h"
+#include "ssl.h"
 
 #ifdef WINDOWS
 #pragma comment(lib, "libeay32MTd")
 /* $CompileFlags: if(!"USE_FREEBSD_BASE_SSL") pkgconfversion("openssl","0.9.7") pkgconfincludes("openssl","/openssl/ssl.h","") */
 /* $LinkerFlags: if(!"USE_FREEBSD_BASE_SSL") rpath("pkg-config --libs openssl") pkgconflibs("openssl","/libssl.so","-lssl -lcrypto -ldl") */
 
-/* $ModDep: transport.h */
 /* $NoPedantic */
-/* $CopyInstall: conf/key.pem $(CONPATH) */
-/* $CopyInstall: conf/cert.pem $(CONPATH) */
 
 
 enum issl_status { ISSL_NONE, ISSL_HANDSHAKING, ISSL_OPEN };
-enum issl_io_status { ISSL_WRITE, ISSL_READ };
 
 static bool SelfSigned = false;
 
@@ -49,25 +45,21 @@ static int error_callback(const char *str, size_t len, void *u);
 
 /** Represents an SSL user's extra data
  */
-class issl_session : public classbase
+class issl_session
 {
 public:
        SSL* sess;
        issl_status status;
-       issl_io_status rstat;
-       issl_io_status wstat;
+       reference<ssl_cert> cert;
 
-       unsigned int inbufoffset;
-       char* inbuf;                    // Buffer OpenSSL reads into.
-       std::string outbuf;
        int fd;
        bool outbound;
+       bool data_to_write;
 
        issl_session()
        {
                outbound = false;
-               rstat = ISSL_READ;
-               wstat = ISSL_WRITE;
+               data_to_write = false;
        }
 };
 
@@ -87,8 +79,6 @@ static int OnVerify(int preverify_ok, X509_STORE_CTX *ctx)
 
 class ModuleSSLOpenSSL : public Module
 {
-       std::set<ListenSocketBase*> listenports;
-
        int inbufsize;
        issl_session* sessions;
 
@@ -97,22 +87,14 @@ class ModuleSSLOpenSSL : public Module
 
        char cipher[MAXBUF];
 
-       std::string keyfile;
-       std::string certfile;
-       std::string cafile;
-       // std::string crlfile;
-       std::string dhfile;
        std::string sslports;
+       bool use_sha;
 
+       ServiceProvider iohook;
  public:
 
-       InspIRCd* PublicInstance;
-
-       ModuleSSLOpenSSL(InspIRCd* Me)
-       : Module(Me), PublicInstance(Me)
+       ModuleSSLOpenSSL() : iohook(this, "ssl/openssl", SERVICE_IOHOOK)
        {
-               ServerInstance->Modules->PublishInterface("BufferedSocketHook", this);
-
                sessions = new issl_session[ServerInstance->SE->GetMaxFds()];
 
                // Not rehashable...because I cba to reduce all the sizes of existing buffers.
@@ -133,18 +115,20 @@ class ModuleSSLOpenSSL : public Module
 
                SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, OnVerify);
                SSL_CTX_set_verify(clictx, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, OnVerify);
+       }
 
+       void init()
+       {
                // Needs the flag as it ignores a plain /rehash
                OnModuleRehash(NULL,"ssl");
-               Implementation eventlist[] = {
-                       I_On005Numeric, I_OnBufferFlushed, I_OnRequest, I_OnRehash, I_OnModuleRehash, I_OnPostConnect,
-                       I_OnHookIO };
+               Implementation eventlist[] = { I_On005Numeric, I_OnRehash, I_OnModuleRehash, I_OnHookIO, I_OnUserConnect };
                ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
+               ServerInstance->Modules->AddService(iohook);
        }
 
-       void OnHookIO(StreamSocket* user, ListenSocketBase* lsb)
+       void OnHookIO(StreamSocket* user, ListenSocket* lsb)
        {
-               if (!user->GetIOHook() && listenports.find(lsb) != listenports.end())
+               if (!user->GetIOHook() && lsb->bind_tag->getString("ssl") == "openssl")
                {
                        /* Hook the user with our module */
                        user->AddIOHook(this);
@@ -153,23 +137,19 @@ class ModuleSSLOpenSSL : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
-               listenports.clear();
                sslports.clear();
 
                for (size_t i = 0; i < ServerInstance->ports.size(); i++)
                {
-                       ListenSocketBase* port = ServerInstance->ports[i];
-                       std::string desc = port->GetDescription();
-                       if (desc != "openssl")
+                       ListenSocket* port = ServerInstance->ports[i];
+                       if (port->bind_tag->getString("ssl") != "openssl")
                                continue;
 
-                       listenports.insert(port);
-                       std::string portid = port->GetBindDesc();
-
+                       std::string portid = port->bind_desc;
                        ServerInstance->Logs->Log("m_ssl_openssl", DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %s", portid.c_str());
-                       if (port->GetIP() != "127.0.0.1")
+                       if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1")
                                sslports.append(portid).append(";");
                }
 
@@ -182,44 +162,23 @@ class ModuleSSLOpenSSL : public Module
                if (param != "ssl")
                        return;
 
+               std::string keyfile;
+               std::string certfile;
+               std::string cafile;
+               std::string dhfile;
                OnRehash(user);
 
-               ConfigReader Conf(ServerInstance);
-
-               std::string confdir(ServerInstance->ConfigFileName);
-               // +1 so we the path ends with a /
-               confdir = confdir.substr(0, confdir.find_last_of('/') + 1);
-
-               cafile   = Conf.ReadValue("openssl", "cafile", 0);
-               certfile = Conf.ReadValue("openssl", "certfile", 0);
-               keyfile  = Conf.ReadValue("openssl", "keyfile", 0);
-               dhfile   = Conf.ReadValue("openssl", "dhfile", 0);
-
-               // Set all the default values needed.
-               if (cafile.empty())
-                       cafile = "ca.pem";
-
-               if (certfile.empty())
-                       certfile = "cert.pem";
+               ConfigTag* conf = ServerInstance->Config->ConfValue("openssl");
 
-               if (keyfile.empty())
-                       keyfile = "key.pem";
+               cafile   = conf->getString("cafile", "conf/ca.pem");
+               certfile = conf->getString("certfile", "conf/cert.pem");
+               keyfile  = conf->getString("keyfile", "conf/key.pem");
+               dhfile   = conf->getString("dhfile", "conf/dhparams.pem");
+               std::string hash = conf->getString("hash", "md5");
+               if (hash != "sha1" && hash != "md5")
+                       throw ModuleException("Unknown hash type " + hash);
+               use_sha = (hash == "sha1");
 
-               if (dhfile.empty())
-                       dhfile = "dhparams.pem";
-
-               // Prepend relative paths with the path to the config directory.
-               if ((cafile[0] != '/') && (!ServerInstance->Config->StartsWithWindowsDriveLetter(cafile)))
-                       cafile = confdir + cafile;
-
-               if ((certfile[0] != '/') && (!ServerInstance->Config->StartsWithWindowsDriveLetter(certfile)))
-                       certfile = confdir + certfile;
-
-               if ((keyfile[0] != '/') && (!ServerInstance->Config->StartsWithWindowsDriveLetter(keyfile)))
-                       keyfile = confdir + keyfile;
-
-               if ((dhfile[0] != '/') && (!ServerInstance->Config->StartsWithWindowsDriveLetter(dhfile)))
-                       dhfile = confdir + dhfile;
 
                /* Load our keys and certificates
                 * NOTE: OpenSSL's error logging API sucks, don't blame us for this clusterfuck.
@@ -274,75 +233,56 @@ class ModuleSSLOpenSSL : public Module
        {
                SSL_CTX_free(ctx);
                SSL_CTX_free(clictx);
-               ServerInstance->Modules->UnpublishInterface("BufferedSocketHook", this);
                delete[] sessions;
        }
 
+       void OnUserConnect(LocalUser* user)
+       {
+               if (user->eh.GetIOHook() == this)
+               {
+                       if (sessions[user->GetFd()].sess)
+                       {
+                               SSLCertSubmission(user, this, ServerInstance->Modules->Find("m_sslinfo.so"), sessions[user->GetFd()].cert);
+
+                               if (!sessions[user->GetFd()].cert->fingerprint.empty())
+                                       user->WriteServ("NOTICE %s :*** You are connected using SSL fingerprint %s",
+                                               user->nick.c_str(), sessions[user->GetFd()].cert->fingerprint.c_str());
+                       }
+               }
+       }
+
        void OnCleanup(int target_type, void* item)
        {
                if (target_type == TYPE_USER)
                {
-                       User* user = (User*)item;
+                       LocalUser* user = IS_LOCAL((User*)item);
 
-                       if (user->GetIOHook() == this)
+                       if (user && user->eh.GetIOHook() == this)
                        {
                                // User is using SSL, they're a local user, and they're using one of *our* SSL ports.
                                // Potentially there could be multiple SSL modules loaded at once on different ports.
                                ServerInstance->Users->QuitUser(user, "SSL module unloading");
-                               user->DelIOHook();
                        }
                }
        }
 
        Version GetVersion()
        {
-               return Version("Provides SSL support for clients", VF_VENDOR, API_VERSION);
+               return Version("Provides SSL support for clients", VF_VENDOR);
        }
 
-
-       const char* OnRequest(Request* request)
+       void OnRequest(Request& request)
        {
-               ISHRequest* ISR = (ISHRequest*)request;
-               if (strcmp("IS_NAME", request->GetId()) == 0)
-               {
-                       return "openssl";
-               }
-               else if (strcmp("IS_HOOK", request->GetId()) == 0)
-               {
-                       ISR->Sock->AddIOHook(this);
-                       return "OK";
-               }
-               else if (strcmp("IS_UNHOOK", request->GetId()) == 0)
-               {
-                       ISR->Sock->DelIOHook();
-                       return "OK";
-               }
-               else if (strcmp("IS_HSDONE", request->GetId()) == 0)
+               if (strcmp("GET_SSL_CERT", request.id) == 0)
                {
-                       if (ISR->Sock->GetFd() < 0)
-                               return "OK";
+                       SocketCertificateRequest& req = static_cast<SocketCertificateRequest&>(request);
+                       int fd = req.sock->GetFd();
+                       issl_session* session = &sessions[fd];
 
-                       issl_session* session = &sessions[ISR->Sock->GetFd()];
-                       return (session->status == ISSL_HANDSHAKING) ? NULL : "OK";
+                       req.cert = session->cert;
                }
-               else if (strcmp("IS_ATTACH", request->GetId()) == 0)
-               {
-                       issl_session* session = &sessions[ISR->Sock->GetFd()];
-                       if (session->sess)
-                       {
-                               return "OK";
-                       }
-               }
-               else if (strcmp("GET_CERT", request->GetId()) == 0)
-               {
-                       Module* sslinfo = ServerInstance->Modules->Find("m_sslinfo.so");
-                       if (sslinfo)
-                               return sslinfo->OnRequest(request);
-               }
-               return NULL;
        }
 
-
        void OnStreamSocketAccept(StreamSocket* user, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server)
        {
                int fd = user->GetFd();
@@ -350,8 +290,6 @@ class ModuleSSLOpenSSL : public Module
                issl_session* session = &sessions[fd];
 
                session->fd = fd;
-               session->inbuf = new char[inbufsize];
-               session->inbufoffset = 0;
                session->sess = SSL_new(ctx);
                session->status = ISSL_NONE;
                session->outbound = false;
@@ -378,8 +316,6 @@ class ModuleSSLOpenSSL : public Module
                issl_session* session = &sessions[fd];
 
                session->fd = fd;
-               session->inbuf = new char[inbufsize];
-               session->inbufoffset = 0;
                session->sess = SSL_new(clictx);
                session->status = ISSL_NONE;
                session->outbound = true;
@@ -423,19 +359,12 @@ class ModuleSSLOpenSSL : public Module
 
                if (session->status == ISSL_HANDSHAKING)
                {
-                       if (session->rstat == ISSL_READ || session->wstat == ISSL_READ)
-                       {
-                               // The handshake isn't finished and it wants to read, try to finish it.
-                               if (!Handshake(user, session))
-                               {
-                                       // Couldn't resume handshake.
-                                       if (session->status == ISSL_NONE)
-                                               return -1;
-                                       return 0;
-                               }
-                       }
-                       else
+                       // The handshake isn't finished and it wants to read, try to finish it.
+                       if (!Handshake(user, session))
                        {
+                               // Couldn't resume handshake.
+                               if (session->status == ISSL_NONE)
+                                       return -1;
                                return 0;
                        }
                }
@@ -444,26 +373,40 @@ class ModuleSSLOpenSSL : public Module
 
                if (session->status == ISSL_OPEN)
                {
-                       if (session->wstat == ISSL_READ)
+                       char* buffer = ServerInstance->GetReadBuffer();
+                       size_t bufsiz = ServerInstance->Config->NetBufferSize;
+                       int ret = SSL_read(session->sess, buffer, bufsiz);
+
+                       if (ret > 0)
                        {
-                               if(DoWrite(user, session) == 0)
-                                       return 0;
+                               recvq.append(buffer, ret);
+                               return 1;
                        }
-
-                       if (session->rstat == ISSL_READ)
+                       else if (ret == 0)
                        {
-                               int ret = DoRead(user, session);
+                               // Client closed connection.
+                               CloseSession(session);
+                               return -1;
+                       }
+                       else if (ret < 0)
+                       {
+                               int err = SSL_get_error(session->sess, ret);
 
-                               if (ret > 0)
+                               if (err == SSL_ERROR_WANT_READ)
                                {
-                                       recvq.append(session->inbuf, session->inbufoffset);
-                                       session->inbufoffset = 0;
-                                       return 1;
+                                       ServerInstance->SE->ChangeEventMask(user, FD_WANT_POLL_READ);
+                                       return 0;
                                }
-                               else if (errno == EAGAIN || errno == EINTR)
+                               else if (err == SSL_ERROR_WANT_WRITE)
+                               {
+                                       ServerInstance->SE->ChangeEventMask(user, FD_WANT_NO_READ | FD_WANT_SINGLE_WRITE);
                                        return 0;
+                               }
                                else
+                               {
+                                       CloseSession(session);
                                        return -1;
+                               }
                        }
                }
 
@@ -473,9 +416,6 @@ class ModuleSSLOpenSSL : public Module
        int OnStreamSocketWrite(StreamSocket* user, std::string& buffer)
        {
                int fd = user->GetFd();
-               /* Are there any possibilities of an out of range fd? Hope not, but lets be paranoid */
-               if ((fd < 0) || (fd > ServerInstance->SE->GetMaxFds() - 1))
-                       return -1;
 
                issl_session* session = &sessions[fd];
 
@@ -485,139 +425,64 @@ class ModuleSSLOpenSSL : public Module
                        return -1;
                }
 
+               session->data_to_write = true;
+
                if (session->status == ISSL_HANDSHAKING)
                {
-                       // The handshake isn't finished, try to finish it.
-                       if (session->rstat == ISSL_WRITE || session->wstat == ISSL_WRITE)
+                       if (!Handshake(user, session))
                        {
-                               if (!Handshake(user, session))
-                               {
-                                       // Couldn't resume handshake.
-                                       if (session->status == ISSL_NONE)
-                                               return -1;
-                                       return 0;
-                               }
+                               // Couldn't resume handshake.
+                               if (session->status == ISSL_NONE)
+                                       return -1;
+                               return 0;
                        }
                }
 
-               int rv = 0;
-
-               // don't pull items into the output buffer until they are
-               // unlikely to block; this allows sendq exceeded to continue
-               // to work for SSL users.
-               // TODO better signaling for I/O requests so this isn't needed
-               if (session->outbuf.empty())
-               {
-                       session->outbuf = buffer;
-                       rv = 1;
-               }
-
                if (session->status == ISSL_OPEN)
                {
-                       if (session->rstat == ISSL_WRITE)
+                       int ret = SSL_write(session->sess, buffer.data(), buffer.size());
+                       if (ret == (int)buffer.length())
                        {
-                               DoRead(user, session);
+                               session->data_to_write = false;
+                               ServerInstance->SE->ChangeEventMask(user, FD_WANT_POLL_READ | FD_WANT_NO_WRITE);
+                               return 1;
                        }
-
-                       if (session->wstat == ISSL_WRITE)
+                       else if (ret > 0)
                        {
-                               DoWrite(user, session);
-                       }
-               }
-
-               if (rv == 0 || !session->outbuf.empty())
-                       ServerInstance->SE->WantWrite(user);
-
-               return rv;
-       }
-
-       int DoWrite(StreamSocket* user, issl_session* session)
-       {
-               if (!session->outbuf.size())
-                       return -1;
-
-               int ret = SSL_write(session->sess, session->outbuf.data(), session->outbuf.size());
-
-               if (ret == 0)
-               {
-                       CloseSession(session);
-                       return 0;
-               }
-               else if (ret < 0)
-               {
-                       int err = SSL_get_error(session->sess, ret);
-
-                       if (err == SSL_ERROR_WANT_WRITE)
-                       {
-                               session->wstat = ISSL_WRITE;
-                               ServerInstance->SE->WantWrite(user);
-                               return -1;
-                       }
-                       else if (err == SSL_ERROR_WANT_READ)
-                       {
-                               session->wstat = ISSL_READ;
-                               return -1;
-                       }
-                       else
-                       {
-                               CloseSession(session);
+                               buffer = buffer.substr(ret);
+                               ServerInstance->SE->ChangeEventMask(user, FD_WANT_SINGLE_WRITE);
                                return 0;
                        }
-               }
-               else
-               {
-                       session->outbuf = session->outbuf.substr(ret);
-                       return ret;
-               }
-       }
-
-       int DoRead(StreamSocket* user, issl_session* session)
-       {
-               // Is this right? Not sure if the unencrypted data is garaunteed to be the same length.
-               // Read into the inbuffer, offset from the beginning by the amount of data we have that insp hasn't taken yet.
-
-               int ret = SSL_read(session->sess, session->inbuf + session->inbufoffset, inbufsize - session->inbufoffset);
-
-               if (ret == 0)
-               {
-                       // Client closed connection.
-                       CloseSession(session);
-                       return 0;
-               }
-               else if (ret < 0)
-               {
-                       int err = SSL_get_error(session->sess, ret);
-
-                       if (err == SSL_ERROR_WANT_READ)
-                       {
-                               session->rstat = ISSL_READ;
-                               return -1;
-                       }
-                       else if (err == SSL_ERROR_WANT_WRITE)
+                       else if (ret == 0)
                        {
-                               session->rstat = ISSL_WRITE;
-                               ServerInstance->SE->WantWrite(user);
+                               CloseSession(session);
                                return -1;
                        }
-                       else
+                       else if (ret < 0)
                        {
-                               CloseSession(session);
-                               return 0;
-                       }
-               }
-               else
-               {
-                       // Read successfully 'ret' bytes into inbuf + inbufoffset
-                       // There are 'ret' + 'inbufoffset' bytes of data in 'inbuf'
-                       // 'buffer' is 'count' long
+                               int err = SSL_get_error(session->sess, ret);
 
-                       session->inbufoffset += ret;
-
-                       return ret;
+                               if (err == SSL_ERROR_WANT_WRITE)
+                               {
+                                       ServerInstance->SE->ChangeEventMask(user, FD_WANT_SINGLE_WRITE);
+                                       return 0;
+                               }
+                               else if (err == SSL_ERROR_WANT_READ)
+                               {
+                                       ServerInstance->SE->ChangeEventMask(user, FD_WANT_POLL_READ | FD_WANT_NO_WRITE);
+                                       return 0;
+                               }
+                               else
+                               {
+                                       CloseSession(session);
+                                       return -1;
+                               }
+                       }
                }
+               return 0;
        }
 
-       bool Handshake(EventHandler* user, issl_session* session)
+       bool Handshake(StreamSocket* user, issl_session* session)
        {
                int ret;
 
@@ -632,15 +497,14 @@ class ModuleSSLOpenSSL : public Module
 
                        if (err == SSL_ERROR_WANT_READ)
                        {
-                               session->rstat = ISSL_READ;
+                               ServerInstance->SE->ChangeEventMask(user, FD_WANT_POLL_READ | FD_WANT_NO_WRITE);
                                session->status = ISSL_HANDSHAKING;
                                return true;
                        }
                        else if (err == SSL_ERROR_WANT_WRITE)
                        {
-                               session->wstat = ISSL_WRITE;
+                               ServerInstance->SE->ChangeEventMask(user, FD_WANT_NO_READ | FD_WANT_SINGLE_WRITE);
                                session->status = ISSL_HANDSHAKING;
-                               ServerInstance->SE->WantWrite(user);
                                return true;
                        }
                        else
@@ -653,13 +517,11 @@ class ModuleSSLOpenSSL : public Module
                else if (ret > 0)
                {
                        // Handshake complete.
-                       // This will do for setting the ssl flag...it could be done earlier if it's needed. But this seems neater.
-                       EventHandler *u = ServerInstance->SE->GetRef(session->fd);
-                       VerifyCertificate(session, u);
+                       VerifyCertificate(session, user);
 
                        session->status = ISSL_OPEN;
 
-                       ServerInstance->SE->WantWrite(user);
+                       ServerInstance->SE->ChangeEventMask(user, FD_WANT_POLL_READ | FD_WANT_NO_WRITE | FD_ADD_TRIAL_WRITE);
 
                        return true;
                }
@@ -672,17 +534,6 @@ class ModuleSSLOpenSSL : public Module
                return true;
        }
 
-       void OnBufferFlushed(User* user)
-       {
-               if (user->GetIOHook() == this)
-               {
-                       std::string dummy;
-                       issl_session* session = &sessions[user->GetFd()];
-                       if (session && session->outbuf.size())
-                               OnStreamSocketWrite(user, dummy);
-               }
-       }
-
        void CloseSession(issl_session* session)
        {
                if (session->sess)
@@ -691,39 +542,28 @@ class ModuleSSLOpenSSL : public Module
                        SSL_free(session->sess);
                }
 
-               if (session->inbuf)
-               {
-                       delete[] session->inbuf;
-               }
-
-               session->outbuf.clear();
-               session->inbuf = NULL;
                session->sess = NULL;
                session->status = ISSL_NONE;
                errno = EIO;
        }
 
-       void VerifyCertificate(issl_session* session, Extensible* user)
+       void VerifyCertificate(issl_session* session, StreamSocket* user)
        {
-               if (!session->sess || !user)
-                       return;
-
-               Module* sslinfo = ServerInstance->Modules->Find("m_sslinfo.so");
-               if (!sslinfo)
+               if (!session->sess || !user || session->cert)
                        return;
 
                X509* cert;
                ssl_cert* certinfo = new ssl_cert;
+               session->cert = certinfo;
                unsigned int n;
                unsigned char md[EVP_MAX_MD_SIZE];
-               const EVP_MD *digest = EVP_md5();
+               const EVP_MD *digest = use_sha ? EVP_sha1() : EVP_md5();
 
                cert = SSL_get_peer_certificate((SSL*)session->sess);
 
                if (!cert)
                {
                        certinfo->error = "Could not get peer certificate: "+std::string(get_error());
-                       BufferedSocketFingerprintSubmission(user, this, sslinfo, certinfo).Send();
                        return;
                }
 
@@ -758,21 +598,12 @@ class ModuleSSLOpenSSL : public Module
                }
 
                X509_free(cert);
-               BufferedSocketFingerprintSubmission(user, this, sslinfo, certinfo).Send();
        }
-
-       void Prioritize()
-       {
-               Module* server = ServerInstance->Modules->Find("m_spanningtree.so");
-               ServerInstance->Modules->SetPriority(this, I_OnPostConnect, PRIORITY_AFTER, &server);
-       }
-
 };
 
 static int error_callback(const char *str, size_t len, void *u)
 {
-       ModuleSSLOpenSSL* mssl = (ModuleSSLOpenSSL*)u;
-       mssl->PublicInstance->Logs->Log("m_ssl_openssl",DEFAULT, "SSL error: " + std::string(str, len - 1));
+       ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "SSL error: " + std::string(str, len - 1));
 
        //
        // XXX: Remove this line, it causes valgrind warnings...