From cacdb57c9cd302e5d746e96cc37aa395564279c6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 23 Jan 2022 23:49:34 +0100 Subject: Core/Crypto: c++17-ify crypto code cherry picked earlier that was downgraded to c++14 --- src/server/scripts/Commands/cs_account.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 29cc59266d6..7ae7baa75ff 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 -#include using namespace Trinity::ChatCommands; @@ -131,7 +131,7 @@ public: static std::unordered_map 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 { -- cgit v1.2.3