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

[release/8.0-staging] macOS: Set certificate as a dependency of private key handles #96993

Merged

Conversation

vcsjones
Copy link
Member

@vcsjones vcsjones commented Jan 15, 2024

Backport of #95924 and #96685 to release/8.0-staging

/cc @bartonjs

Customer Impact

Reported by multiple customers in #94959 and #95924 (comment). Customers that upgrade to .NET 8 from previous versions of .NET may receive an exception when attempting to use a private key from a certificate where the certificate has been disposed on macOS. The behavior contract of the key and certificate is that they have independent lifetimes and developers are not expected to keep the certificate alive for the duration of the private key.

Workarounds for the issue range from intrusive to not possible if the issue arises in a 3rd party library. This issue is impeding upgrades from .NET 6/7 to .NET 8.

Regression

Yes. #82205 made changes to reference lifetimes and commit 28f958d introduced the regression. We did not have unit tests asserting the independent lifetimes of the private key and the certificate.

Testing

New unit tests were introduced to prevent the fix from regressing; existing unit tests ensure existing scenarios continue to work.

Risk

Low and mitigated. This is a targeted change for macOS and the options for addressing the regression were discussed before making this fix.

@vcsjones vcsjones added this to the 8.0.x milestone Jan 15, 2024
@ghost
Copy link

ghost commented Jan 15, 2024

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #95924 and #96685 to release/8.0-staging

/cc @bartonjs

Customer Impact

Reported by multiple customers in #94959 and #95924 (comment). Customers that upgrade to .NET 8 from previous versions of .NET may receive an exception when attempting to use a private key from a certificate where the certificate has been disposed on macOS. The behavior contract of the key and certificate is that they have independent lifetimes and developers are not expected to key the certificate alive for the duration of the private key.

Workarounds for the issue range from intrusive to not possible if the issue arises in a 3rd party library.

Testing

New unit tests were introduced to prevent the fix from regressing; existing unit tests ensure existing scenarios continue to work.

Risk

Low.

Author: vcsjones
Assignees: -
Labels:

area-System.Security

Milestone: 8.0.x

@carlossanlop
Copy link
Member

@bartonjs @jeffhandley today is Code Complete for the Feb Release. Are we going to try to get it merged today or should we wait another month?

@jeffhandley jeffhandley added the Servicing-consider Issue for next servicing release review label Jan 16, 2024
@carlossanlop carlossanlop added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 17, 2024
@carlossanlop
Copy link
Member

Approved by Tactics via email.

@carlossanlop carlossanlop merged commit 96b0a55 into dotnet:release/8.0-staging Jan 17, 2024
109 of 115 checks passed
@vcsjones vcsjones deleted the backport-95924-96685 branch January 17, 2024 01:19
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Security Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants