Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep Key issue #1219

Closed
cAP5L0CK opened this issue Jun 8, 2021 · 9 comments · Fixed by #1522
Closed

Keep Key issue #1219

cAP5L0CK opened this issue Jun 8, 2021 · 9 comments · Fixed by #1522
Labels
bug Something isn't working hw_keepkey

Comments

@cAP5L0CK
Copy link

cAP5L0CK commented Jun 8, 2021

I have been able to set up both my ledger and my trezor, but when I try to add the keep key I get all the way to the dialog that asks for the password (BIP39). I enter it, and at this point I would expect it would appear on the Keep Key after hitting submit but it does not. And I get this error in the screenshot:

image

It SEEMS as if it skips over the part where it sends to the keep key and waits for a response. It does handle the PIN correctly.

I am using BOTH the latest firmware on the keep key, as well as the latest specter I think
Bootloader 1.1.0
Firmware 7.1.2
Specter:1.4.2

(What a great project this is, by the way... VERY well done.)

@k9ert k9ert added bug Something isn't working hw_keepkey labels Jun 9, 2021
@cAP5L0CK
Copy link
Author

cAP5L0CK commented Jun 9, 2021

Update.

Decided to try to run on a different platform. Ran the appimage on Arch Linux. Did the UDEV dance. Keepkey immediately recognized.

EXACT same issue at the password prompt.

So, seems not dependent on the OS.

@cAP5L0CK
Copy link
Author

Wish I was a coder... I am combing through what i can to try to find the password part of the whole handshake. Sort of looks like it was written using a lot of the same stuff the trezor is using. If I find anything that looks promising I will say. I have a feeling something might just be out of order, or a function is just not being called.

@cAP5L0CK
Copy link
Author

cAP5L0CK commented Jun 10, 2021

Ran in python instead of executable so we could see the python output. Here is what it says when the error happens:

Traceback (most recent call last):
  File "C:\Users\moose\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\cryptoadvance\specter\util\json_rpc.py", line 35, in jsonrpc
    response["result"] = method(**request["params"])  # dict -> **kwargs
  File "C:\Users\moose\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\cryptoadvance\specter\helpers.py", line 50, in wrapper_fn
    return fn(*args, **kwargs)
  File "C:\Users\moose\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\cryptoadvance\specter\hwi_rpc.py", line 252, in extract_xpub
    master_fpr = client.get_master_fingerprint().hex()
  File "C:\Users\moose\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\hwilib\hwwclient.py", line 69, in get_master_fingerprint
    return self.get_pubkey_at_path("m/0h").parent_fingerprint
  File "C:\Users\moose\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\cryptoadvance\specter\devices\hwi\trezor.py", line 178, in func
    return f(*args, **kwargs)
  File "C:\Users\moose\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\cryptoadvance\specter\devices\hwi\trezor.py", line 332, in get_pubkey_at_path
    self._check_unlocked()
  File "C:\Users\moose\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\cryptoadvance\specter\devices\hwi\trezor.py", line 318, in _check_unlocked
    self._prepare_device()
  File "C:\Users\moose\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\cryptoadvance\specter\devices\hwi\trezor.py", line 306, in _prepare_device
    resp = self.client.refresh_features()
  File "C:\Users\moose\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\hwilib\devices\trezorlib\tools.py", line 231, in wrapped_f
    return f(client, *args, **kwargs)
  File "C:\Users\moose\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\hwilib\devices\trezorlib\client.py", line 257, in refresh_features
    raise exceptions.TrezorException("Unexpected response to GetFeatures")
hwilib.devices.trezorlib.exceptions.TrezorException: Unexpected response to GetFeatures
[2021-06-10 11:27:07,336] INFO in _internal: 127.0.0.1 - - [10/Jun/2021 11:27:07] "←[37mPOST /hwi/api/ HTTP/1.1←[0m" 200 -

@cAP5L0CK
Copy link
Author

Glad to provide any other testing or information if needed. Let me know.

@ben-kaufman
Copy link
Contributor

Hi, can you try upgrading the KeepKey firmware and retry please?

@cAP5L0CK
Copy link
Author

cAP5L0CK commented Jul 7, 2021

I have had Bootloader 1.1.0 and Firmware 7.1.4 since starting with Keepkey/Specter..

These are both the latest (I think) and the updater gives no option to flash them again.

@cAP5L0CK
Copy link
Author

I thought I would try to document this a little better. If there is a place in the code maybe I could go to and fix it (I wish I could help more) I would not mind trying.

So I:

  1. +Add New Device (CHECK)
  2. Enter Name (CHECK)
  3. Get via USB (CHECK)
  4. The device is recognized and shows the PIN screen
  5. Enter PIN (CHECK)
  6. The Device now says "Passphrase Confirmation" (CHECK)
  7. I am presented with the passphrase dialog on the computer (CHECK)
    image
  8. I input the passphrase (CHECK)
  9. Click Submit (THIS IS WHERE WE GO OFF THE RAILS)

At this point the software returns the following errors:
image

And the device has not changed since step 6. It is still in a state of waiting for the password.

So it seems to me this is basically running the Trezor script, and at the point the software needs to SEND the passphrase to the device it does NOT send it, and instead polls the device for it's response and executes the GetFeatures function. But the device, having not yet received the passphrase does not respond as expected... and there we are.

I am assuming either we are skipping the send passphrase part, or executing it incorrectly. I have been looking through the code but my novice level understanding is lost trying to pinpoint the place at which what we want to happen is not happening.

Hopefully this provides some more clarity. If there is a particular function in the code i should be looking at I would be glad to try to continue to see what I can do... just let me know!

@cAP5L0CK
Copy link
Author

Just an update:

Issue persists with firmware 7.2.1(latest, within the week)

Another interesting detail. Sparrow Wallet seems to fail with the keepkey in exactly the same way. Wondering if the codebase is shared?

@aphex3k
Copy link
Contributor

aphex3k commented Jan 2, 2022

+1 with remote specter desktop and hwi bridge 1.7.2

@aphex3k aphex3k mentioned this issue Jan 4, 2022
1 task
k9ert pushed a commit that referenced this issue Jan 13, 2022
* Update hwi to 2.0.2

This can potentially fix #1219

* Updated hash for hwi 2.0.2

* Update HWI to version 2.0.2

Co-authored-by: Kim Neunert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hw_keepkey
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants