summaryrefslogtreecommitdiff
path: root/src/encrypt.cpp
diff options
context:
space:
mode:
authorNaram Qashat <cyberbotx@cyberbotx.com>2010-07-25 21:58:20 -0400
committerNaram Qashat <cyberbotx@cyberbotx.com>2010-07-25 21:58:20 -0400
commitae38212c1ce829c783edf971081c90137abb49a0 (patch)
tree5c652d9cdc38103dec6fa112d57fca882b4e3e44 /src/encrypt.cpp
parent15d7f0f6fe8bb903275f603f734c13f65f3aa906 (diff)
Epic commit to replace most of the strings in Anope with a single Anope::string class, plus some other little fixes here and there. If you follow 1.9.x development and are testing things, THIS is one of those things that NEEDS testing.
Diffstat (limited to 'src/encrypt.cpp')
-rw-r--r--src/encrypt.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/encrypt.cpp b/src/encrypt.cpp
index f70d8fa8c..0121c0c4a 100644
--- a/src/encrypt.cpp
+++ b/src/encrypt.cpp
@@ -18,7 +18,7 @@
* Encrypt string `src' of length `len', placing the result in buffer
* `dest' of size `size'. Returns 0 on success, -1 on error.
**/
-int enc_encrypt(const std::string &src, std::string &dest)
+int enc_encrypt(const Anope::string &src, Anope::string &dest)
{
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnEncrypt, OnEncrypt(src, dest));
@@ -33,15 +33,15 @@ int enc_encrypt(const std::string &src, std::string &dest)
* allow decryption, and -1 if another failure occurred (e.g. destination
* buffer too small).
**/
-int enc_decrypt(const std::string &src, std::string &dest)
+int enc_decrypt(const Anope::string &src, Anope::string &dest)
{
- size_t pos = src.find(":");
- if (pos == std::string::npos)
+ size_t pos = src.find(':');
+ if (pos == Anope::string::npos)
{
Alog() << "Error: enc_decrypt() called with invalid password string (" << src << ")";
return -1;
}
- std::string hashm(src.begin(), src.begin() + pos);
+ Anope::string hashm(src.begin(), src.begin() + pos);
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnDecrypt, OnDecrypt(hashm, src, dest));
@@ -57,16 +57,15 @@ int enc_decrypt(const std::string &src, std::string &dest)
* 0 if the password does not match
* 0 if an error occurred while checking
**/
-int enc_check_password(std::string &plaintext, std::string &password)
+int enc_check_password(Anope::string &plaintext, Anope::string &password)
{
- std::string hashm;
- size_t pos = password.find(":");
- if (pos == std::string::npos)
+ size_t pos = password.find(':');
+ if (pos == Anope::string::npos)
{
Alog() << "Error: enc_check_password() called with invalid password string (" << password << ")";
return 0;
}
- hashm.assign(password.begin(), password.begin() + pos);
+ Anope::string hashm(password.begin(), password.begin() + pos);
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnCheckPassword, OnCheckPassword(hashm, plaintext, password));