From 3164b58c7d170810b69378950c0891e5f5b8678b Mon Sep 17 00:00:00 2001 From: Treeston Date: Sun, 2 Aug 2020 22:52:21 +0200 Subject: Core/Authserver: Re-organize the `accounts` table (PR #25135) - no longer use sha_pass_hash for anything else core-side (.account, SOAP, RA) - salt/verifier/session_key are now binary - old s/v/sha_pass_hash fields kept around for backwards compatibility - sha_pass_hash is still updated (for now), s/v are not - sha_pass_hash is only read if s/v have been manually changed - SRP6 b now uses the full 32 bytes of randomness (instead of randomly only using 19) --- src/server/database/Database/Field.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/server/database/Database/Field.cpp') diff --git a/src/server/database/Database/Field.cpp b/src/server/database/Database/Field.cpp index f891bfd22b9..b9d25b3da1b 100644 --- a/src/server/database/Database/Field.cpp +++ b/src/server/database/Database/Field.cpp @@ -16,6 +16,7 @@ */ #include "Field.h" +#include "Errors.h" #include "Log.h" #include "MySQLHacks.h" @@ -247,6 +248,12 @@ std::vector Field::GetBinary() const return result; } +void Field::GetBinarySizeChecked(uint8* buf, size_t length) const +{ + ASSERT(data.value && (data.length == length), "Expected %zu-byte binary blob, got %sdata (%u bytes) instead", length, data.value ? "" : "no ", data.length); + memcpy(buf, data.value, length); +} + void Field::SetByteValue(char const* newValue, uint32 length) { // This value stores raw bytes that have to be explicitly cast later -- cgit v1.2.3