diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-04-23 09:17:52 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-04-23 09:17:52 +0000 |
commit | 6f2bd00100522615ff8a5dda1166a4b3312879d0 (patch) | |
tree | 35ed24bf2fcfe3340fba9b5b218a59cf3a8b6674 /src/net/accountserver/account.cpp | |
parent | ee6cd05382e4933bac8a6d6c007f112ac37a9f36 (diff) | |
download | mana-6f2bd00100522615ff8a5dda1166a4b3312879d0.tar.gz mana-6f2bd00100522615ff8a5dda1166a4b3312879d0.tar.bz2 mana-6f2bd00100522615ff8a5dda1166a4b3312879d0.tar.xz mana-6f2bd00100522615ff8a5dda1166a4b3312879d0.zip |
Replaced SHA-256 implementation with the one from InspIRCd. Thanks to Bertram
for initial modifications.
Diffstat (limited to 'src/net/accountserver/account.cpp')
-rw-r--r-- | src/net/accountserver/account.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/net/accountserver/account.cpp b/src/net/accountserver/account.cpp index bb0214d3..2d8065b5 100644 --- a/src/net/accountserver/account.cpp +++ b/src/net/accountserver/account.cpp @@ -24,7 +24,6 @@ #include "account.h" #include <string> -#include "../../utils/encryption.h" #include "internal.h" @@ -32,6 +31,8 @@ #include "../messageout.h" #include "../protocol.h" +#include "../../utils/sha256.h" + void Net::AccountServer::Account::createCharacter( const std::string &name, char hairStyle, char hairColor, char gender, short strength, short agility, short vitality, @@ -77,14 +78,13 @@ void Net::AccountServer::Account::unregister(const std::string &username, MessageOut msg(PAMSG_UNREGISTER); msg.writeString(username); - msg.writeString(Encryption::GetSHA2Hash( - std::string (username + password))); + msg.writeString(sha256(username + password)); Net::AccountServer::connection->send(msg); } void Net::AccountServer::Account::changeEmail(const std::string &username, - const std::string &email) + const std::string &email) { MessageOut msg(PAMSG_EMAIL_CHANGE); @@ -103,10 +103,8 @@ void Net::AccountServer::Account::changePassword( MessageOut msg(PAMSG_PASSWORD_CHANGE); // Change password using SHA2 encryption - msg.writeString(Encryption::GetSHA2Hash( - std::string (username + oldPassword))); - msg.writeString(Encryption::GetSHA2Hash( - std::string (username + newPassword))); + msg.writeString(sha256(username + oldPassword)); + msg.writeString(sha256(username + newPassword)); Net::AccountServer::connection->send(msg); } |