Changed the settings getting functions to accept a fll key path instead of only a Section / Key pair. Changed the placement of the pepper in the password hashing function to be in complicance with the OWASP's recommendation for using a pwpper.
This commit is contained in:
@@ -27,13 +27,13 @@ namespace SecureCore
|
||||
catch { return false; }
|
||||
}
|
||||
|
||||
public static bool TryGetSettingString(string sectionName, string key, out string setting)
|
||||
public static bool TryGetSettingString(string keyPath, out string setting)
|
||||
{
|
||||
setting = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
var token = Settings.SelectToken($"{sectionName}.{key}");
|
||||
var token = Settings.SelectToken(keyPath);
|
||||
|
||||
if (token == null) return false;
|
||||
|
||||
@@ -45,13 +45,13 @@ namespace SecureCore
|
||||
catch { return false; }
|
||||
}
|
||||
|
||||
public static bool TryGetSettingInt(string sectionName, string key, out int setting)
|
||||
public static bool TryGetSettingInt(string keyPath, out int setting)
|
||||
{
|
||||
setting = 0;
|
||||
|
||||
try
|
||||
{
|
||||
var token = Settings.SelectToken($"{sectionName}.{key}");
|
||||
var token = Settings.SelectToken(keyPath);
|
||||
|
||||
if (token == null) return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user