]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_password_hash.cpp
Fix infinite loop on alias expansion, found by Adam
[user/henk/code/inspircd.git] / src / modules / m_password_hash.cpp
index b9fcb63a4cef88216d541d687dbc664edfa00e8f..617983ec4df49a56422a8876ddb8969730687b62 100644 (file)
@@ -40,7 +40,7 @@ class CommandMkpasswd : public Command
                        HashRequest hash(creator, x->second, stuff);
                        /* Now attempt to generate a hash */
                        user->WriteServ("NOTICE %s :%s hashed password for %s is %s",
-                               user->nick.c_str(), algo, stuff, hash.result.c_str());
+                               user->nick.c_str(), algo, stuff, hash.hex().c_str());
                }
                else if (names.empty())
                {
@@ -114,11 +114,10 @@ class ModuleOperHash : public Module
        }
 
 
-       virtual void OnLoadModule(Module* mod, const std::string& name)
+       virtual void OnLoadModule(Module* mod)
        {
                if (ServerInstance->Modules->ModuleHasInterface(mod, "HashRequest"))
                {
-                       ServerInstance->Logs->Log("m_password-hash",DEBUG, "Post-load registering hasher: %s", name.c_str());
                        std::string sname = HashNameRequest(this, mod).response;
                        hashers[sname.c_str()] = mod;
                        names.push_back(sname);
@@ -139,7 +138,7 @@ class ModuleOperHash : public Module
                if (x != hashers.end())
                {
                        /* Compare the hash in the config to the generated hash */
-                       if (!strcasecmp(data.c_str(), HashRequest(this, x->second, input).result.c_str()))
+                       if (!strcasecmp(data.c_str(), HashRequest(this, x->second, input).hex().c_str()))
                                return MOD_RES_ALLOW;
                        /* No match, and must be hashed, forbid */
                        else
@@ -152,7 +151,7 @@ class ModuleOperHash : public Module
 
        virtual Version GetVersion()
        {
-               return Version("Allows for hashed oper passwords",VF_VENDOR,API_VERSION);
+               return Version("Allows for hashed oper passwords",VF_VENDOR);
        }
 };