mirror of
https://github.com/anope/anope.git
synced 2026-06-30 04:56:38 +02:00
Removed OnEncryptInPlace, although it currently causes no problems it is just redundant.
This commit is contained in:
@@ -158,7 +158,6 @@ E void HostServSyncVhosts(NickAlias *na);
|
||||
|
||||
/**** encrypt.c ****/
|
||||
E int enc_encrypt(const std::string &src, std::string &dest);
|
||||
E int enc_encrypt_in_place(std::string &buf);
|
||||
E int enc_decrypt(const std::string &src, std::string &dest);
|
||||
E int enc_check_password(std::string &plaintext, std::string &password);
|
||||
|
||||
|
||||
+1
-2
@@ -439,7 +439,6 @@ class CoreExport Module
|
||||
* see src/encrypt.c for detailed informations
|
||||
*/
|
||||
virtual EventReturn OnEncrypt(const std::string &src, std::string &dest) { return EVENT_CONTINUE; }
|
||||
virtual EventReturn OnEncryptInPlace(std::string &buf) { return EVENT_CONTINUE; }
|
||||
virtual EventReturn OnDecrypt(const std::string &hashm, const std::string &src, std::string &dest) { return EVENT_CONTINUE; }
|
||||
virtual EventReturn OnCheckPassword(const std::string &hashm, std::string &plaintext, std::string &password) { return EVENT_CONTINUE; }
|
||||
|
||||
@@ -1106,7 +1105,7 @@ enum Implementation
|
||||
I_OnReload, I_OnPreServerConnect, I_OnNewServer, I_OnServerConnect, I_OnPreUplinkSync, I_OnServerDisconnect, I_OnPreCommandRun,
|
||||
I_OnPreCommand, I_OnPostCommand, I_OnPreDatabaseExpire, I_OnPreRestart, I_OnRestart, I_OnPreShutdown, I_OnShutdown, I_OnSignal,
|
||||
I_OnServerQuit, I_OnTopicUpdated,
|
||||
I_OnEncrypt, I_OnEncryptInPlace, I_OnEncryptCheckLen, I_OnDecrypt, I_OnCheckPassword,
|
||||
I_OnEncrypt, I_OnEncryptCheckLen, I_OnDecrypt, I_OnCheckPassword,
|
||||
I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd,
|
||||
I_OnMLock, I_OnUnMLock, I_OnServerSync, I_OnUplinkSync,
|
||||
I_END
|
||||
|
||||
@@ -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