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
This commit is contained in:
Jamil
2025-01-15 12:27:23 -08:00
committed by GitHub
parent 854436b1a0
commit 81615dfef8

View File

@@ -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)