Compare commits

...

4 Commits

Author SHA1 Message Date
91c4967efa
check for back 2025-02-21 11:01:42 +03:00
7b1824f18c
go back if account not unlocked 2025-02-21 11:01:31 +03:00
04c3f5ce65
repeat same node on invalid input 2025-02-21 11:01:14 +03:00
e646658f40
repeat same node on invalid input 2025-02-21 10:56:12 +03:00
4 changed files with 5 additions and 3 deletions

View File

@ -318,7 +318,7 @@ func (h *MenuHandlers) VerifyNewPin(ctx context.Context, sym string, input []byt
return res, fmt.Errorf("missing session")
}
flag_valid_pin, _ := h.flagManager.GetFlag("flag_valid_pin")
if !h.st.Back() {
if string(input) != "0" {
pinInput := string(input)
// Validate that the PIN is a 4-digit number.
if pin.IsValidPIN(pinInput) {
@ -456,7 +456,7 @@ func (h *MenuHandlers) ConfirmPinChange(ctx context.Context, sym string, input [
}
flag_pin_mismatch, _ := h.flagManager.GetFlag("flag_pin_mismatch")
if h.st.Back() {
if string(input) == "0" {
res.FlagReset = append(res.FlagReset, flag_pin_mismatch)
return res, nil
}

View File

@ -4,4 +4,5 @@ HALT
INCMP _ 0
RELOAD authorize_account
CATCH incorrect_pin flag_incorrect_pin 1
CATCH _ flag_account_authorized 0
INCMP new_pin *

View File

@ -3,4 +3,4 @@ MOUT quit 9
HALT
INCMP _ 1
INCMP quit 9
INCMP . *

View File

@ -3,3 +3,4 @@ MOUT quit 9
HALT
INCMP main 0
INCMP quit 9
INCMP . *