LedgerHQ / app-monero

Monero wallet application for Ledger Nano S & X
Apache License 2.0
273 stars 101 forks source link

Forbid transition from INS_BLIND to INS_VALIDATE(P1=2) directly #60

Closed niooss-ledger closed 4 years ago

niooss-ledger commented 4 years ago

When signing a Monero transaction, the state machine of the APDU is expected to behave like this:

Because of the way the transition from INS_BLIND is verified, it is currently possible to skip INS=INS_VALIDATE, P1=1 by sending INS=INS_VALIDATE, P1=2, P2=1 direcly. This makes the transaction signing fail later, because some hash states did not get reset properly, so this would not have any impact from a security perspective. Nevertheless, removing this unexpected transition makes working on the state machine easier.

grydz commented 4 years ago

Thanks for the fix it has been tested successfully.