Skip to content

Commit 684e295

Browse files
committed
adjust change-code check pin
1 parent 1824066 commit 684e295

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

core/src/apps/management/change_pin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ async def change_pin(ctx: wire.Context, msg: ChangePin) -> Success:
5050
newpin = ""
5151

5252
if newpin:
53-
verified, usertype = config.check_pin(newpin, salt, PinType.PASSPHRASE_PIN)
53+
verified, usertype = config.check_pin(
54+
newpin, salt, PinType.PASSPHRASE_PIN_CHECK
55+
)
5456
if usertype == PinResult.PASSPHRASE_PIN_ENTERED:
5557
return await error_pin_used(ctx)
5658

core/src/apps/management/change_wipe_code.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ async def change_wipe_code(ctx: wire.Context, msg: ChangeWipeCode) -> Success:
3030

3131
if not msg.remove:
3232
# Pre-check the entered PIN.
33-
if config.has_pin() and not config.check_pin(pin, salt)[0]:
33+
from apps.common.pin_constants import PinType
34+
if config.has_pin() and not config.check_pin(pin, salt,PinType.USER_CHECK)[0]:
3435
await error_pin_invalid(ctx)
3536

3637
# Get new wipe code.

core/src/trezor/ui/layouts/lvgl/attach_to_pin.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -198,20 +198,6 @@ async def show_attach_to_pin_window(ctx):
198198
if not save_result:
199199
return False
200200

201-
# Convert passphrase pin to string if needed
202-
passphrase_pin_str = (
203-
str(passphrase_pin)
204-
if not isinstance(passphrase_pin, str)
205-
else passphrase_pin
206-
)
207-
208-
# Verify the pin
209-
pinstatus, result = config.check_pin(
210-
passphrase_pin_str,
211-
None,
212-
PinType.USER_AND_PASSPHRASE_PIN,
213-
)
214-
215201
# Show success message
216202
await show_passphrase_set_and_attached_to_pin_window(
217203
ctx

0 commit comments

Comments
 (0)