aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Cryptography/PasswordHash.cs
diff options
context:
space:
mode:
authorAnthony Lavado <anthonylavado@users.noreply.github.com>2019-08-28 09:38:12 -0400
committerGitHub <noreply@github.com>2019-08-28 09:38:12 -0400
commita2fd82137c2b587552399ae6a690f91c47b25ad4 (patch)
tree611299b11f232966baf0e46b064e66b83c8b48de /MediaBrowser.Model/Cryptography/PasswordHash.cs
parent874f02631b9be1cd51dafe9df15c5660f1e0e575 (diff)
parentefc4805233fe8a42215198db0baa0f68e012c1f8 (diff)
Merge pull request #1676 from Bond-009/login
Fix login
Diffstat (limited to 'MediaBrowser.Model/Cryptography/PasswordHash.cs')
-rw-r--r--MediaBrowser.Model/Cryptography/PasswordHash.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/MediaBrowser.Model/Cryptography/PasswordHash.cs b/MediaBrowser.Model/Cryptography/PasswordHash.cs
index 4bcf0c117..6e66f2088 100644
--- a/MediaBrowser.Model/Cryptography/PasswordHash.cs
+++ b/MediaBrowser.Model/Cryptography/PasswordHash.cs
@@ -69,6 +69,13 @@ namespace MediaBrowser.Model.Cryptography
}
}
+ public PasswordHash(ICryptoProvider cryptoProvider)
+ {
+ _id = cryptoProvider.DefaultHashMethod;
+ _salt = cryptoProvider.GenerateSalt();
+ _hash = Array.Empty<Byte>();
+ }
+
public string Id { get => _id; set => _id = value; }
public Dictionary<string, string> Parameters { get => _parameters; set => _parameters = value; }
@@ -77,13 +84,6 @@ namespace MediaBrowser.Model.Cryptography
public byte[] Hash { get => _hash; set => _hash = value; }
- public PasswordHash(ICryptoProvider cryptoProvider)
- {
- _id = cryptoProvider.DefaultHashMethod;
- _salt = cryptoProvider.GenerateSalt();
- _hash = Array.Empty<Byte>();
- }
-
// TODO: move this class and use the HexHelper class
public static byte[] ConvertFromByteString(string byteString)
{
@@ -127,7 +127,7 @@ namespace MediaBrowser.Model.Cryptography
str.Append(_id);
SerializeParameters(str);
- if (_salt.Length == 0)
+ if (_salt.Length != 0)
{
str.Append('$');
str.Append(ConvertToByteString(_salt));