Skip to content

Commit e6bcb76

Browse files
authored
Ensure keychain items are accessible after the device was unlocked (#99)
By setting `kSecAttrAccessibleAfterFirstUnlock` when writing keychain items, these should be readable even after the device is locked due to lock screen etc.
1 parent 178cdd6 commit e6bcb76

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

Packages/Keychain/Sources/Keychain/Internal/Queries/AddKeyQuery.swift

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ struct AddKeyQuery: KeychainQuery {
1313
if let accessGroup {
1414
query[kSecAttrAccessGroup as String] = accessGroup
1515
}
16+
query[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlock
1617
return query as CFDictionary
1718
}
1819
}

Packages/Keychain/Sources/Keychain/Internal/Queries/AddPasswordQuery.swift

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ struct AddPasswordQuery: KeychainQuery {
1515
if let accessGroup {
1616
query[kSecAttrAccessGroup as String] = accessGroup
1717
}
18+
query[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlock
1819
return query as CFDictionary
1920
}
2021
}

Packages/Keychain/Sources/Keychain/Internal/Queries/UpdatePasswordQuery.swift

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ struct UpdatePasswordQuery: KeychainQuery {
66
var rawQuery: CFDictionary {
77
var query: [String: Any] = [:]
88
query[kSecValueData as String] = password
9+
query[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlock
910
return query as CFDictionary
1011
}
1112
}

xcconfigs/General.xcconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GENERATE_INFOPLIST_FILE = YES
22
CURRENT_PROJECT_VERSION = 1
3-
MARKETING_VERSION = 0.10.1
3+
MARKETING_VERSION = 0.10.2
44
DEVELOPMENT_TEAM = 566MC7D8D4
55
CODE_SIGN_STYLE = Automatic
66
CODE_SIGN_ENTITLEMENTS = Tartelet/Supporting files/Tartelet.entitlements

0 commit comments

Comments
 (0)