aboutsummaryrefslogtreecommitdiff
path: root/src/multisig
diff options
context:
space:
mode:
authorcslashm <cslashm@gmail.com>2018-02-20 17:01:27 +0100
committerCédric <cslashm@gmail.com>2018-03-04 12:54:53 +0100
commite745c1e38da8e54032660894bb2db0e9a49cccf2 (patch)
treefba40dea29a948b8a4904b4de189d4adc605ec6e /src/multisig
parentMerge pull request #3245 (diff)
downloadmonero-e745c1e38da8e54032660894bb2db0e9a49cccf2.tar.xz
Code modifications to integrate Ledger HW device into monero-wallet-cli.
The basic approach it to delegate all sensitive data (master key, secret ephemeral key, key derivation, ....) and related operations to the device. As device has low memory, it does not keep itself the values (except for view/spend keys) but once computed there are encrypted (with AES are equivalent) and return back to monero-wallet-cli. When they need to be manipulated by the device, they are decrypted on receive. Moreover, using the client for storing the value in encrypted form limits the modification in the client code. Those values are transfered from one C-structure to another one as previously. The code modification has been done with the wishes to be open to any other hardware wallet. To achieve that a C++ class hw::Device has been introduced. Two initial implementations are provided: the "default", which remaps all calls to initial Monero code, and the "Ledger", which delegates all calls to Ledger device.
Diffstat (limited to 'src/multisig')
-rw-r--r--src/multisig/multisig.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/multisig/multisig.cpp b/src/multisig/multisig.cpp
index 6c05a38d9..91042d58a 100644
--- a/src/multisig/multisig.cpp
+++ b/src/multisig/multisig.cpp
@@ -33,6 +33,7 @@
#include "cryptonote_basic/account.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "multisig.h"
+#include "device/device_default.hpp"
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "multisig"
@@ -116,7 +117,7 @@ namespace cryptonote
bool generate_multisig_composite_key_image(const account_keys &keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, const crypto::public_key& out_key, const crypto::public_key &tx_public_key, const std::vector<crypto::public_key>& additional_tx_public_keys, size_t real_output_index, const std::vector<crypto::key_image> &pkis, crypto::key_image &ki)
{
cryptonote::keypair in_ephemeral;
- if (!cryptonote::generate_key_image_helper(keys, subaddresses, out_key, tx_public_key, additional_tx_public_keys, real_output_index, in_ephemeral, ki))
+ if (!cryptonote::generate_key_image_helper(keys, subaddresses, out_key, tx_public_key, additional_tx_public_keys, real_output_index, in_ephemeral, ki, keys.get_device()))
return false;
std::unordered_set<crypto::key_image> used;
for (size_t m = 0; m < keys.m_multisig_keys.size(); ++m)