-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
DSAKeyValue in S.S.Cryptography.Xml should key for null on _key
#75048
Comments
Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones Issue DetailsIt has a public setter ( Originally posted by @krwq in #67198 (comment)
|
The All four can add in argument validation, but we shouldn't do DSA (fairly unused) without RSA (99%+ usage), and on either type we shouldn't do the ctor or property setter without the other. |
@bartonjs we explicitly test that runtime/src/libraries/System.Security.Cryptography.Xml/tests/RSAKeyValueTest.cs Lines 37 to 42 in a94f6ca
I can't think of a good reason for this, and I am not sure if the tests exists because we want to make sure the test keeps working, or if the test was just thrown in there to test current behavior. |
I assume it was just a standard "pass null, record the results" with the intent that changing the behavior is intentional. In days of yore, Not that we'd do xmldsig today (because... yeah), but if we did it today I don't think we'd make the key have a setter at all... and there'd just be a ctor for a current key instance and one for importing. I'm also happy to just say "it is what it is" and close the issue. CryptoXml isn't really an area where we expect new development. |
It's an easy enough change and it would make the nullability annotations that will (hopefully) get merged soon make more sense. I looked through all public repos in GitHub and don't see a single instance of |
It has a public setter (
Key
) which doesn't check for null. InGetXml
, it is used without checking for null, potentially resulting in an NRE.Originally posted by @krwq in #67198 (comment)
The text was updated successfully, but these errors were encountered: