From fe0ec420ebe3111598f1081c63c6dd4a2b18ff9e Mon Sep 17 00:00:00 2001 From: Chad Currie Date: Thu, 17 Feb 2022 22:42:41 +1300 Subject: [PATCH] Add using statements for IDisposables --- src/Umbraco.Core/Security/LegacyPasswordSecurity.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Security/LegacyPasswordSecurity.cs b/src/Umbraco.Core/Security/LegacyPasswordSecurity.cs index 8f6813e7ba..ca3045a4de 100644 --- a/src/Umbraco.Core/Security/LegacyPasswordSecurity.cs +++ b/src/Umbraco.Core/Security/LegacyPasswordSecurity.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Security.Cryptography; using System.Text; @@ -144,7 +144,7 @@ namespace Umbraco.Cms.Core.Security var saltBytes = Convert.FromBase64String(salt); byte[] inArray; - var hashAlgorithm = GetHashAlgorithm(algorithmType); + using var hashAlgorithm = GetHashAlgorithm(algorithmType); var algorithm = hashAlgorithm as KeyedHashAlgorithm; if (algorithm != null) { @@ -227,7 +227,7 @@ namespace Umbraco.Cms.Core.Security /// The encoded password. private string HashLegacySHA1Password(string password) { - var hashAlgorithm = GetLegacySHA1Algorithm(password); + using var hashAlgorithm = GetLegacySHA1Algorithm(password); var hash = Convert.ToBase64String(hashAlgorithm.ComputeHash(Encoding.Unicode.GetBytes(password))); return hash; }