-
Notifications
You must be signed in to change notification settings - Fork 1.4k
CA5384 Asymmetric encryption algorithm DSA is weak. Switch to an RSA … #7234
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is called via reflection, and I don't think it should be removed. I think we should not enable this rule, because I don't understand the compatibility implications of removing support for this style of signing at build time.
msbuild/src/Tasks/ManifestUtil/CngLightup.cs
Lines 520 to 530 in 1fea1d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh bummer, I thought we could get away with it because it wasn't referenced anywhere and it was not a public API.
The code you linked is a private function, it is called via GetDSAPublicKey/GetDSAPrivateKey:
msbuild/src/Tasks/ManifestUtil/CngLightup.cs
Lines 118 to 140 in 14efa06
The above methods call BindCoreDelegate is using reflection to call System.Security.Cryptography.X509Certificates.DSACertificateExtensions.GetDSAPublicKey/GetDSAPrivateKey
Additionally, CngLightup is only used when
RUNTIME_TYPE_NETCORE=false.The only public exposed functions I see that end up calling CNGLightup are in src/Tasks/ManifestUtil/SecurityUtil.cs
All calls end up in:
msbuild/src/Tasks/ManifestUtil/SecurityUtil.cs
Line 599 in 14efa06
If the file being signed is a portable executable it will use
signtool.exeviaSignPEFileInternal, if it isn't it will then call GetRSAPrivateKey and throw anOnlyRSACertsAreAllowederror if its null.msbuild/src/Tasks/ManifestUtil/SecurityUtil.cs
Lines 625 to 637 in 14efa06
There is then the file header comment, which I think might mean this file is pulled in externally somewhere?:
msbuild/src/Tasks/ManifestUtil/CngLightup.cs
Lines 14 to 17 in 518c041