X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_md5.cpp;h=dd72fe9eacb42e700585940406af843f71c0a26c;hb=e950f568d0f571e9475aa38177486468714de4d3;hp=f8f13dcbcefd9629d0e1d53b503913f59e0b37d9;hpb=44f42a13de52c8025942ddab42f51feb36821782;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_md5.cpp b/src/modules/m_md5.cpp index f8f13dcbc..dd72fe9ea 100644 --- a/src/modules/m_md5.cpp +++ b/src/modules/m_md5.cpp @@ -21,13 +21,8 @@ */ -/* $ModDesc: Allows for MD5 encrypted oper passwords */ - #include "inspircd.h" -#ifdef HAS_STDINT -#include -#endif -#include "hash.h" +#include "modules/hash.h" /* The four core functions - F1 is optimized somewhat */ #define F1(x, y, z) (z ^ (x & (y ^ z))) @@ -39,10 +34,6 @@ #define MD5STEP(f,w,x,y,z,in,s) \ (w += f(x,y,z) + in, w = (w<>(32-s)) + x) -#ifndef HAS_STDINT -typedef unsigned int uint32_t; -#endif - typedef uint32_t word32; /* NOT unsigned long. We don't support 16 bit platforms, anyway. */ typedef unsigned char byte; @@ -158,7 +149,7 @@ class MD5Provider : public HashProvider byteSwap(ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); + memset(ctx, 0, sizeof(*ctx)); } void MD5Transform(word32 buf[4], word32 const in[16]) @@ -275,13 +266,6 @@ class MD5Provider : public HashProvider return std::string(res, 16); } - std::string sumIV(unsigned int* IV, const char* HexMap, const std::string &sdata) - { - char res[33]; - GenHash(sdata.data(), res, HexMap, IV, sdata.length()); - return res; - } - MD5Provider(Module* parent) : HashProvider(parent, "hash/md5", 16, 64) {} }; @@ -294,7 +278,7 @@ class ModuleMD5 : public Module ServerInstance->Modules->AddService(md5); } - Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Implements MD5 hashing",VF_VENDOR); }