-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Suppress warnings for deprecated keychain APIs #77911
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
Conversation
Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones Issue DetailsI updated to Xcode 14.1 (14B47b) and started getting many warnings for deprecated Keychain APIs. The documentation indicates most of the APIs have been deprecated for a while. I don't know why I just started getting deprecation warnings for them. For example: https://developer.apple.com/documentation/security/1393109-seckeychainsetsettings?language=objc There may be APIs that replace these, but first I want to get it back to building.
|
I diffed the MacOSX.sdk included in XCode 14.0 and 14.1 and looks like they forgot to add the deprecation annotations for Mac before and fixed that now on all of the APIs: -OSStatus SecKeychainItemCopyKeychain(SecKeychainItemRef itemRef, SecKeychainRef * __nonnull CF_RETURNS_RETAINED keychainRef) API_UNAVAILABLE(ios, watchos, tvos, bridgeos, iosmac);
+OSStatus SecKeychainItemCopyKeychain(SecKeychainItemRef itemRef, SecKeychainRef * __nonnull CF_RETURNS_RETAINED keychainRef)
+API_DEPRECATED("SecKeychain is deprecated", macos(10.2, 10.10))
+API_UNAVAILABLE(ios, watchos, tvos, macCatalyst); |
Are there non-deprecated variants of those APIs? It seems it would be preferred to use those instead of disabling the warning. |
I started looking at this and... I don't think so unfortunately. Apple appears to be on the path of deprecating file-based keychains according to this thread. From about a year ago:
And further explained in this thread
There would need to be significant development work to get us off of custom keychains. We can open a separate issue to track this. |
@vcsjones thank you for the details! |
@akoeplinger @bartonjs I once again find myself wondering if this pull request should be back ported? Or is release/7.0 and release/6.0 on a permanent version of Xcode tooling? |
Yes we should backport it because we're using the AzDO hosted Mac pool so whenever they bump the Xcode version this will break. |
/backport to release/7.0 |
/backport to release/6.0 |
Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3397271626 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/3397272585 |
@vcsjones backporting to release/6.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Suppress warnings for deprecated keychain APIs
Using index info to reconstruct a base tree...
A src/native/libs/System.Security.Cryptography.Native.Apple/pal_keychain_macos.c
A src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_macos.c
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain_macos.c
CONFLICT (content): Merge conflict in src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain_macos.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Suppress warnings for deprecated keychain APIs
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@vcsjones an error occurred while backporting to release/6.0, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
I updated to Xcode 14.1 (14B47b) and started getting many warnings for deprecated Keychain APIs. The documentation indicates most of the APIs have been deprecated for a while. I don't know why I just started getting deprecation warnings for them. For example: https://developer.apple.com/documentation/security/1393109-seckeychainsetsettings?language=objc
There may be APIs that replace these, but first I want to get it back to building.
Closes #77907