mirror of
https://github.com/anope/anope.git
synced 2026-07-07 15:03:14 +02:00
Removed OnEncryptInPlace, although it currently causes no problems it is just redundant.
This commit is contained in:
@@ -321,7 +321,6 @@ class EMD5 : public Module
|
||||
this->SetType(ENCRYPTION);
|
||||
|
||||
ModuleManager::Attach(I_OnEncrypt, this);
|
||||
ModuleManager::Attach(I_OnEncryptInPlace, this);
|
||||
ModuleManager::Attach(I_OnDecrypt, this);
|
||||
ModuleManager::Attach(I_OnCheckPassword, this);
|
||||
}
|
||||
@@ -345,11 +344,6 @@ class EMD5 : public Module
|
||||
return EVENT_ALLOW;
|
||||
}
|
||||
|
||||
EventReturn OnEncryptInPlace(std::string &buf)
|
||||
{
|
||||
return this->OnEncrypt(buf, buf);
|
||||
}
|
||||
|
||||
EventReturn OnDecrypt(const std::string &hashm, const std::string &src, std::string &dest)
|
||||
{
|
||||
if (hashm != "md5")
|
||||
|
||||
@@ -18,7 +18,6 @@ class ENone : public Module
|
||||
this->SetType(ENCRYPTION);
|
||||
|
||||
ModuleManager::Attach(I_OnEncrypt, this);
|
||||
ModuleManager::Attach(I_OnEncryptInPlace, this);
|
||||
ModuleManager::Attach(I_OnDecrypt, this);
|
||||
ModuleManager::Attach(I_OnCheckPassword, this);
|
||||
}
|
||||
@@ -34,11 +33,6 @@ class ENone : public Module
|
||||
return EVENT_ALLOW;
|
||||
}
|
||||
|
||||
EventReturn OnEncryptInPlace(std::string &buf)
|
||||
{
|
||||
return this->OnEncrypt(buf, buf);
|
||||
}
|
||||
|
||||
EventReturn OnDecrypt(const std::string &hashm, const std::string &src, std::string &dest)
|
||||
{
|
||||
if (hashm != "plain")
|
||||
|
||||
@@ -326,7 +326,6 @@ class EOld : public Module
|
||||
this->SetType(ENCRYPTION);
|
||||
|
||||
ModuleManager::Attach(I_OnEncrypt, this);
|
||||
ModuleManager::Attach(I_OnEncryptInPlace, this);
|
||||
ModuleManager::Attach(I_OnDecrypt, this);
|
||||
ModuleManager::Attach(I_OnCheckPassword, this);
|
||||
}
|
||||
@@ -353,11 +352,6 @@ class EOld : public Module
|
||||
return EVENT_ALLOW;
|
||||
}
|
||||
|
||||
EventReturn OnEncryptInPlace(std::string &buf)
|
||||
{
|
||||
return this->OnEncrypt(buf, buf);
|
||||
}
|
||||
|
||||
EventReturn OnDecrypt(const std::string &hashm, const std::string &src, std::string &dest )
|
||||
{
|
||||
if (hashm != "oldmd5")
|
||||
|
||||
@@ -174,7 +174,6 @@ class ESHA1 : public Module
|
||||
this->SetType(ENCRYPTION);
|
||||
|
||||
ModuleManager::Attach(I_OnEncrypt, this);
|
||||
ModuleManager::Attach(I_OnEncryptInPlace, this);
|
||||
ModuleManager::Attach(I_OnEncryptCheckLen, this);
|
||||
ModuleManager::Attach(I_OnDecrypt, this);
|
||||
ModuleManager::Attach(I_OnCheckPassword, this);
|
||||
@@ -201,11 +200,6 @@ class ESHA1 : public Module
|
||||
return EVENT_ALLOW;
|
||||
}
|
||||
|
||||
EventReturn OnEncryptInPlace(std::string &buf)
|
||||
{
|
||||
return this->OnEncrypt(buf, buf);
|
||||
}
|
||||
|
||||
EventReturn OnDecrypt(const std::string &hashm, std::string &src, std::string &dest)
|
||||
{
|
||||
if (hashm != "sha1")
|
||||
|
||||
@@ -254,7 +254,6 @@ class ESHA256 : public Module
|
||||
this->SetType(ENCRYPTION);
|
||||
|
||||
ModuleManager::Attach(I_OnEncrypt, this);
|
||||
ModuleManager::Attach(I_OnEncryptInPlace, this);
|
||||
ModuleManager::Attach(I_OnDecrypt, this);
|
||||
ModuleManager::Attach(I_OnCheckPassword, this);
|
||||
|
||||
@@ -284,11 +283,6 @@ class ESHA256 : public Module
|
||||
return EVENT_ALLOW;
|
||||
}
|
||||
|
||||
EventReturn OnEncryptInPlace(std::string &buf)
|
||||
{
|
||||
return this->OnEncrypt(buf, buf);
|
||||
}
|
||||
|
||||
EventReturn OnDecrypt(const std::string &hashm, std::string &src, std::string &dest)
|
||||
{
|
||||
if (hashm != "sha256")
|
||||
|
||||
@@ -270,8 +270,7 @@ class CommandNSRegister : public CommandNSConfirm
|
||||
passcode[idx] = '\0';
|
||||
nr = new NickRequest(u->nick);
|
||||
nr->passcode = passcode;
|
||||
nr->password = pass;
|
||||
enc_encrypt_in_place(nr->password);
|
||||
enc_encrypt(pass, nr->password);
|
||||
if (email)
|
||||
nr->email = sstrdup(email);
|
||||
nr->requested = time(NULL);
|
||||
|
||||
@@ -27,20 +27,6 @@ int enc_encrypt(const std::string &src, std::string &dest)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypt null-terminated string stored in buffer `buf' of size `size',
|
||||
* placing the result in the same buffer. Returns 0 on success, -1 on
|
||||
* error.
|
||||
**/
|
||||
int enc_encrypt_in_place(std::string &buf)
|
||||
{
|
||||
EventReturn MOD_RESULT;
|
||||
FOREACH_RESULT(I_OnEncryptInPlace, OnEncryptInPlace(buf));
|
||||
if (MOD_RESULT == EVENT_ALLOW)
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrypt encrypted string `src' into buffer `dest' of length `len'.
|
||||
* Returns 1 (not 0) on success, -1 if the encryption algorithm does not
|
||||
|
||||
Reference in New Issue
Block a user