From 68a82a8c659ac8e467f8a1d622cdcb7d5890c13a Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Mon, 29 Mar 2021 13:45:27 -0400 Subject: [PATCH] Fix unintended closure in RsaPaddingProcessor.OpenProcessor --- .../src/System/Security/Cryptography/RSACng.SignVerify.cs | 4 ++-- .../src/System/Security/Cryptography/RsaPaddingProcessor.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSACng.SignVerify.cs b/src/libraries/Common/src/System/Security/Cryptography/RSACng.SignVerify.cs index 7eaf3f9e9a6d3..82709832cd88d 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RSACng.SignVerify.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RSACng.SignVerify.cs @@ -32,9 +32,9 @@ private static int GetHashSizeInBytes(HashAlgorithmName hashAlgorithm) { return s_hashSizes.GetOrAdd( hashAlgorithm, - alg => + static hashAlgorithm => { - using (HashProviderCng hashProvider = new HashProviderCng(alg.Name!, null)) + using (HashProviderCng hashProvider = new HashProviderCng(hashAlgorithm.Name!, null)) { return hashProvider.HashSizeInBytes; } diff --git a/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs b/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs index 8ee516f1cf5ad..9538db1414322 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs @@ -74,7 +74,7 @@ internal static RsaPaddingProcessor OpenProcessor(HashAlgorithmName hashAlgorith { return s_lookup.GetOrAdd( hashAlgorithmName, - alg => + static hashAlgorithmName => { using (IncrementalHash hasher = IncrementalHash.CreateHash(hashAlgorithmName)) {