summaryrefslogtreecommitdiff
path: root/modules/encryption/enc_sha256.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-10-07 22:39:58 -0400
committerAdam <Adam@anope.org>2012-10-07 22:39:58 -0400
commitb8b63ff115f0daddf479b0da507a2f731255a06d (patch)
treed6b82bf0dfc39fdfe6a6a23ba318bb0c2906d6c1 /modules/encryption/enc_sha256.cpp
parent0a111c19764ed14ab5f724c78d9dd8c08a3c124f (diff)
Remove the asynchronous identifing hack and replace it with something better. Fixes m_*_authentication only being able to properly work when people identify normally using nickserv/identify
Diffstat (limited to 'modules/encryption/enc_sha256.cpp')
-rw-r--r--modules/encryption/enc_sha256.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/modules/encryption/enc_sha256.cpp b/modules/encryption/enc_sha256.cpp
index cee21b01d..36eaa98fc 100644
--- a/modules/encryption/enc_sha256.cpp
+++ b/modules/encryption/enc_sha256.cpp
@@ -278,24 +278,24 @@ class ESHA256 : public Module
return EVENT_ALLOW;
}
- EventReturn OnCheckAuthentication(Command *c, CommandSource *source, const std::vector<Anope::string> &params, const Anope::string &account, const Anope::string &password) anope_override
+ void OnCheckAuthentication(User *, IdentifyRequest *req) anope_override
{
- const NickAlias *na = findnick(account);
+ const NickAlias *na = findnick(req->GetAccount());
if (na == NULL)
- return EVENT_CONTINUE;
+ return;
NickCore *nc = na->nc;
size_t pos = nc->pass.find(':');
if (pos == Anope::string::npos)
- return EVENT_CONTINUE;
+ return;
Anope::string hash_method(nc->pass.begin(), nc->pass.begin() + pos);
if (!hash_method.equals_cs("sha256"))
- return EVENT_CONTINUE;
+ return;
GetIVFromPass(nc->pass);
use_iv = true;
Anope::string buf;
- this->OnEncrypt(password, buf);
+ this->OnEncrypt(req->GetPassword(), buf);
if (nc->pass.equals_cs(buf))
{
@@ -303,11 +303,9 @@ class ESHA256 : public Module
* we want to re-encrypt the pass with the new encryption
*/
if (ModuleManager::FindFirstOf(ENCRYPTION) != this)
- enc_encrypt(password, nc->pass);
- return EVENT_ALLOW;
+ enc_encrypt(req->GetPassword(), nc->pass);
+ req->Success(this);
}
-
- return EVENT_CONTINUE;
}
};