1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-13 06:43:17 +00:00

Support for storing multiple biometric integrity states for iOS (#1110)

* support for storing multiple biometric integrity states for iOS

* remove unused var & save new extension bio state upon password validation
This commit is contained in:
Matt Portune
2020-10-07 12:18:36 -04:00
committed by GitHub
parent 8f533bc576
commit 37e19d9a60
6 changed files with 35 additions and 12 deletions

View File

@@ -41,6 +41,8 @@ namespace Bit.iOS.Core.Controllers
public FormEntryTableViewCell MasterPasswordCell { get; set; } = new FormEntryTableViewCell(
AppResources.MasterPassword);
public string BiometricIntegrityKey { get; set; }
public override void ViewDidLoad()
{
@@ -86,7 +88,8 @@ namespace Bit.iOS.Core.Controllers
if (_biometricLock)
{
_biometricIntegrityValid = _biometricService.ValidateIntegrityAsync().GetAwaiter().GetResult();
_biometricIntegrityValid = _biometricService.ValidateIntegrityAsync(BiometricIntegrityKey).GetAwaiter()
.GetResult();
if (!_biometricIntegrityValid)
{
return;
@@ -194,6 +197,12 @@ namespace Bit.iOS.Core.Controllers
_vaultTimeoutService.PinProtectedKey = await _cryptoService.EncryptAsync(key2.Key, pinKey);
}
await SetKeyAndContinueAsync(key2);
// Re-enable biometrics
if (_biometricLock & !_biometricIntegrityValid)
{
await _biometricService.SetupBiometricAsync(BiometricIntegrityKey);
}
}
else
{