summa-tx / coins

Rust implementations of BIP32/39 and Ledger device comms
Other
92 stars 31 forks source link

ledger: BadKeyHandle APDU error code should be BadData #133

Closed DaniPopes closed 8 months ago

DaniPopes commented 8 months ago

Officially 6a 80 -> "The parameters in the data field are incorrect.":

https://github.com/summa-tx/coins/blob/32463b1582c45e1e0895e4842ee73150a1be5157/ledger/src/common.rs#L216-L217

Ledger uses this just about everywhere to indicate "bad data", just search for 0x6a80, 0x6A80 or APDU_RESPONSE_INVALID_DATA (e.g. https://github.com/LedgerHQ/app-ethereum/blob/develop/src_features/signTx/cmd_signTx.c#L25-L29)

A better name would probably be BadData

DaniPopes commented 8 months ago

https://github.com/summa-tx/coins/pull/134