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

macOS build of Heimdal uses deprecated SecKeychainFindGenericPassword API #1168

Closed
riastradh opened this issue Jun 21, 2023 · 5 comments · Fixed by #1170
Closed

macOS build of Heimdal uses deprecated SecKeychainFindGenericPassword API #1168

riastradh opened this issue Jun 21, 2023 · 5 comments · Fixed by #1170

Comments

@riastradh
Copy link

Describe the bug

/Users/runner/work/heimdal/heimdal/kuser/kinit.c:795:10: error: 'SecKeychainFindGenericPassword' is deprecated: first deprecated in macOS 10.10 - SecKeychain is deprecated [-Werror,-Wdeprecated-declarations]
        osret = SecKeychainFindGenericPassword(NULL, strlen(realm), realm,
                ^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:628:10: note: 'SecKeychainFindGenericPassword' has been explicitly marked deprecated here
OSStatus SecKeychainFindGenericPassword(CFTypeRef __nullable keychainOrArray,  UInt32 serviceNameLength, const char * __nullable serviceName, UInt32 accountNameLength, const char * __nullable accountName, UInt32 * __nullable passwordLength, void * __nullable * __nullable passwordData, SecKeychainItemRef * __nullable CF_RETURNS_RETAINED itemRef)
         ^
1 error generated.

To Reproduce
submit any pull request to Heimdal

Expected behavior
macOS build passes (or, more generally, GitHub Actions succeed on pull request when the PR works)

Additional context
It looks like Apple wants things to use some kind of SecItem API, according to some random web searching and a cursory glance at this documentation: https://developer.apple.com/documentation/security/keychain_services/keychain_items

Here is another project that appears to have switched from SecKeychainFindGenericPassword to the SecItem API, which may be helpful for comparison, although it has a lot of extra goop in Python FFI wrappers:

jaraco/keyring#522

@riastradh
Copy link
Author

riastradh commented Jun 21, 2023

I also looked for Apple's version of Heimdal, but what I could find at https://github.com/apple-opensource/Heimdal hasn't been updated in two years and still has the same SecKeychainFindGenericPassword:

https://github.com/apple-opensource/Heimdal/blob/9fed6a5818d85a439310b43727dd299366b397c2/kuser/kinit.c#L423-L425

And I don't see anything newer than 597.140.2 at https://opensource.apple.com/source/Heimdal.

@abartlet
Copy link
Member

abartlet commented Jun 21, 2023 via email

@nicowilliams
Copy link
Contributor

I took a look a few days ago at how to fix this, but I ran out of time and energy. I'm tempted to disable deprecation warnings for now.

@abartlet
Copy link
Member

abartlet commented Jun 21, 2023 via email

@nicowilliams
Copy link
Contributor

Just in that file.

riastradh pushed a commit to riastradh/heimdal that referenced this issue Jun 21, 2023
Tested on macOS Venture 13.4.  Not sure if this requires some
compatibility ifdefs for older macOS.

fix heimdal#1168
nicowilliams pushed a commit that referenced this issue Jun 21, 2023
Tested on macOS Venture 13.4.  Not sure if this requires some
compatibility ifdefs for older macOS.

fix #1168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants