From ac002a195d35b12218b912d369570aad45c1839f Mon Sep 17 00:00:00 2001 From: danieldg Date: Thu, 14 Jan 2010 18:22:39 +0000 Subject: Verify cloak keys match during CAPAB negotiation git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12258 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_cloaking.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/modules/m_cloaking.cpp') diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 1f9854a78..22114c54e 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -332,9 +332,23 @@ class ModuleCloaking : public Module Version GetVersion() { - // returns the version number of the module to be - // listed in /MODULES - return Version("Provides masking of user hostnames", VF_COMMON|VF_VENDOR); + std::string testcloak; + switch (mode) + { + case MODE_COMPAT_HOST: + testcloak = prefix + "-" + Hash->sumIV(compatkey, xtab[0], "*").substr(0,10); + break; + case MODE_COMPAT_IPONLY: + testcloak = Hash->sumIV(compatkey, xtab[0], "*").substr(0,10); + break; + case MODE_HALF_CLOAK: + testcloak = prefix + SegmentCloak("*", 3); + break; + case MODE_OPAQUE: + default: + testcloak = prefix + SegmentCloak("*", 4); + } + return Version("Provides masking of user hostnames", VF_COMMON|VF_VENDOR, testcloak); } void OnRehash(User* user) -- cgit v1.2.3