This repository was archived by the owner on Jan 23, 2023. It is now read-only.
[release/2.1] Servicing SignedCms for Signed NuGet Packages#33463
Merged
bartonjs merged 3 commits intodotnet:release/2.1from Nov 15, 2018
Merged
[release/2.1] Servicing SignedCms for Signed NuGet Packages#33463bartonjs merged 3 commits intodotnet:release/2.1from
bartonjs merged 3 commits intodotnet:release/2.1from
Conversation
This enables processing documents which use the X.509 hybrid identifier (e.g. `sha256WithRSAEncryption`) instead of `rsaEncryption`.
…dCms SignedCms reads BER, because the spec says to, and writes DER, to provide better interop. If the incoming message used an indefinite length encoding for SignedData.encapContentInfo.eContent's ANY value the call to Encode will throw (as will any mutation operations which internally use Encode). With this change, if writing DER fails then assemble the output in pieces to leave the encapsulated content as-is while DER-normalizing the rest of the structure.
Member
|
@wtgodbe can you please verify the packaging changes. |
safern
reviewed
Nov 14, 2018
Member
Author
|
@dotnet-bot Test Windows x64 Debug Build please (network timeout) |
Member
Author
|
I seem to have won the lottery. @stephentoub is taking a look to see if he can reason about it; but it seems fairly unrelated to this change (and hadn't failed on the previous run) |
|
Approved for 2.1.7 and 2.2.1 |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backports of #32666 (registration for alternate RSA signature identifiers) and #32704 (indefinite-length encoded content) to release/2.1
Description
Windows CMS (and therefore .NET Framework) is more permissive on SignedCms content than the .NET Core implementation of SignedCms.
OIDs: The .NET Foundation has created Signed NuGet packages which validate on .NET Framework, but not .NET Core, as .NET Core does not recognize the signature algorithm identifier.
Encoding: The .NET Foundation has created Signed NuGet packages which cannot be countersigned by .NET Core.
Customer Impact
Customers will be unable to work with RSA-signed packages signed by the .NET Foundation using the X.509 signature algorithm identifier instead of the CMS algorithm identifier.
Packages signed by The .NET Foundation may decode correctly, but cannot be re-encoded.
Regression?
The OID entries are a behavioral regression from .NET Framework, but not a regression within .NET Core.
The indefinite-length encoding content issue was a regression from #30432 (which released in 2.1.5).
Packaging reviewed?
Packaging considered, reviewers tagged.
Risk
Low. Existing unit tests provide assurance that the formats written by .NET Core and .NET Framework still behave as expected, new unit tests guard against regressions from variants encountered from the signing service set up by The .NET Foundation based on Bouncy Castle.
Since both of these changes require the package harvesting manifest to be updated, the package index to be updated, the version of System.Security.Cryptography.Pkcs to be bumped, and System.Security.Cryptography.Pkcs to be registered for build/publish, they have been bundled into one change. They could be separated if desired.