]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_oper_cert.cpp
Wheee, mass commit! this adds const stafety, throwing a compile error if anyone does...
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_oper_cert.cpp
index 074a75713b864ca1f9f016bfde25db1008a6ae0e..312ec874b13bf2f0c2d5fdfb13b4159613c40424 100644 (file)
@@ -33,7 +33,7 @@ class cmd_fingerprint : public Command
                syntax = "<nickname>";
        }       
                  
-       CmdResult Handle (const char** parameters, int pcnt, User *user)
+       CmdResult Handle (const char* const* parameters, int pcnt, User *user)
        {
                User* target = ServerInstance->FindNick(parameters[0]);
                if (target)
@@ -112,8 +112,7 @@ class ModuleOperSSLCert : public Module
                return false;
        }
 
-
-       virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line)
+       virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line)
        {
                irc::string cmd = command.c_str();
                
@@ -125,6 +124,7 @@ class ModuleOperSSLCert : public Module
                        std::string Password;
                        std::string OperType;
                        std::string HostName;
+                       std::string HashType;
                        std::string FingerPrint;
                        bool SSLOnly;
                        char* dummy;
@@ -140,12 +140,13 @@ class ModuleOperSSLCert : public Module
                                Password = cf->ReadValue("oper", "password", i);
                                OperType = cf->ReadValue("oper", "type", i);
                                HostName = cf->ReadValue("oper", "host", i);
+                               HashType = cf->ReadValue("oper", "hash", i);
                                FingerPrint = cf->ReadValue("oper", "fingerprint", i);
                                SSLOnly = cf->ReadFlag("oper", "sslonly", i);
 
                                if (SSLOnly || !FingerPrint.empty())
                                {
-                                       if ((!strcmp(LoginName.c_str(),parameters[0])) && (!ServerInstance->OperPassCompare(Password.c_str(),parameters[1],i)) && (OneOfMatches(TheHost,TheIP,HostName.c_str())))
+                                       if ((!strcmp(LoginName.c_str(),parameters[0])) && (!ServerInstance->PassCompare(user, Password.c_str(),parameters[1], HashType.c_str())) && (OneOfMatches(TheHost,TheIP,HostName.c_str())))
                                        {
                                                if (SSLOnly && !user->GetExt("ssl", dummy))
                                                {