From 39f78d8d4786807c79e2dfca60f6a5bb645d35f1 Mon Sep 17 00:00:00 2001 From: Braxton McCraw Date: Sat, 27 May 2017 11:13:25 -0400 Subject: [PATCH] Removing dead code in System.Security.Cryptography.Algorithms (#20076) * Sanity check - removed code up to internal static class Cng * Checkpoint CngKeyOpenOptions - build + test full * Fixing CI issue, some code not actually dead * Re-adding strings and methods that were needed for CI * Re-adding comment and more strings * Cleanup formatting per pr * More cleanup * 3rd pass cleaning up meaningless file changes * Spacing * Re-adding OSX and Unix strings --- .gitignore | 1 + src/Common/src/Interop/Windows/BCrypt/Cng.cs | 24 -------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 55bfda8b3e0b..4882fe708b39 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ syntax: glob *.sln.docstates # Build results +.idea/ [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ diff --git a/src/Common/src/Interop/Windows/BCrypt/Cng.cs b/src/Common/src/Interop/Windows/BCrypt/Cng.cs index 2831dca5774f..8b26b57047c3 100644 --- a/src/Common/src/Interop/Windows/BCrypt/Cng.cs +++ b/src/Common/src/Interop/Windows/BCrypt/Cng.cs @@ -35,18 +35,6 @@ internal static class AlgorithmName public const string Sha512 = "SHA512"; // BCRYPT_SHA512_ALGORITHM } - /// - /// Magic numbers identifying blob types - /// - internal enum KeyBlobMagicNumber { - ECDHPublicP256 = 0x314B4345, // BCRYPT_ECDH_PUBLIC_P256_MAGIC - ECDHPublicP384 = 0x334B4345, // BCRYPT_ECDH_PUBLIC_P384_MAGIC - ECDHPublicP521 = 0x354B4345, // BCRYPT_ECDH_PUBLIC_P521_MAGIC - ECDsaPublicP256 = 0x31534345, // BCRYPT_ECDSA_PUBLIC_P256_MAGIC - ECDsaPublicP384 = 0x33534345, // BCRYPT_ECDSA_PUBLIC_P384_MAGIC - ECDsaPublicP521 = 0x35534345 // BCRYPT_ECDSA_PUBLIC_P521_MAGIC - } - internal static class KeyDerivationFunction { public const string Hash = "HASH"; // BCRYPT_KDF_HASH @@ -303,18 +291,6 @@ protected sealed override bool ReleaseHandle() private static extern uint BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags); } - internal sealed class SafeHashHandle : SafeBCryptHandle - { - protected sealed override bool ReleaseHandle() - { - uint ntStatus = BCryptDestroyHash(handle); - return ntStatus == 0; - } - - [DllImport(Libraries.BCrypt)] - private static extern uint BCryptDestroyHash(IntPtr hHash); - } - internal sealed class SafeKeyHandle : SafeBCryptHandle { private SafeAlgorithmHandle _parentHandle = null;