Store encrypted company password hashes in server saves
Restore when loading back into the server if server has required secret
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
|
||||
[pre-amble]
|
||||
static bool ReplaceAsteriskWithEmptyPassword(std::string &newval);
|
||||
static bool IsValidHex128BitKeyString(std::string &newval);
|
||||
static bool IsValidHex256BitKeyString(std::string &newval);
|
||||
static void ParseCompanyPasswordStorageToken(const std::string &value);
|
||||
static void ParseCompanyPasswordStorageSecret(const std::string &value);
|
||||
|
||||
static const SettingTable _network_secrets_settings = {
|
||||
[post-amble]
|
||||
@@ -99,3 +103,23 @@ type = SLE_STR
|
||||
length = NETWORK_INVITE_CODE_SECRET_LENGTH
|
||||
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_NETWORK_ONLY
|
||||
def = nullptr
|
||||
|
||||
[SDTC_SSTR]
|
||||
var = network.company_password_storage_token
|
||||
type = SLE_STR
|
||||
length = 33
|
||||
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_NETWORK_ONLY | SF_RUN_CALLBACKS_ON_PARSE
|
||||
def = nullptr
|
||||
pre_cb = IsValidHex128BitKeyString
|
||||
post_cb = ParseCompanyPasswordStorageToken
|
||||
startup = true
|
||||
|
||||
[SDTC_SSTR]
|
||||
var = network.company_password_storage_secret
|
||||
type = SLE_STR
|
||||
length = 65
|
||||
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_NETWORK_ONLY | SF_RUN_CALLBACKS_ON_PARSE
|
||||
def = nullptr
|
||||
pre_cb = IsValidHex256BitKeyString
|
||||
post_cb = ParseCompanyPasswordStorageSecret
|
||||
startup = true
|
||||
|
||||
Reference in New Issue
Block a user