Only allow numbers on PIN entry.
MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -10,6 +10,7 @@ using System.Net.Sockets;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
+using System.Text.RegularExpressions;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Gui.ViewModels.Validation;
using WalletWasabi.Helpers;
@@ -36,6 +37,8 @@ namespace WalletWasabi.Gui.Tabs
private string _oldPINPwdBox;
private string _newPINPwdBox;
private string _confirmPINWarningMessage;
+
+ private Regex PINNumOnlyRegex { get; }= new Regex("^[0-9]+$");
private AsyncLock ConfigLock { get; } = new AsyncLock();
public ReactiveCommand<Unit, Unit> OpenConfigFileCommand { get; }
@@ -128,6 +131,13 @@ namespace WalletWasabi.Gui.Tabs
return;
}
+ if(!PINNumOnlyRegex.IsMatch(_newPINPwdBox))
+ {
+ ConfirmPINWarningMessage = "PIN should only contain numbers.";
+ EnablePINEntry = !EnablePINEntry;
+ return;
+ }
+
var uiConfigPINHash = Global.UiConfig.LockScreenPinHash;
var enteredPINHash = HashHelpers.GenerateSha256Hash(_newPINPwdBox);

Only allow numbers on PIN entry.