MESSENGER-3675 Security fix faceID, master tag for sdk

This commit is contained in:
Frank Rotermund
2022-10-05 15:15:48 +02:00
parent f67f40dec9
commit a06e1c000f
2 changed files with 13 additions and 3 deletions
@@ -115,9 +115,19 @@ final class PinCodePreferences: NSObject {
var isBiometricsAvailable: Bool {
let context = LAContext()
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) {
return context.biometryType == .touchID || context.biometryType == .faceID
var error: NSError?
let result = LAContext().canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error)
// While in lockout they're still techincally available
if error?.code == LAError.Code.biometryLockout.rawValue {
return true
}
if result == true {
return context.biometryType == .touchID || context.biometryType == .faceID
}
return false
}