aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-07-26 01:53:34 +0200
committerGitHub <noreply@github.com>2020-07-26 01:53:34 +0200
commit210176fd915cf4ba16f428d3c1a249a71f4aa7a7 (patch)
tree6998a19da1330be8679fe3e760f858915494400b /src/server/scripts
parentcdaf890af4b5bb7ce256752b49bba2c0f3ed9264 (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
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_account.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 9b87179aa7d..aec025e0301 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -27,6 +27,7 @@ EndScriptData */
#include "Base32.h"
#include "Chat.h"
#include "CryptoGenerics.h"
+#include "CryptoRandom.h"
#include "DatabaseEnv.h"
#include "IpAddress.h"
#include "IPLocation.h"
@@ -39,7 +40,6 @@ EndScriptData */
#include "World.h"
#include "WorldSession.h"
#include <unordered_map>
-#include <openssl/rand.h>
using namespace Trinity::ChatCommands;
@@ -131,7 +131,7 @@ public:
static std::unordered_map<uint32, Trinity::Crypto::TOTP::Secret> suggestions;
auto pair = suggestions.emplace(std::piecewise_construct, std::make_tuple(accountId), std::make_tuple(Trinity::Crypto::TOTP::RECOMMENDED_SECRET_LENGTH)); // std::vector 1-argument size_t constructor invokes resize
if (pair.second) // no suggestion yet, generate random secret
- RAND_bytes(pair.first->second.data(), pair.first->second.size());
+ Trinity::Crypto::GetRandomBytes(pair.first->second);
if (!pair.second && token) // suggestion already existed and token specified - validate
{