]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_md5.cpp
Add support for blacklists and whitelists, just http password auth to go (the most...
[user/henk/code/inspircd.git] / src / modules / m_md5.cpp
index b882583684757aa85c5a9d4bec9daafcf9ffc587..6096f9afa9bd4116f4449f9a0b91633eb3e7601a 100644 (file)
@@ -245,11 +245,11 @@ class ModuleMD5 : public Module
        }
        
        
-       void GenHash(const char* src, char* dest, const char* xtab, unsigned int* ikey)
+       void GenHash(const char* src, char* dest, const char* xtab, unsigned int* ikey, size_t srclen)
        {
                unsigned char bytes[16];
 
-               MyMD5((char*)bytes, (void*)src, strlen(src), ikey);
+               MyMD5((char*)bytes, (void*)src, srclen, ikey);
 
                for (int i = 0; i < 16; i++)
                {
@@ -278,7 +278,7 @@ class ModuleMD5 : public Module
        }
 
        
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                HashRequest* MD5 = (HashRequest*)request;
 
@@ -293,7 +293,7 @@ class ModuleMD5 : public Module
                else if (strcmp("SUM", request->GetId()) == 0)
                {
                        static char data[MAXBUF];
-                       GenHash((const char*)MD5->GetHashData(), data, chars ? chars : "0123456789abcdef", key);
+                       GenHash(MD5->GetHashData().data(), data, chars ? chars : "0123456789abcdef", key, MD5->GetHashData().length());
                        return data;
                }
                else if (strcmp("NAME", request->GetId()) == 0)
@@ -310,7 +310,7 @@ class ModuleMD5 : public Module
 
        virtual Version GetVersion()
        {
-               return Version(1,1,0,1,VF_VENDOR|VF_SERVICEPROVIDER,API_VERSION);
+               return Version(1,2,0,1,VF_VENDOR|VF_SERVICEPROVIDER,API_VERSION);
        }
 };