-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Obsolete unnecessary cryptographic derived types #46934
Comments
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq Issue DetailsBackground and MotivationMany of the cryptographic algorithms have an inheritance hierarchy to allow for distinct implementations to be used. For example, in .NET Framework In .NET (nee Core) these types are all always backed by a single native implementation (using Windows CNG, Apple Security.Framework, or OpenSSL (as appropriate)), so there's no reason to prefer any one type over another.
Notably, the .NET (nee Core) reference assemblies already has these types marked as All modern code should instantiate these algorithms via the Proposed APInamespace System.Security.Cryptography.Algorithms
{
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class AesCryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class AesManaged
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class DESCryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class MD5CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class RC2CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA1Managed
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA1CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA256Managed
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA256CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA384Managed
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA384CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA512Managed
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA512CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class TripleDESCryptoServiceProvider
{
}
}
|
Looks good as proposed. namespace System.Security.Cryptography.Algorithms
{
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class AesCryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class AesManaged
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class DESCryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class MD5CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class RC2CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA1Managed
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA1CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA256Managed
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA256CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA384Managed
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA384CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA512Managed
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class SHA512CryptoServiceProvider
{
}
+ [Obsolete(someID)]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class TripleDESCryptoServiceProvider
{
}
} |
Background and Motivation
Many of the cryptographic algorithms have an inheritance hierarchy to allow for distinct implementations to be used. For example, in .NET Framework
SHA256Managed
uses a fully managed implementation,SHA256CryptoServiceProvider
uses Windows CAPI, andSHA256Cng
uses Windows CNG.In .NET (nee Core) these types are all always backed by a single native implementation (using Windows CNG, Apple Security.Framework, or OpenSSL (as appropriate)), so there's no reason to prefer any one type over another.
Notably, the .NET (nee Core) reference assemblies already has these types marked as
[EditorBrowsable(Never)]
.All modern code should instantiate these algorithms via the
Create()
static method on the algorithm type (e.g.SHA256.Create()
) (except, as noted, for the persisted key use case for AesCng and TripleDESCng).Proposed API
The text was updated successfully, but these errors were encountered: