summaryrefslogtreecommitdiff
path: root/src/net/accountserver/account.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/accountserver/account.cpp')
-rw-r--r--src/net/accountserver/account.cpp14
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);
}