diff options
author | cslashm <cslashm@gmail.com> | 2019-09-28 14:03:51 +0200 |
---|---|---|
committer | cslashm <cslashm@gmail.com> | 2019-10-03 16:05:32 +0200 |
commit | 34f28a79bc1e9c25dda79cc17f971689e0045f06 (patch) | |
tree | 026eb71d7c315cb2fb697394c357cb37dd045191 /src/device/device_ledger.cpp | |
parent | Add hmac over encrypted value during transaction (diff) | |
download | monero-34f28a79bc1e9c25dda79cc17f971689e0045f06.tar.xz |
Add display address
Diffstat (limited to 'src/device/device_ledger.cpp')
-rw-r--r-- | src/device/device_ledger.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp index cc56de30c..c1256e926 100644 --- a/src/device/device_ledger.cpp +++ b/src/device/device_ledger.cpp @@ -197,9 +197,11 @@ namespace hw { #define INS_RESET 0x02 #define INS_GET_KEY 0x20 + #define INS_DISPLAY_ADDRESS 0x21 #define INS_PUT_KEY 0x22 #define INS_GET_CHACHA8_PREKEY 0x24 #define INS_VERIFY_KEY 0x26 + #define INS_MANAGE_SEEDWORDS 0x28 #define INS_SECRET_KEY_TO_PUBLIC_KEY 0x30 #define INS_GEN_KEY_DERIVATION 0x32 @@ -594,6 +596,27 @@ namespace hw { return true; } + void device_ledger::display_address(const cryptonote::subaddress_index& index, const boost::optional<crypto::hash8> &payment_id) { + AUTO_LOCK_CMD(); + + int offset = set_command_header_noopt(INS_DISPLAY_ADDRESS, payment_id?1:0); + //index + memmove(this->buffer_send+offset, &index, sizeof(cryptonote::subaddress_index)); + offset +=8 ; + + //payment ID + if (payment_id) { + memmove(this->buffer_send+offset, (*payment_id).data, 8); + } else { + memset(this->buffer_send+offset, 0, 8); + } + offset +=8; + + this->buffer_send[4] = offset-5; + this->length_send = offset; + CHECK_AND_ASSERT_THROW_MES(this->exchange_wait_on_input() == 0, "Timeout/Error on display address."); + } + /* ======================================================================= */ /* SUB ADDRESS */ /* ======================================================================= */ |