Closed niooss-ledger closed 4 years ago
Protocol v3 introduced INS_PREFIX_HASH in order to verify the timelock on devices. This works by sending the following sequence of APDU:
INS_PREFIX_HASH
(cf. function device_ledger::get_transaction_prefix_hash() from https://github.com/monero-project/monero/blob/77a008f71454ce4dd4bce033bc0319a49e2cec51/src/device/device_ledger.cpp#L1418)
device_ledger::get_transaction_prefix_hash()
Currently, the first 2 chunks of data are accepted but not the 3rd one: the device then returns SW=0x6981 = SW_SUBCOMMAND_NOT_ALLOWED.
SW=0x6981
SW_SUBCOMMAND_NOT_ALLOWED
This is because the dispatcher incorrectly compares P1-1 with the last P2, instead of P2-1. Fix this.
Thanks for the fix it has been tested successfully.
Protocol v3 introduced
INS_PREFIX_HASH
in order to verify the timelock on devices. This works by sending the following sequence of APDU:(cf. function
device_ledger::get_transaction_prefix_hash()
from https://github.com/monero-project/monero/blob/77a008f71454ce4dd4bce033bc0319a49e2cec51/src/device/device_ledger.cpp#L1418)Currently, the first 2 chunks of data are accepted but not the 3rd one: the device then returns
SW=0x6981
=SW_SUBCOMMAND_NOT_ALLOWED
.This is because the dispatcher incorrectly compares P1-1 with the last P2, instead of P2-1. Fix this.