LedgerHQ / LedgerHQ/blue-loader-python

python3 -m ledgerblue.checkGenuineRemote --targetId 0x33000004 fails on macOS

Open
#130 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
125
Forks
75
PR merge metrics
No merged PRs in 30d

Description

Trying to do integrity check of Ledger nano s plus using guide https://support.ledger.com/hc/en-us/articles/4404382029329-Check-hardware-integrity?support=true, since using ledger live app doesn't do check before you put private keys in the device

Command failes

$ python3 -m ledgerblue.checkGenuineRemote --targetId 0x33000004
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/local/lib/python3.11/site-packages/ledgerblue/checkGenuineRemote.py", line 79, in <module>
    result = json.loads(ws.recv())
                        ^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_core.py", line 388, in recv
    opcode, data = self.recv_data()
                   ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_core.py", line 416, in recv_data
    opcode, frame = self.recv_data_frame(control_frame)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_core.py", line 437, in recv_data_frame
    frame = self.recv_frame()
            ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_core.py", line 478, in recv_frame
    return self.frame_buffer.recv_frame()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_abnf.py", line 363, in recv_frame
    self.recv_header()
  File "/usr/local/lib/python3.11/site-packages/websocket/_abnf.py", line 319, in recv_header
    header = self.recv_strict(2)
             ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_abnf.py", line 398, in recv_strict
    bytes_ = self.recv(min(16384, shortage))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_core.py", line 563, in _recv
    return recv(self.sock, bufsize)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_socket.py", line 129, in recv
    raise WebSocketConnectionClosedException("Connection to remote host was lost.")
websocket._exceptions.WebSocketConnectionClosedException: Connection to remote host was lost.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce python3 -m ledgerblue.checkGenuineRemote --targetId 0x33000004 on macOS and inspect ledgerblue/checkGenuineRemote.py around line 79, where the WebSocket response is received. Compare the connection and response handling with the command's expected integrity-check flow. Done means the command completes successfully on macOS instead of raising WebSocketConnectionClosedException.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.