X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_md5.cpp;h=c902ee3cb753c8f9c527a0bfd3e381656261c766;hb=748b3a0d89e7ecc9a766471b79fb78f63a5ca2bb;hp=6b74dae2ee5f385ed72ddaa6e0ea8145e0d126e5;hpb=54fb0cd5aa7d090d5c3da5ab54988c86ba8a2e8e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_md5.cpp b/src/modules/m_md5.cpp index 6b74dae2e..c902ee3cb 100644 --- a/src/modules/m_md5.cpp +++ b/src/modules/m_md5.cpp @@ -1,24 +1,33 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2008 Pippijn van Steenhoven + * Copyright (C) 2007-2008 Robin Burchell + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2006 Craig Edwards * - * This program is free but copyrighted software; see - * the file COPYING for details. + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. * - * --------------------------------------------------- + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + /* $ModDesc: Allows for MD5 encrypted oper passwords */ -/* $ModDep: m_hash.h */ #include "inspircd.h" #ifdef HAS_STDINT #include #endif -#include "m_hash.h" +#include "hash.h" /* The four core functions - F1 is optimized somewhat */ #define F1(x, y, z) (z ^ (x & (y ^ z))) @@ -149,12 +158,12 @@ 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]) { - register word32 a, b, c, d; + word32 a, b, c, d; a = buf[0]; b = buf[1]; @@ -273,7 +282,7 @@ class MD5Provider : public HashProvider return res; } - MD5Provider(Module* parent) : HashProvider(parent, "hash/md5") {} + MD5Provider(Module* parent) : HashProvider(parent, "hash/md5", 16, 64) {} }; class ModuleMD5 : public Module