aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2020-06-05 22:33:34 -0400
committerPatrick Barron <barronpm@gmail.com>2020-06-05 22:33:34 -0400
commitfa80f84f260b6313831b6eca87123f20b614ebff (patch)
tree9ea1292108757cf828f7264b9617c3740a5b6305 /Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs
parentbb23ce3466b4f21bc589f26204fbf07889b1b55a (diff)
parentbb828d54c59e9118f7477de8defde4316f5d4f42 (diff)
Merge branch 'userdb-efcore' of https://github.com/barronpm/jellyfin into userdb-efcore
Diffstat (limited to 'Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs')
-rw-r--r--Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs47
1 files changed, 0 insertions, 47 deletions
diff --git a/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs b/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs
index 4261f5b18..b0c02030e 100644
--- a/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs
+++ b/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs
@@ -135,52 +135,5 @@ namespace Jellyfin.Server.Implementations.Users
? null
: Hex.Encode(PasswordHash.Parse(user.EasyPassword).Hash);
}
-
- /// <summary>
- /// Hashes the provided string.
- /// </summary>
- /// <param name="user">The user.</param>
- /// <param name="str">The string to hash.</param>
- /// <returns>The hashed string.</returns>
- public string GetHashedString(User user, string str)
- {
- if (string.IsNullOrEmpty(user.Password))
- {
- return _cryptographyProvider.CreatePasswordHash(str).ToString();
- }
-
- // TODO: make use of iterations parameter?
- PasswordHash passwordHash = PasswordHash.Parse(user.Password);
- var salt = passwordHash.Salt.ToArray();
- return new PasswordHash(
- passwordHash.Id,
- _cryptographyProvider.ComputeHash(
- passwordHash.Id,
- Encoding.UTF8.GetBytes(str),
- salt),
- salt,
- passwordHash.Parameters.ToDictionary(x => x.Key, y => y.Value)).ToString();
- }
-
- /// <summary>
- /// Hashes the provided string.
- /// </summary>
- /// <param name="user">The user.</param>
- /// <param name="str">The string to hash.</param>
- /// <returns>The hashed string.</returns>
- public ReadOnlySpan<byte> GetHashed(User user, string str)
- {
- if (string.IsNullOrEmpty(user.Password))
- {
- return _cryptographyProvider.CreatePasswordHash(str).Hash;
- }
-
- // TODO: make use of iterations parameter?
- PasswordHash passwordHash = PasswordHash.Parse(user.Password);
- return _cryptographyProvider.ComputeHash(
- passwordHash.Id,
- Encoding.UTF8.GetBytes(str),
- passwordHash.Salt.ToArray());
- }
}
}