[release/7.0] Fix SignedCms certificate collection modification with attribute certificates #80188
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.
Backport of #79940 and #80195 to release/7.0
/cc @vcsjones
Customer Impact
Reported by a partner for
dotnet/sign
at #79935. When usingSignedCms
with a CMS that contains an attribute certificate, such as an RFC3161 timestamp issued by Azure Codesigning, theAddCertificate
andRemoveCertificate
APIs would raise an exception when adding or removing an X.509 certificate because they did not know how to process the attribute certificate. The impact of this is that these two APIs cannot function in the presence of an attribute certificate.Testing
This introduces tests to validate behavior of a CMS that contains attribute certificates to prevent regressions.
Risk
Low. The changes are isolated and well understood.
IMPORTANT: Is this backport for a servicing release? Yes.