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:
2021-03-29 19:15:15 -05:00
parent 9b283b31f4
commit f5ee2f68b9
5 changed files with 25 additions and 12 deletions
+4 -4
View File
@@ -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;