diff options
| author | Shauren <shauren.trinity@gmail.com> | 2022-01-23 23:49:34 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-01-23 23:49:34 +0100 |
| commit | cacdb57c9cd302e5d746e96cc37aa395564279c6 (patch) | |
| tree | b734f2dd66916dc1841f86e432c22499507a5626 /src/server/scripts | |
| parent | 5f5d32888ac97b24b46a9c2d08f028583faaa911 (diff) | |
Core/Crypto: c++17-ify crypto code cherry picked earlier that was downgraded to c++14
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Commands/cs_account.cpp | 4 |
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 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 <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 { |
