mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
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 210176fd91)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "Session.h"
|
||||
#include "BattlenetRpcErrorCodes.h"
|
||||
#include "ByteConverter.h"
|
||||
#include "CryptoRandom.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Errors.h"
|
||||
#include "IPLocation.h"
|
||||
@@ -386,9 +387,8 @@ uint32 Battlenet::Session::VerifyWebCredentials(std::string const& webCredential
|
||||
if (!_ipCountry.empty())
|
||||
logonResult.set_geoip_country(_ipCountry);
|
||||
|
||||
BigNumber k;
|
||||
k.SetRand(8 * 64);
|
||||
logonResult.set_session_key(k.AsByteArray(64).get(), 64);
|
||||
std::array<uint8, 64> k = Trinity::Crypto::GetRandomBytes<64>();
|
||||
logonResult.set_session_key(k.data(), 64);
|
||||
|
||||
_authed = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user