Zondax/ledger-cosmos-js

Pubkey isn't returned correctly

Closed this issue · 3 comments

This will return the first 64 bytes of the uncompressed key (instead of the needed 65 bytes):

https://github.com/ZondaX/ledger-cosmos-js/blob/32b95aca04c3acc225c09b7b1d68cc6b25655815/src/ledger-app.js#L154
(one off bug, classic ;-D)

this should be:
result["pk"] = Buffer.from(apduResponse.slice(0, 65));

Hah, that makes even more sense as the error code seems to be in the last two bytes (-2). JS, is confusing:
https://github.com/ZondaX/ledger-cosmos-js/blob/32b95aca04c3acc225c09b7b1d68cc6b25655815/src/ledger-app.js#L152-L154

jleni commented

yes, that is incorrect. Who sends the PR first? :)