G'day Oswald,

I noticed when building isync/mbsync on macOS, I get a wall of compiler
warnings about the use of deprecated interfaces.  Two of which regard
the use of the SecKeychain API.  This is the interface isync uses for
integration with the macOS keychain.

After looking online and in my computer's relevant header files, I found
that the SecKeychain API has been deprecated in favour of the SecItem
API.  Probably due to the latter's greater portability with other Apple
devices (iOS, tvOS, watchOS).[0][1]

This patch set aims to replace usage of the SecKeychain API with the
SecItem API, while retaining (mostly) the same program behaviour.
Patches 1-2 are simple refactorings to make the change easier, patch 3
rewrites the relevant logic, and patch 4 simplifies with some helper
functions.  After applying the patches, the corresponding deprecation
warnings are absent from compilation (at least on my computer).

The macOS keychain has file-based and data protection implementations.
The SecKeychain API can only use the file-based keychain, while the
SecItem API can use both implementations.  In order to not break
existing workflows, this patch set has isync still use the file-based
implementation.  Though if use of the data protection keychain is
wanted, some additional modifications will be needed.

I did my best at following the same coding style as the surrounding
code, but it is still possible I made some errors.  Particularly since I
noticed the codebase's style is sometimes inconsistent, so in those
cases I had to guess which style to use.  Let me know if there are any
such errors and I'll gladly fix them.

I should note that the use of the SecItem API does place a minimum macOS
version requirement on isync of macOS 10.6.  Though because this version
was released in August 2009 (~16.5 years ago), I don't think such a
requirement is unreasonable.

Also, because it's 2026, I should explicitly state that absolutely no AI
was used in the development of these patches.  All work and
contributions authored and submitted by myself are entirely AI-free
unless explicitly stated otherwise.

Thank you for your maintainership of the project!

Take care,
        Seth McDonald.

[0] 
<https://developer.apple.com/documentation/security/seckeychainfindinternetpassword(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)?language=objc>
[1] 
<https://developer.apple.com/documentation/technotes/tn3137-on-mac-keychains>


Seth McDonald (4):
  Remove excessive if nesting
  Segregate macOS-specific keychain code
  Remove use of deprecated SecKeychain API
  Add no-fail Core Foundation wrappers

 src/common.h   |   9 +++
 src/drv_imap.c | 154 ++++++++++++++++++++++++++++++++++---------------
 src/util.c     |  32 ++++++++++
 3 files changed, 147 insertions(+), 48 deletions(-)

Range-diff:
1:  73eee7269825 = 1:  73eee7269825 Remove excessive if nesting
2:  0bb1a1c2ad9f = 2:  0bb1a1c2ad9f Segregate macOS-specific keychain code
3:  3f19b9dca42d = 3:  3f19b9dca42d Remove use of deprecated SecKeychain API
4:  7d9c0b63d82d = 4:  7d9c0b63d82d Add no-fail Core Foundation wrappers

base-commit: 9aaac66286910f547ec3068d3fd72afb4fe716bf
-- 
2.50.1 (Apple Git-155)



_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to