-
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
Adding assembly level UnsupportedOSPlatform("browser") System.Security.Cryptography.Primitives is not correct, HashAlgorithm supported on browser #43380
Comments
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @jeffhandley |
HashAlgorithm and HashAlgorithmName are currently marked as unsupported on browser but are available for use. Absent a compelling reason I don't think we should annotate the other primitives that don't include any implementation as unsupported either. |
From my understanding of the Primitives they are there for use of the other Cryptography modules without specific implementations so can be available for use as well. |
@kjpou1 please review the primitive classes, especially where they are base classes, and correct the platform annotations. |
This should be only needed to remove the os platform not supported. The classes are abstract and implemented in the other cryptography modules. |
Shouldn't we still mark the static methods on some of these classes as unsupported that we know don't work: namespace System.Security.Cryptography
{
public abstract partial class AsymmetricAlgorithm : System.IDisposable
{
public static System.Security.Cryptography.AsymmetricAlgorithm Create() { throw null; }
public static System.Security.Cryptography.AsymmetricAlgorithm? Create(string algName) { throw null; }
}
public abstract partial class HMAC : System.Security.Cryptography.KeyedHashAlgorithm
{
public static new System.Security.Cryptography.HMAC Create() { throw null; }
public static new System.Security.Cryptography.HMAC? Create(string algorithmName) { throw null; }
}
public abstract partial class KeyedHashAlgorithm : System.Security.Cryptography.HashAlgorithm
{
public static new System.Security.Cryptography.KeyedHashAlgorithm Create() { throw null; }
public static new System.Security.Cryptography.KeyedHashAlgorithm? Create(string algName) { throw null; }
}
public abstract partial class SymmetricAlgorithm : System.IDisposable
{
public static System.Security.Cryptography.SymmetricAlgorithm Create() { throw null; }
public static System.Security.Cryptography.SymmetricAlgorithm? Create(string algName) { throw null; }
}
} |
@akoeplinger that is an interesting question. Create() on all those classes is marked Obsolete and throw PNSE unconditionally on all platforms already Line 17 in 2ca0b93
Create(string name) should probably be marked but the code is written such that HashAlgorithm.Create(string name) could try to create a KeyedHashAlgorithm. |
Adding assembly level UnsupportedOSPlatform("browser") System.Security.Cryptography.Primitives is not correct, HashAlgorithm and HashAlgorithmName supported on browser cc @jeffhandley
The issue appears to be that we are generating the attribute for all of System.Security.Cryptography.Primitives which is not correct.
Originally posted by @lewing in #43363 (comment)The text was updated successfully, but these errors were encountered: