-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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/9.0] Fix copying ephemeral keys to keychains #106993
Conversation
Starting on macOS Sequoia, at least in beta, SecKeychainitemCopyKeychain no longer returns errSecNoSuchKeychain for ephemeral keys. Instead, it returns errSecInvalidItemRef. This adds the error code in the handling logic for when we need to add an ephemeral key to the target keychain.
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones |
@vcsjones can you update the description for these backports |
Tagging @artl93 for review (and merge) into release/9.0. This reacts to macOS Sequoia changing behavior; our existing unit tests were failing on the platform so no new tests were needed. Once this is reviewed and merged into release/9.0, we will send [release/8.0-staging] Fix copying ephemeral keys to keychains (#107041) and [release/6.0-staging] Fix copying ephemeral keys to keychains (#107046) to Tactics for servicing consideration. |
Backport of #106973 to release/9.0
/cc @lewing @vcsjones @bartonjs
Customer Impact
Reported by multiple customers in #106775.
Customers that use
X509Certificate2.CopyWithPrivateKey
will get aCryptographicException
on macOS Sequoia, which is currently in beta. This breaks some key development scenarios, likeCertificateRequest
, which is used by ASP.NET for configuring local development HTTPS certificates.This is due to Apple changing the behavior of one of their APIs to return a different error code. The change is to handle the new error code, in addition to the old one.
Regression
Testing
Existing unit tests failed on the new macOS version. The tests now pass on macOS Sequoia.
Risk
Low. This adds an extra condition to an error handling path that already existed.
IMPORTANT: If this backport is for a servicing release, please verify that:
The PR target branch is
release/X.0-staging
, notrelease/X.0
.If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.