Keychain: Enable correct keychain sharing in macOS
To enable sharing of keychain items using access groups in macOS, the kSecUseDataProtectionKeychain attribute should be set. This key has effect only in macOS, and is unavailable in iOS 12, so we set it only in macOS.
This commit is contained in:
parent
123f4d658e
commit
433e3f8dc9
|
@ -320,6 +320,9 @@ public class Keychain {
|
|||
private func setScope(query: inout [String: Any], context: String?) {
|
||||
if let accessGroup = accessGroup {
|
||||
query[kSecAttrAccessGroup as String] = accessGroup
|
||||
#if os(macOS)
|
||||
query[kSecUseDataProtectionKeychain as String] = true
|
||||
#endif
|
||||
}
|
||||
if let context = context {
|
||||
query[kSecAttrService as String] = context
|
||||
|
|
Loading…
Reference in New Issue