Skip to content
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

Return DSA and ECDSA keys from certificate in SignedXml. #55294

Merged
merged 2 commits into from
Jul 8, 2021

Conversation

vcsjones
Copy link
Member

@vcsjones vcsjones commented Jul 7, 2021

If the X.509 certificate has a DSA or ECDSA public key, return them if they are available.

Closes #55194


I was able to add a test case for DSA, prior to the fix the test fails with:

 Error Message:
   System.ArgumentNullException : Value cannot be null. (Parameter 'key')
  Stack Trace:
     at System.Security.Cryptography.Xml.SignedXml.CheckSignedInfo(AsymmetricAlgorithm key) in /workspaces/runtime/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/SignedXml.cs:line 998
   at System.Security.Cryptography.Xml.SignedXml.CheckSignature(AsymmetricAlgorithm key) in /workspaces/runtime/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/SignedXml.cs:line 283

If the X.509 certificate has a DSA or ECDSA public key, return them if
they are available.
@ghost
Copy link

ghost commented Jul 7, 2021

Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks
See info in area-owners.md if you want to be subscribed.

Issue Details

If the X.509 certificate has a DSA or ECDSA public key, return them if they are available.

Closes #55194


I was able to add a test case for DSA, prior to the fix the test fails with:

 Error Message:
   System.ArgumentNullException : Value cannot be null. (Parameter 'key')
  Stack Trace:
     at System.Security.Cryptography.Xml.SignedXml.CheckSignedInfo(AsymmetricAlgorithm key) in /workspaces/runtime/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/SignedXml.cs:line 998
   at System.Security.Cryptography.Xml.SignedXml.CheckSignature(AsymmetricAlgorithm key) in /workspaces/runtime/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/SignedXml.cs:line 283
Author: vcsjones
Assignees: -
Labels:

area-System.Security

Milestone: -

@vcsjones
Copy link
Member Author

vcsjones commented Jul 7, 2021

My Windows box is currently sitting in pieces behind me for a few days, so waiting to see what CI says about .NET Framework before I mark as reviewable.

@vcsjones vcsjones changed the title Return DSA and ECDSA keys from certificate. Return DSA and ECDSA keys from certificate in SignedXml. Jul 7, 2021
Copy link
Member

@bartonjs bartonjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, provided CI agrees.

@vcsjones vcsjones marked this pull request as ready for review July 8, 2021 01:53
@vcsjones
Copy link
Member Author

vcsjones commented Jul 8, 2021

Considering the previous run was all green and the only thing that was added in the second commit is a comment, I would think the failures are unrelated.

@bartonjs bartonjs merged commit cbf4020 into dotnet:main Jul 8, 2021
@vcsjones vcsjones deleted the sxml-dsa-ecdsa branch July 8, 2021 16:52
@ghost ghost locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.Security.Cryptography.Xml.Utils.GetAnyPublicKey returns only RSA or null?
3 participants