You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adding assembly level UnsupportedOSPlatform("browser") System.Security.Cryptography.Primitives is not correct, HashAlgorithm supported on browser #43380
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)
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.
Create(string name) should probably be marked but the code is written such that HashAlgorithm.Create(string name) could try to create a KeyedHashAlgorithm.
Activity
lewing commentedon Oct 14, 2020
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.
/cc @steveisok @marek-safar
kjpou1 commentedon Oct 14, 2020
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.
lewing commentedon Oct 14, 2020
@kjpou1 please review the primitive classes, especially where they are base classes, and correct the platform annotations.
kjpou1 commentedon Oct 14, 2020
This should be only needed to remove the os platform not supported. The classes are abstract and implemented in the other cryptography modules.
akoeplinger commentedon Oct 14, 2020
Shouldn't we still mark the static methods on some of these classes as unsupported that we know don't work:
lewing commentedon Oct 14, 2020
@akoeplinger that is an interesting question. Create() on all those classes is marked Obsolete and throw PNSE unconditionally on all platforms already
runtime/src/libraries/System.Security.Cryptography.Primitives/src/System/Security/Cryptography/AsymmetricAlgorithm.cs
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.