Added a flag to support unlocking the database with the apple watch as well as TouchID

This commit is contained in:
Julius Zint
2020-09-22 21:14:09 +02:00
parent 82558936da
commit 484b5e4acd

View File

@@ -175,9 +175,13 @@ static NSMutableDictionary* touchIDSecuredPasswords;
NSData* privateKeyTag = [@"com.hicknhacksoftware.macpass.privatekey" dataUsingEncoding:NSUTF8StringEncoding];
SecAccessControlRef access = NULL;
if (@available(macOS 10.13.4, *)) {
SecAccessControlCreateFlags flags = kSecAccessControlBiometryCurrentSet;
if (@available(macOS 10.15, *)) {
flags |= kSecAccessControlWatch | kSecAccessControlOr;
}
access = SecAccessControlCreateWithFlags(kCFAllocatorDefault,
kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
kSecAccessControlBiometryCurrentSet,
flags,
&error);
if(access == NULL) {
NSError *err = CFBridgingRelease(error);