obsidiansystems / ledger-app-tezos

Ledger app for Tezos
Apache License 2.0
101 stars 51 forks source link

Example APDU for using INS_SETUP #161

Closed utdrmac closed 3 years ago

utdrmac commented 3 years ago

I've been wracking my head for two straight days trying to get this function to work.

80 0a 00 00 1e 7a06a770 00000002 000004d2 11 048000002c800006c18000000080000000

That should work (spaces added for clarity), according to the source in apdu_setup.c:handle_apdu_setup()

1e = LC length of 30 7a06a770 = mainnet (types.h:62, 0x7A06A770) (uint32) 00000002 = HWM for main '2' (uint32) 000004d2 = HWM for test '1234' (uint32) 11 = length of bip path (17) (uint8) remaining bytes are the bip path (32 bytes, 4 sections of 8 bytes)

I keep getting the error: 6c00, which is EXC_WRONG_LENGTH. I believe this is coming from apdu_setup.c:86:

if (consumed != buff_size) THROW(EXC_WRONG_LENGTH);

I don't understand why this is not working. Are there any examples of using this setup feature?

utdrmac commented 3 years ago

Accident duplicate