diff options
author | Adam <Adam@anope.org> | 2010-07-05 16:14:17 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-07-05 16:14:17 -0400 |
commit | f71d5b4d3ae2fc5db3f2e96c1cc3cceb1a103c2e (patch) | |
tree | 52f20f6d8c4e281a63018616a8ede9422f650cae /src | |
parent | de1bf10690570477f5d8cd126b30f81300c1376a (diff) |
Removed OnEncryptInPlace, although it currently causes no problems it is just redundant.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/enc_md5.cpp | 6 | ||||
-rw-r--r-- | src/core/enc_none.cpp | 6 | ||||
-rw-r--r-- | src/core/enc_old.cpp | 6 | ||||
-rw-r--r-- | src/core/enc_sha1.cpp | 6 | ||||
-rw-r--r-- | src/core/enc_sha256.cpp | 6 | ||||
-rw-r--r-- | src/core/ns_register.cpp | 3 | ||||
-rw-r--r-- | src/encrypt.cpp | 14 |
7 files changed, 1 insertions, 46 deletions
diff --git a/src/core/enc_md5.cpp b/src/core/enc_md5.cpp index 5644cf869..fafb79309 100644 --- a/src/core/enc_md5.cpp +++ b/src/core/enc_md5.cpp @@ -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") diff --git a/src/core/enc_none.cpp b/src/core/enc_none.cpp index 9e618baed..58ccdaff1 100644 --- a/src/core/enc_none.cpp +++ b/src/core/enc_none.cpp @@ -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") diff --git a/src/core/enc_old.cpp b/src/core/enc_old.cpp index af4613699..a53115628 100644 --- a/src/core/enc_old.cpp +++ b/src/core/enc_old.cpp @@ -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") diff --git a/src/core/enc_sha1.cpp b/src/core/enc_sha1.cpp index 180a8b58d..b986d6938 100644 --- a/src/core/enc_sha1.cpp +++ b/src/core/enc_sha1.cpp @@ -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") diff --git a/src/core/enc_sha256.cpp b/src/core/enc_sha256.cpp index bef38fb1d..fde7cf14c 100644 --- a/src/core/enc_sha256.cpp +++ b/src/core/enc_sha256.cpp @@ -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") diff --git a/src/core/ns_register.cpp b/src/core/ns_register.cpp index 3579df173..3fba0407e 100644 --- a/src/core/ns_register.cpp +++ b/src/core/ns_register.cpp @@ -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); diff --git a/src/encrypt.cpp b/src/encrypt.cpp index 1910c00f9..f70d8fa8c 100644 --- a/src/encrypt.cpp +++ b/src/encrypt.cpp @@ -28,20 +28,6 @@ int enc_encrypt(const std::string &src, std::string &dest) } /** - * 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 * allow decryption, and -1 if another failure occurred (e.g. destination |