mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-26 00:05:34 -04:00
Fix compilation on macOS < 12.0.1
Used methods for touchID on macOS require macOS >= 12.0.1
This commit is contained in:
parent
c33995e075
commit
01b15fbeba
1 changed files with 8 additions and 0 deletions
|
@ -105,10 +105,12 @@ bool TouchID::storeKey(const QString& databasePath, const QByteArray& passwordKe
|
||||||
&error);
|
&error);
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101201
|
||||||
sacObject = SecAccessControlCreateWithFlags(kCFAllocatorDefault,
|
sacObject = SecAccessControlCreateWithFlags(kCFAllocatorDefault,
|
||||||
kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
|
kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
|
||||||
kSecAccessControlTouchIDCurrentSet, // depr: kSecAccessControlBiometryCurrentSet,
|
kSecAccessControlTouchIDCurrentSet, // depr: kSecAccessControlBiometryCurrentSet,
|
||||||
&error);
|
&error);
|
||||||
|
#endif
|
||||||
#if __clang_major__ >= 9 && MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
|
#if __clang_major__ >= 9 && MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -236,6 +238,9 @@ bool TouchID::containsKey(const QString& dbPath) const
|
||||||
*/
|
*/
|
||||||
bool TouchID::isAvailable()
|
bool TouchID::isAvailable()
|
||||||
{
|
{
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101201
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
// cache result
|
// cache result
|
||||||
if (this->m_available != TOUCHID_UNDEFINED) {
|
if (this->m_available != TOUCHID_UNDEFINED) {
|
||||||
return (this->m_available == TOUCHID_AVAILABLE);
|
return (this->m_available == TOUCHID_AVAILABLE);
|
||||||
|
@ -264,6 +269,7 @@ bool TouchID::isAvailable()
|
||||||
this->m_available = TOUCHID_NOT_AVAILABLE;
|
this->m_available = TOUCHID_NOT_AVAILABLE;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@ -294,7 +300,9 @@ bool TouchID::authenticate(const QString& message) const
|
||||||
policyCode = LAPolicyDeviceOwnerAuthenticationWithBiometricsOrWatch;
|
policyCode = LAPolicyDeviceOwnerAuthenticationWithBiometricsOrWatch;
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101201
|
||||||
policyCode = LAPolicyDeviceOwnerAuthenticationWithBiometrics;
|
policyCode = LAPolicyDeviceOwnerAuthenticationWithBiometrics;
|
||||||
|
#endif
|
||||||
#if __clang_major__ >= 9 && MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
|
#if __clang_major__ >= 9 && MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue