HWI icon indicating copy to clipboard operation
HWI copied to clipboard

"sendpin" command hangs when connected to a Trezor Model One

Open nadahalli opened this issue 1 year ago • 12 comments

Commands to reproduce the problem.

$./hwi enumerate
[{"type": "trezor", "path": "webusb:001:3", "label": "My Trezor", "model": "trezor_1", "needs_pin_sent": true, "needs_passphrase_sent": true, "error": "Could not open client or get fingerprint information: Trezor is locked. Unlock by using 'promptpin' and then 'sendpin'.", "code": -12}]
$./hwi --device-type trezor promptpin
Use 'sendpin' to provide the number positions for the PIN as displayed on your device's screen
Use the numeric keypad to describe number positions. The layout is:
    7 8 9
    4 5 6
    1 2 3
{"success": true}

When this command runs, the device shows the keypad in a randomzied order, for example:

2 3 5 6 7 1 9 4 8

Say my pin is "1111", I believe I have to send the pin "9999" (real pin mapped to the randomized keypad).

$./hwi --device-type trezor sendpin 9999

This command hangs in the TrezorLib interruptRead command here: https://github.com/bitcoin-core/HWI/blob/d6a8cdef3b904a8a7ea5e316a83cb4037046202d/hwilib/devices/trezorlib/transport/webusb.py#L76

Any ideas what I am doing wrong with respect to the Trezor state machine protocol? Is there some other order in which promptpin and sendpin have to be used?

nadahalli avatar Oct 12 '22 12:10 nadahalli