mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-05 09:01:11 +01: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:
parent
1c13ed9895
commit
3b087c50ae
9
src/App/Resources/AppResources.Designer.cs
generated
9
src/App/Resources/AppResources.Designer.cs
generated
@ -6434,6 +6434,15 @@ namespace Bit.App.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unlocking may fail due to insufficient memory. Decrease your KDF memory settings to resolve.
|
||||
/// </summary>
|
||||
public static string UnlockingMayFailDueToInsufficientMemoryDecreaseYourKDFMemorySettingsToResolve {
|
||||
get {
|
||||
return ResourceManager.GetString("UnlockingMayFailDueToInsufficientMemoryDecreaseYourKDFMemorySettingsToResolve", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unlock vault.
|
||||
/// </summary>
|
||||
|
@ -2634,4 +2634,7 @@ Do you want to switch to this account?</value>
|
||||
<data name="MasterPasswordRePromptHelp" xml:space="preserve">
|
||||
<value>Master password re-prompt help</value>
|
||||
</data>
|
||||
<data name="UnlockingMayFailDueToInsufficientMemoryDecreaseYourKDFMemorySettingsToResolve" xml:space="preserve">
|
||||
<value>Unlocking may fail due to insufficient memory. Decrease your KDF memory settings to resolve</value>
|
||||
</data>
|
||||
</root>
|
||||
|
@ -32,5 +32,6 @@
|
||||
public const string UTTypeAppExtensionImage = "public.image";
|
||||
|
||||
public const string AutofillNeedsIdentityReplacementKey = "autofillNeedsIdentityReplacement";
|
||||
public const int MaximumArgon2IdMemoryBeforeExtensionCrashing = 48;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user