diff --git a/Continuity.AuthServer/PacketHandlers/LoginHandler.cs b/Continuity.AuthServer/PacketHandlers/LoginHandler.cs index 142970f..75c8bc9 100644 --- a/Continuity.AuthServer/PacketHandlers/LoginHandler.cs +++ b/Continuity.AuthServer/PacketHandlers/LoginHandler.cs @@ -86,14 +86,12 @@ public class LoginHandler : IPacketHandler using var activity = _activitySource.StartActivity(); // https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Chea1t_Sheet.html#argon2id // "Use Argon2id with a minimum configuration of 19 MiB of memory, an iteration count of 2, and 1 degree of parallelism." - var argon2Id = new Argon2id(Encoding.ASCII.GetBytes(password)) - { - MemorySize = 1024 * 19, - Iterations = 2, - DegreeOfParallelism = 1, - Salt = salt, - AssociatedData = userId.ToByteArray() - }; + using var argon2Id = new Argon2id(Encoding.ASCII.GetBytes(password)); + argon2Id.MemorySize = 1024 * 19; + argon2Id.Iterations = 2; + argon2Id.DegreeOfParallelism = 1; + argon2Id.Salt = salt; + argon2Id.AssociatedData = userId.ToByteArray(); return await argon2Id.GetBytesAsync(16); }