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

PM-1076 added warning on unlocking iOS extensions when the kdf type is argon2id and the memory is higher than 48MB, to let the user know that unlocking might crash the extension (#2560)

This commit is contained in:
Federico Maccaroni
2023-06-07 16:21:51 +02:00
committed by GitHub
parent 1c13ed9895
commit 3b087c50ae
4 changed files with 25 additions and 0 deletions

View File

@@ -225,6 +225,18 @@ namespace Bit.iOS.Core.Controllers
var kdfConfig = await _stateService.GetActiveUserCustomDataAsync(a => new KdfConfig(a?.Profile));
var inputtedValue = MasterPasswordCell.TextField.Text;
// HACK: iOS extensions have constrained memory, given how it works Argon2Id, it's likely to crash
// the extension depending on the argon2id memory configured.
// So, we warn the user and advise to decrease the configured memory letting them the option to continue, if wanted.
if (kdfConfig.Type == KdfType.Argon2id
&&
kdfConfig.Memory > Constants.MaximumArgon2IdMemoryBeforeExtensionCrashing
&&
!await _platformUtilsService.ShowDialogAsync(AppResources.UnlockingMayFailDueToInsufficientMemoryDecreaseYourKDFMemorySettingsToResolve, AppResources.Warning, AppResources.Continue, AppResources.Cancel))
{
return;
}
if (_pinLock)
{
var failed = true;