From 81615dfef8a31d8052ab9f50fe4d67ce656f4220 Mon Sep 17 00:00:00 2001 From: Jamil Date: Wed, 15 Jan 2025 12:27:23 -0800 Subject: [PATCH] Revert "refactor(apple): Use `kSecUseDataProtectionKeychain` for token" (#7765) After reading through this [Apple technical note](https://developer.apple.com/documentation/technotes/tn3137-on-mac-keychains), it's clear that we want to actually omit this key from our keychain queries. The reason is because: - on iOS, this will be already set (there is no other option) - on macOS, the data protection keychain is *unavailable* from system extensions After testing, it appears that the original issue that PR sought to fix was actually fixed by always installing the correct system extension version: #7759. Reverts firezone/firezone#7756 --- .../FirezoneKit/Sources/FirezoneKit/Models/Token.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/swift/apple/FirezoneKit/Sources/FirezoneKit/Models/Token.swift b/swift/apple/FirezoneKit/Sources/FirezoneKit/Models/Token.swift index e95aec3da..b4d528098 100644 --- a/swift/apple/FirezoneKit/Sources/FirezoneKit/Models/Token.swift +++ b/swift/apple/FirezoneKit/Sources/FirezoneKit/Models/Token.swift @@ -49,17 +49,13 @@ public struct Token: CustomStringConvertible { return try Keychain.update( query: query, - attributesToUpdate: [ - kSecValueData: data, - kSecUseDataProtectionKeychain: true - ] + attributesToUpdate: [kSecValueData: data] ) } let query = Token.query.merging([ kSecClass: kSecClassGenericPassword, - kSecValueData: data, - kSecUseDataProtectionKeychain: true + kSecValueData: data ]) { (_, new) in new } try Keychain.add(query: query)