Move to "protected" only (thanks @MarioE!)

This commit is contained in:
Lucas Nicodemus 2015-04-14 08:16:11 -06:00
parent c5034a23ad
commit 85661f3485

View file

@ -374,7 +374,7 @@ namespace TShockAPI.DB
/// <summary>Upgrades a password to BCrypt, from an insecure hashing algorithm.</summary> /// <summary>Upgrades a password to BCrypt, from an insecure hashing algorithm.</summary>
/// <param name="password">string password - the raw user password (unhashed) to upgrade</param> /// <param name="password">string password - the raw user password (unhashed) to upgrade</param>
protected internal void UpgradePasswordToBCrypt(string password) protected void UpgradePasswordToBCrypt(string password)
{ {
// Save the old password, in the event that we have to revert changes. // Save the old password, in the event that we have to revert changes.
string oldpassword = this.Password; string oldpassword = this.Password;
@ -403,7 +403,7 @@ namespace TShockAPI.DB
/// <summary>Upgrades a password to the highest work factor available in the config.</summary> /// <summary>Upgrades a password to the highest work factor available in the config.</summary>
/// <param name="password">string password - the raw user password (unhashed) to upgrade</param> /// <param name="password">string password - the raw user password (unhashed) to upgrade</param>
protected internal void UpgradePasswordWorkFactor(string password) protected void UpgradePasswordWorkFactor(string password)
{ {
// If the destination work factor is not greater, we won't upgrade it or re-hash it // If the destination work factor is not greater, we won't upgrade it or re-hash it
int currentWorkFactor = 0; int currentWorkFactor = 0;
@ -473,7 +473,7 @@ namespace TShockAPI.DB
/// <summary> /// <summary>
/// A dictionary of hashing algorithms and an implementation object. /// A dictionary of hashing algorithms and an implementation object.
/// </summary> /// </summary>
protected internal readonly Dictionary<string, Func<HashAlgorithm>> HashTypes = new Dictionary<string, Func<HashAlgorithm>> protected readonly Dictionary<string, Func<HashAlgorithm>> HashTypes = new Dictionary<string, Func<HashAlgorithm>>
{ {
{"sha512", () => new SHA512Managed()}, {"sha512", () => new SHA512Managed()},
{"sha256", () => new SHA256Managed()}, {"sha256", () => new SHA256Managed()},
@ -488,7 +488,7 @@ namespace TShockAPI.DB
/// </summary> /// </summary>
/// <param name="bytes">bytes to hash</param> /// <param name="bytes">bytes to hash</param>
/// <returns>string hash</returns> /// <returns>string hash</returns>
protected internal string HashPassword(byte[] bytes) protected string HashPassword(byte[] bytes)
{ {
if (bytes == null) if (bytes == null)
throw new NullReferenceException("bytes"); throw new NullReferenceException("bytes");
@ -508,7 +508,7 @@ namespace TShockAPI.DB
/// </summary> /// </summary>
/// <param name="password">string to hash</param> /// <param name="password">string to hash</param>
/// <returns>string hash</returns> /// <returns>string hash</returns>
protected internal string HashPassword(string password) protected string HashPassword(string password)
{ {
if (string.IsNullOrEmpty(password) || password == "non-existant password") if (string.IsNullOrEmpty(password) || password == "non-existant password")
return null; return null;