diff options
Diffstat (limited to 'modules/encryption/enc_old.cpp')
-rw-r--r-- | modules/encryption/enc_old.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/encryption/enc_old.cpp b/modules/encryption/enc_old.cpp index beab76d15..9f051cf91 100644 --- a/modules/encryption/enc_old.cpp +++ b/modules/encryption/enc_old.cpp @@ -19,14 +19,14 @@ class OldMD5Provider : public Encryption::Provider public: OldMD5Provider(Module *creator) : Encryption::Provider(creator, "oldmd5") { } - Encryption::Context *CreateContext(Encryption::IV *iv) anope_override + Encryption::Context *CreateContext(Encryption::IV *iv) override { if (md5) return md5->CreateContext(iv); return NULL; } - Encryption::IV GetDefaultIV() anope_override + Encryption::IV GetDefaultIV() override { if (md5) return md5->GetDefaultIV(); @@ -44,6 +44,8 @@ class EOld : public Module EOld(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR), oldmd5provider(this) { + if (ModuleManager::FindFirstOf(ENCRYPTION) == this) + throw ModuleException("enc_old is deprecated and can not be used as a primary encryption method"); ModuleManager::LoadModule("enc_md5", User::Find(creator, true)); if (!md5) @@ -51,7 +53,7 @@ class EOld : public Module } - EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) anope_override + EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) override { if (!md5) return EVENT_CONTINUE; @@ -79,7 +81,7 @@ class EOld : public Module return EVENT_ALLOW; } - void OnCheckAuthentication(User *, IdentifyRequest *req) anope_override + void OnCheckAuthentication(User *, IdentifyRequest *req) override { const NickAlias *na = NickAlias::Find(req->GetAccount()); if (na == NULL) |