Skip to content

Commit

Permalink
Merge #604: add support for ledger nano s plus
Browse files Browse the repository at this point in the history
8874f3a update udev rules to include ledger nano s+ (Leibniz137)
8c91d84 add model id for ledger nano s plus (Leibniz137)

Pull request description:

  fixes #595 by adding the nano s plus model id.

  I am not familiar with this codebase, so maybe I am missing something, but it seemed as simple as adding this one line.

  I only did two manual integration tests, just to see that `hwi enumerate` recognized my ledger nano s plus:

  1st test: ledger nano s+ plugged in, but not unlocked
  ```
  % hwi --expert --debug enumerate
  DEBUG:ledgercomm:=> b001000000
  DEBUG:ledgercomm:<= 0107426974636f696e05322e302e340102 9000
  DEBUG:ledgercomm:=> e105000000
  DEBUG:ledgercomm:<=  6982
  INFO:jade.tcp:Connecting to tcp:127.0.0.1:2222
  DEBUG:root:Failed to connect to Jade simulator at tcp:127.0.0.1:2222
  DEBUG:root:[Errno 61] Connection refused
  [{"type": "ledger", "model": "ledger_nano_s_plus", "label": null, "path": "DevSrvsID:4295015068", "error": "Could not open client or get fingerprint information: ('0x6982', 'Error in command', '')", "code": -13}]
  ```

  2nd test: ledger nano s+ plugged in and unlocked:
  ```
  % hwi --expert --debug enumerate
  DEBUG:ledgercomm:=> b001000000
  DEBUG:ledgercomm:<= 0107426974636f696e05322e302e340102 9000
  DEBUG:ledgercomm:=> e105000000
  DEBUG:ledgercomm:<= ... 9000
  INFO:jade.tcp:Connecting to tcp:127.0.0.1:2222
  DEBUG:root:Failed to connect to Jade simulator at tcp:127.0.0.1:2222
  DEBUG:root:[Errno 61] Connection refused
  [{"type": "ledger", "model": "ledger_nano_s_plus", "label": null, "path": "DevSrvsID:4295015068", "fingerprint": "...", "needs_pin_sent": false, "needs_passphrase_sent": false}]
  ```
  (Note, fingerprint is redacted)

  Let me know if there are any other tests I should run.

  I am also not sure if i need to add the `0x0005` code to the `LEDGER_LEGACY_PRODUCT_IDS` dict as well?

ACKs for top commit:
  achow101:
    ACK 8874f3a

Tree-SHA512: 678ffba6e862ca40a5429b6894a44d59299b79ce97226e43dfe1b3790971f68157d93a50d6af9b60276b4f18f310a59465847de85c3dd3df81857d536d6a4ec6
  • Loading branch information
achow101 committed May 18, 2022
2 parents 01c1f55 + 8874f3a commit b2e6e11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hwilib/devices/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
LEDGER_VENDOR_ID = 0x2c97
LEDGER_MODEL_IDS = {
0x10: "ledger_nano_s",
0x40: "ledger_nano_x"
0x40: "ledger_nano_x",
0x50: "ledger_nano_s_plus"
}
LEDGER_LEGACY_PRODUCT_IDS = {
0x0001: "ledger_nano_s",
Expand Down
2 changes: 2 additions & 0 deletions hwilib/udev/20-hw1.rules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0002|2000|2001|20
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0003|3000|3001|3002|3003|3004|3005|3006|3007|3008|3009|300a|300b|300c|300d|300e|300f|3010|3011|3012|3013|3014|3015|3016|3017|3018|3019|301a|301b|301c|301d|301e|301f", TAG+="uaccess", TAG+="udev-acl"
# Nano X
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0004|4000|4001|4002|4003|4004|4005|4006|4007|4008|4009|400a|400b|400c|400d|400e|400f|4010|4011|4012|4013|4014|4015|4016|4017|4018|4019|401a|401b|401c|401d|401e|401f", TAG+="uaccess", TAG+="udev-acl"
# Ledger Test
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0005|5000|5001|5002|5003|5004|5005|5006|5007|5008|5009|500a|500b|500c|500d|500e|500f|5010|5011|5012|5013|5014|5015|5016|5017|5018|5019|501a|501b|501c|501d|501e|501f", TAG+="uaccess", TAG+="udev-acl"

0 comments on commit b2e6e11

Please sign in to comment.