aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-07-26 01:53:34 +0200
committerShauren <shauren.trinity@gmail.com>2020-08-03 19:39:00 +0200
commite9392ad28767626e519c463e2110184d71ba8426 (patch)
treeda391d7daf1ede4ef73883b5053520e160dc4ec4 /src/server/scripts/Commands
parentcaa1e1171a1ea4e2db754cfb52b3be795385d544 (diff)
Core/Authserver: Authserver cleanup (PR#25093)
- Fix a handful of 1/256 bugs with most significant byte zero in BigNumber - Get rid of (most of) the C-style arrays in authserver - CryptoRandom as a unified source for cryptographic randomness - Bring our other crypto APIs into 2020 - BigNumber usability improvements - Authserver is now actually readable as a result of all of the above (cherry picked from commit 210176fd915cf4ba16f428d3c1a249a71f4aa7a7)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_battlenet_account.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/server/scripts/Commands/cs_battlenet_account.cpp b/src/server/scripts/Commands/cs_battlenet_account.cpp
index a1166a6c3c9..fc7e8948382 100644
--- a/src/server/scripts/Commands/cs_battlenet_account.cpp
+++ b/src/server/scripts/Commands/cs_battlenet_account.cpp
@@ -17,8 +17,8 @@
#include "AccountMgr.h"
#include "BattlenetAccountMgr.h"
-#include "BigNumber.h"
#include "Chat.h"
+#include "CryptoRandom.h"
#include "DatabaseEnv.h"
#include "IpAddress.h"
#include "IPLocation.h"
@@ -425,10 +425,9 @@ public:
std::string accountName = std::to_string(accountId) + '#' + std::to_string(uint32(index));
// Generate random hex string for password, these accounts must not be logged on with GRUNT
- BigNumber randPassword;
- randPassword.SetRand(8 * 16);
+ std::array<uint8, 16> randPassword = Trinity::Crypto::GetRandomBytes<16>();
- switch (sAccountMgr->CreateAccount(accountName, ByteArrayToHexStr(randPassword.AsByteArray().get(), randPassword.GetNumBytes()), bnetAccountName, accountId, index))
+ switch (sAccountMgr->CreateAccount(accountName, ByteArrayToHexStr(randPassword), bnetAccountName, accountId, index))
{
case AccountOpResult::AOR_OK:
handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName.c_str());