Update VaultStore+Crypto.swift to disable OS-level PIN unlock fallback (#1562)
This commit is contained in:
committed by
Leendert de Borst
parent
d4d2a99b9c
commit
510b3c95d7
@@ -172,10 +172,12 @@ extension VaultStore {
|
||||
|
||||
/// Store the encryption key in the keychain
|
||||
internal func storeKeyInKeychain(_ keyData: Data) throws {
|
||||
// Use .biometryCurrentSet to require biometric authentication only (no passcode fallback)
|
||||
// This also invalidates the key when biometrics are added/removed.
|
||||
guard let accessControl = SecAccessControlCreateWithFlags(
|
||||
nil,
|
||||
kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly,
|
||||
[.userPresence],
|
||||
[.biometryCurrentSet],
|
||||
nil
|
||||
) else {
|
||||
throw NSError(domain: "VaultStore", code: 11, userInfo: [NSLocalizedDescriptionKey: "Failed to create access control"])
|
||||
|
||||
Reference in New Issue
Block a user