Remove unused methods
This commit is contained in:
parent
585fdbad39
commit
bb828d54c5
|
@ -135,52 +135,5 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
? null
|
? null
|
||||||
: Hex.Encode(PasswordHash.Parse(user.EasyPassword).Hash);
|
: 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());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Jellyfin.Data.Enums;
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Model.Configuration;
|
|
||||||
using AccessSchedule = Jellyfin.Data.Entities.AccessSchedule;
|
using AccessSchedule = Jellyfin.Data.Entities.AccessSchedule;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Users
|
namespace MediaBrowser.Model.Users
|
||||||
|
|
Loading…
Reference in New Issue
Block a user