Skip to content

Commit

Permalink
Removing dead code in System.Security.Cryptography.Algorithms (dotnet…
Browse files Browse the repository at this point in the history
…#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
  • Loading branch information
mccbraxton authored and stephentoub committed May 27, 2017
1 parent 5df3fbb commit 39f78d8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ syntax: glob
*.sln.docstates

# Build results
.idea/
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
Expand Down
24 changes: 0 additions & 24 deletions src/Common/src/Interop/Windows/BCrypt/Cng.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,6 @@ internal static class AlgorithmName
public const string Sha512 = "SHA512"; // BCRYPT_SHA512_ALGORITHM
}

/// <summary>
/// Magic numbers identifying blob types
/// </summary>
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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 39f78d8

Please sign in to comment.