Skip to content

Commit

Permalink
Ensure keychain items are accessible after the device was unlocked (#99)
Browse files Browse the repository at this point in the history
By setting `kSecAttrAccessibleAfterFirstUnlock` when writing keychain items, these should be readable even after the device is locked due to lock screen etc.
  • Loading branch information
kuhnroyal authored Nov 15, 2024
1 parent 178cdd6 commit e6bcb76
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct AddKeyQuery: KeychainQuery {
if let accessGroup {
query[kSecAttrAccessGroup as String] = accessGroup
}
query[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlock
return query as CFDictionary
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct AddPasswordQuery: KeychainQuery {
if let accessGroup {
query[kSecAttrAccessGroup as String] = accessGroup
}
query[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlock
return query as CFDictionary
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ struct UpdatePasswordQuery: KeychainQuery {
var rawQuery: CFDictionary {
var query: [String: Any] = [:]
query[kSecValueData as String] = password
query[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlock
return query as CFDictionary
}
}
2 changes: 1 addition & 1 deletion xcconfigs/General.xcconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GENERATE_INFOPLIST_FILE = YES
CURRENT_PROJECT_VERSION = 1
MARKETING_VERSION = 0.10.1
MARKETING_VERSION = 0.10.2
DEVELOPMENT_TEAM = 566MC7D8D4
CODE_SIGN_STYLE = Automatic
CODE_SIGN_ENTITLEMENTS = Tartelet/Supporting files/Tartelet.entitlements
Expand Down

0 comments on commit e6bcb76

Please sign in to comment.