-
Notifications
You must be signed in to change notification settings - Fork 50
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
Remove suprious OSX USB Reads #23
Conversation
Since this package is used but other projects (not only Cosmos), please correct the error codes to avoid specific names like Keplr, Ledger live or Cosmos app 🙏 |
Done. If message should be more generic, let us know again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT, only some nits
apduWrapper.go
Outdated
@@ -51,6 +52,8 @@ func ErrorMessage(errorCode uint16) string { | |||
return "[APDU_CODE_INS_NOT_SUPPORTED] Instruction code not supported or invalid" | |||
case 0x6E00: | |||
return "[APDU_CODE_CLA_NOT_SUPPORTED] CLA not supported" | |||
case 0x6E01: | |||
return "[0x6E01] Ledger Connected but Chain Specific App Not Open" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add in the return the corresponding apdu code instead of 0x6E01
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could not locate the APDU description in any other source code/documentation. Do you know what repo/component runs the ledger "home screen"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented as APDU_CODE_APP_NOT_OPEN
ledger_hid.go
Outdated
|
||
// Discard all zero packets from Ledger Nano X on macOS | ||
allZeros := true | ||
for i := 0; i < 64; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe here would be better to write:
for i := 0; i < len(buffer);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
apduWrapper.go
Outdated
if err != nil { | ||
return nil, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you first check if err != nil
right after calling DeserializePacket
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
f60242e
to
375a16f
Compare
Unable to find APDU description for code 0x6E01. Can you recommend a reference? This is the most official we could locate so far https://support.ledger.com/hc/en-us/articles/5282886278557-Solve-error-0x6E01?support=true Does not look like a standard APDU code. |
Hi @chillyvee! I think that this code was by Ledger because it's replied by the device itself and not from the app. |
Implemented as APDU_CODE_APP_NOT_OPEN |
Kudos, SonarCloud Quality Gate passed! |
Release v0.14.1 was published! Thank you @chillyvee! |
Thank you all! |
Porting PR from: cosmos#7
Transaction approval with Ledger + OS X often fails due to:
Packets full of zeros being read
Packets out of sequence being read
This patch filters all zero filled packets and ensures each USB exchange (Send + Receive) start on proper sequence boundaries.
Typical Errors - Various chains
Error: len < 2
Modern Error
juno v11.0.0 with :
github.com/zondax/ledger-go v0.14.0
github.com/cosmos/ledger-cosmos-go v0.12.0
Replaced with this branch - Eliminates error
--
Previous tester feedback on cosmos/ledger-go PR based code:
https://twitter.com/KevinGarrison/status/1588151637432012800
https://twitter.com/rhinostake/status/1588161469623013377