ledger: don't lock for software device
This commit is contained in:
parent
49beb8da17
commit
3c23aca26b
|
@ -695,7 +695,6 @@ namespace hw {
|
||||||
/* ======================================================================= */
|
/* ======================================================================= */
|
||||||
|
|
||||||
bool device_ledger::derive_subaddress_public_key(const crypto::public_key &pub, const crypto::key_derivation &derivation, const std::size_t output_index, crypto::public_key &derived_pub){
|
bool device_ledger::derive_subaddress_public_key(const crypto::public_key &pub, const crypto::key_derivation &derivation, const std::size_t output_index, crypto::public_key &derived_pub){
|
||||||
AUTO_LOCK_CMD();
|
|
||||||
#ifdef DEBUG_HWDEVICE
|
#ifdef DEBUG_HWDEVICE
|
||||||
const crypto::public_key pub_x = pub;
|
const crypto::public_key pub_x = pub;
|
||||||
crypto::key_derivation derivation_x;
|
crypto::key_derivation derivation_x;
|
||||||
|
@ -719,7 +718,7 @@ namespace hw {
|
||||||
MDEBUG( "derive_subaddress_public_key : PARSE mode with known viewkey");
|
MDEBUG( "derive_subaddress_public_key : PARSE mode with known viewkey");
|
||||||
crypto::derive_subaddress_public_key(pub, derivation, output_index,derived_pub);
|
crypto::derive_subaddress_public_key(pub, derivation, output_index,derived_pub);
|
||||||
} else {
|
} else {
|
||||||
|
AUTO_LOCK_CMD();
|
||||||
int offset = set_command_header_noopt(INS_DERIVE_SUBADDRESS_PUBLIC_KEY);
|
int offset = set_command_header_noopt(INS_DERIVE_SUBADDRESS_PUBLIC_KEY);
|
||||||
//pub
|
//pub
|
||||||
memmove(this->buffer_send+offset, pub.data, 32);
|
memmove(this->buffer_send+offset, pub.data, 32);
|
||||||
|
@ -1059,7 +1058,6 @@ namespace hw {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool device_ledger::generate_key_derivation(const crypto::public_key &pub, const crypto::secret_key &sec, crypto::key_derivation &derivation) {
|
bool device_ledger::generate_key_derivation(const crypto::public_key &pub, const crypto::secret_key &sec, crypto::key_derivation &derivation) {
|
||||||
AUTO_LOCK_CMD();
|
|
||||||
bool r = false;
|
bool r = false;
|
||||||
|
|
||||||
#ifdef DEBUG_HWDEVICE
|
#ifdef DEBUG_HWDEVICE
|
||||||
|
@ -1080,6 +1078,7 @@ namespace hw {
|
||||||
assert(is_fake_view_key(sec));
|
assert(is_fake_view_key(sec));
|
||||||
r = crypto::generate_key_derivation(pub, this->viewkey, derivation);
|
r = crypto::generate_key_derivation(pub, this->viewkey, derivation);
|
||||||
} else {
|
} else {
|
||||||
|
AUTO_LOCK_CMD();
|
||||||
int offset = set_command_header_noopt(INS_GEN_KEY_DERIVATION);
|
int offset = set_command_header_noopt(INS_GEN_KEY_DERIVATION);
|
||||||
//pub
|
//pub
|
||||||
memmove(this->buffer_send+offset, pub.data, 32);
|
memmove(this->buffer_send+offset, pub.data, 32);
|
||||||
|
|
Loading…
Reference in New Issue