Skip to content

Commit 1fea1d3

Browse files
committed
CA5384 Asymmetric encryption algorithm DSA is weak. Switch to an RSA with at least 2048 key size, ECDH or ECDSA algorithm instead.
1 parent 7852153 commit 1fea1d3

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

src/Tasks/ManifestUtil/CngLightup.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ namespace System.Security.Cryptography
2929
{
3030
internal static partial class CngLightup
3131
{
32-
private const string DsaOid = "1.2.840.10040.4.1";
3332
private const string RsaOid = "1.2.840.113549.1.1.1";
3433

3534
private const string HashAlgorithmNameTypeName = "System.Security.Cryptography.HashAlgorithmName";
@@ -60,9 +59,6 @@ internal static partial class CngLightup
6059

6160
private static readonly Lazy<bool> s_preferRsaCng = new Lazy<bool>(DetectRsaCngSupport);
6261

63-
private static volatile Func<X509Certificate2, DSA> s_getDsaPublicKey;
64-
private static volatile Func<X509Certificate2, DSA> s_getDsaPrivateKey;
65-
6662
private static volatile Func<X509Certificate2, RSA> s_getRsaPublicKey;
6763
private static volatile Func<X509Certificate2, RSA> s_getRsaPrivateKey;
6864
private static volatile Func<RSA, byte[], string, byte[]> s_rsaPkcs1SignMethod;
@@ -115,30 +111,6 @@ internal static RSA GetRSAPrivateKey(X509Certificate2 cert)
115111
return s_getRsaPrivateKey(cert);
116112
}
117113

118-
internal static DSA GetDSAPublicKey(X509Certificate2 cert)
119-
{
120-
if (s_getDsaPublicKey == null)
121-
{
122-
s_getDsaPublicKey =
123-
BindCoreDelegate<DSA>("DSA", isPublic: true) ??
124-
BindGetCapiPublicKey<DSA, DSACryptoServiceProvider>(DsaOid);
125-
}
126-
127-
return s_getDsaPublicKey(cert);
128-
}
129-
130-
internal static DSA GetDSAPrivateKey(X509Certificate2 cert)
131-
{
132-
if (s_getDsaPrivateKey == null)
133-
{
134-
s_getDsaPrivateKey =
135-
BindCoreDelegate<DSA>("DSA", isPublic: false) ??
136-
BindGetCapiPrivateKey<DSA>(DsaOid, csp => new DSACryptoServiceProvider(csp));
137-
}
138-
139-
return s_getDsaPrivateKey(cert);
140-
}
141-
142114
#if !CNG_LIGHTUP_NO_SYSTEM_CORE
143115
internal static ECDsa GetECDsaPublicKey(X509Certificate2 cert)
144116
{

0 commit comments

Comments
 (0)