aboutsummaryrefslogtreecommitdiff
path: root/src/server/database/Database/Field.h
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-08-02 22:52:21 +0200
committerGitHub <noreply@github.com>2020-08-02 22:52:21 +0200
commit3164b58c7d170810b69378950c0891e5f5b8678b (patch)
tree893d675ab6fcfd71c294a8922f337f063836e9ce /src/server/database/Database/Field.h
parent10f49793f9a7cd67c7b8b203290d7ea5f1829795 (diff)
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)
Diffstat (limited to 'src/server/database/Database/Field.h')
-rw-r--r--src/server/database/Database/Field.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/server/database/Database/Field.h b/src/server/database/Database/Field.h
index ea7c82d1876..dcb03344031 100644
--- a/src/server/database/Database/Field.h
+++ b/src/server/database/Database/Field.h
@@ -20,6 +20,7 @@
#include "Define.h"
#include "DatabaseEnvFwd.h"
+#include <array>
#include <vector>
enum class DatabaseFieldTypes : uint8
@@ -104,6 +105,14 @@ class TC_DATABASE_API Field
char const* GetCString() const;
std::string GetString() const;
std::vector<uint8> GetBinary() const;
+ template <size_t S>
+ std::array<uint8, S> GetBinary() const
+ {
+ std::array<uint8, S> buf;
+ GetBinarySizeChecked(buf.data(), S);
+ return buf;
+ }
+
bool IsNull() const
{
@@ -129,6 +138,8 @@ class TC_DATABASE_API Field
QueryResultFieldMetadata const* meta;
void LogWrongType(char const* getter) const;
void SetMetadata(QueryResultFieldMetadata const* fieldMeta);
+
+ void GetBinarySizeChecked(uint8* buf, size_t size) const;
};
#endif