Log if the server is using a md5 cloak as their primary method.

This commit is contained in:
Sadie Powell 2024-09-05 13:25:46 +01:00
parent 1f65eb8efc
commit 4579bc5524

View File

@ -302,8 +302,14 @@ public:
throw ModuleException(creator, "You have not defined a cloaking key. Define <cloak:key> as a " + ConvToStr(minkeylen) + "+ character network-wide secret, at " + tag->source.str());
// If we are the first cloak method then mandate a strong key.
if (primary && key.length() < minkeylen)
throw ModuleException(creator, "Your cloaking key is not secure. It should be at least " + ConvToStr(minkeylen) + " characters long, at " + tag->source.str());
if (primary)
{
if (key.length() < minkeylen)
throw ModuleException(creator, "Your cloaking key is not secure. It should be at least " + ConvToStr(minkeylen) + " characters long, at " + tag->source.str());
ServerInstance->Logs.Normal(MODNAME, "The {} cloak method is deprecated and will be removed in the next major version of InspIRCd. Consider migrating to cloak_sha256 instead. See " INSPIRCD_DOCS "modules/cloak_md5 for more information.",
name.c_str() + 6);
}
return std::make_shared<CloakInfo>(this, tag, mode, key);
}