From 1f690440d03d6ca090f1db13d03c20726a9ea6ba Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Mon, 13 Apr 2015 12:46:10 -0600 Subject: [PATCH] Change errors in BCrypt to be more clear for users to fix Change doc verbiage to refer to what these actually do --- TShockAPI/DB/UserManager.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/TShockAPI/DB/UserManager.cs b/TShockAPI/DB/UserManager.cs index d897ab18..4d4388c4 100755 --- a/TShockAPI/DB/UserManager.cs +++ b/TShockAPI/DB/UserManager.cs @@ -376,7 +376,7 @@ namespace TShockAPI.DB try { this.Password = BCrypt.Net.BCrypt.HashPassword(password, TShock.Config.BCryptWorkFactor); } catch (ArgumentOutOfRangeException) { - TShock.Log.ConsoleError("Invalid BCrypt work factor! Upgrading user password to BCrypt using default work factor."); + TShock.Log.ConsoleError("Invalid BCrypt work factor in config file! Upgrading user password to BCrypt using default work factor."); this.Password = BCrypt.Net.BCrypt.HashPassword(password); } @@ -398,7 +398,7 @@ namespace TShockAPI.DB try { this.Password = BCrypt.Net.BCrypt.HashPassword(password, TShock.Config.BCryptWorkFactor); } catch (ArgumentOutOfRangeException) { - TShock.Log.ConsoleError("Invalid BCrypt work factor! Refusing to change work-factor on exsting password."); + TShock.Log.ConsoleError("Invalid BCrypt work factor in config file! Refusing to change work-factor on exsting password."); } try { @@ -415,7 +415,7 @@ namespace TShockAPI.DB try { this.Password = BCrypt.Net.BCrypt.HashPassword(password, TShock.Config.BCryptWorkFactor); } catch (ArgumentOutOfRangeException) { - TShock.Log.ConsoleError("Invalid BCrypt work factor! Creating new hash using default work factor."); + TShock.Log.ConsoleError("Invalid BCrypt work factor in config file! Creating new hash using default work factor."); this.Password = BCrypt.Net.BCrypt.HashPassword(password); } } @@ -434,10 +434,10 @@ namespace TShockAPI.DB }; /// - /// Returns a Sha256 string for a given string + /// Returns a hashed string for a given string based on the config file's hash algo /// /// bytes to hash - /// string sha256 + /// string hash internal string hashPassword(byte[] bytes) { if (bytes == null) @@ -454,10 +454,10 @@ namespace TShockAPI.DB } /// - /// Returns a hashed password string for a given string + /// Returns a hashed string for a given string based on the config file's hash algo /// /// string to hash - /// string sha256 + /// string hash internal string hashPassword(string password) { if (string.IsNullOrEmpty(password) || password == "non-existant password")