summaryrefslogtreecommitdiff
path: root/src/modules/m_cloaking.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-14 18:22:39 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-14 18:22:39 +0000
commitac002a195d35b12218b912d369570aad45c1839f (patch)
treec63f858d8cf3c740c33514a12d45d4db16e7b5ae /src/modules/m_cloaking.cpp
parentc84271be2e581bc50aa89ba2185a219cc8154ef0 (diff)
Verify cloak keys match during CAPAB negotiation
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12258 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_cloaking.cpp')
-rw-r--r--src/modules/m_cloaking.cpp20
1 files changed, 17 insertions, 3 deletions
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)