summaryrefslogtreecommitdiff
path: root/modules/encryption/none.cpp
diff options
context:
space:
mode:
authorAdam <adam@sigterm.info>2016-09-13 17:46:12 -0400
committerGitHub <noreply@github.com>2016-09-13 17:46:12 -0400
commita6b14a9fb6afc5e16874ed7e4c0a135a4f5bfa53 (patch)
treedcb6ec77e491bfe3934bd171c66add711d199670 /modules/encryption/none.cpp
parentc4ebf02bce968e4846a0be72dfa7b104f21f5166 (diff)
parentae334addd024c11bb063704640d04cfd5f32bdce (diff)
Merge pull request #157 from SaberUK/master+require-encryption
Prevent using enc_none as the main encryption module.
Diffstat (limited to 'modules/encryption/none.cpp')
-rw-r--r--modules/encryption/none.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/modules/encryption/none.cpp b/modules/encryption/none.cpp
index 317abb132..3b1f49d33 100644
--- a/modules/encryption/none.cpp
+++ b/modules/encryption/none.cpp
@@ -21,16 +21,15 @@
class ENone : public Module
, public EventHook<Event::Encrypt>
- , public EventHook<Event::Decrypt>
, public EventHook<Event::CheckAuthentication>
{
public:
ENone(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR)
, EventHook<Event::Encrypt>(this)
- , EventHook<Event::Decrypt>(this)
, EventHook<Event::CheckAuthentication>(this)
{
-
+ if (ModuleManager::FindFirstOf(ENCRYPTION) == this)
+ throw ModuleException("enc_none is deprecated and can not be used as a primary encryption method");
}
EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) override
@@ -44,16 +43,6 @@ class ENone : public Module
return EVENT_ALLOW;
}
- EventReturn OnDecrypt(const Anope::string &hashm, const Anope::string &src, Anope::string &dest) override
- {
- if (!hashm.equals_cs("plain"))
- return EVENT_CONTINUE;
- size_t pos = src.find(':');
- Anope::string buf = src.substr(pos + 1);
- Anope::B64Decode(buf, dest);
- return EVENT_ALLOW;
- }
-
void OnCheckAuthentication(User *, NickServ::IdentifyRequest *req) override
{
NickServ::Nick *na = NickServ::FindNick(req->GetAccount());