Skip to content

Commit 8822ebc

Browse files
committed
Removed all private keys/secrets from remote_hsmd.
1 parent 4621418 commit 8822ebc

File tree

8 files changed

+140
-653
lines changed

8 files changed

+140
-653
lines changed

contrib/remote_hsmd/NOTES.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,13 @@ Some popular tests:
8686
export THETEST=tests/test_connection.py::test_fee_limits
8787
export THETEST=tests/test_closing.py::test_option_upfront_shutdown_script
8888

89-
9089
rust-lightning-signer
9190
----------------------------------------------------------------
9291

9392
cargo run --bin server |& tee log3
9493

9594

9695
Signing Formats
97-
----------------------------------------------------------------
98-
9996
```
10097
rust-lightning c-lightning rust-lightning-signer
10198
p2pkh P2PKH
@@ -107,6 +104,11 @@ p2shwsh
107104
```
108105

109106

107+
Failing tests after removing seed from hsmd:
110108
```
111-
109+
export THETEST=tests/test_misc.py::test_blockchaintrack
110+
export THETEST=tests/test_misc.py::test_new_node_is_mainnet
111+
export THETEST=tests/test_misc.py::test_getsharedsecret
112+
export THETEST=tests/test_wallet.py::test_hsm_secret_encryption
113+
export THETEST=tests/test_wallet.py::test_hsmtool_secret_decryption
112114
```

contrib/remote_hsmd/dump.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ extern "C" {
1212
#include <common/utils.h>
1313
#include <common/utxo.h>
1414
#include <secp256k1_recovery.h>
15+
#include <wally_bip32.h>
1516
}
1617

1718
#include "contrib/remote_hsmd/dump.h"
@@ -75,6 +76,16 @@ string dump_pubkey(const struct pubkey *kp)
7576
return dump_hex(kp->pubkey.data, sizeof(kp->pubkey.data));
7677
}
7778

79+
string dump_ext_pubkey(const struct ext_key *xp)
80+
{
81+
char *out;
82+
int rv = bip32_key_to_base58(xp, BIP32_FLAG_KEY_PUBLIC, &out);
83+
assert(rv == WALLY_OK);
84+
string retval(out);
85+
wally_free_string(out);
86+
return retval;
87+
}
88+
7889
string dump_witnesses(const u8 ***wp)
7990
{
8091
ostringstream ostrm;

contrib/remote_hsmd/dump.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ std::string dump_secp256k1_ecdsa_recoverable_signature(const secp256k1_ecdsa_rec
99
std::string dump_secret(const struct secret *sp);
1010
std::string dump_node_id(const struct node_id *pp);
1111
std::string dump_pubkey(const struct pubkey *kp);
12+
std::string dump_ext_pubkey(const struct ext_key *xp);
1213
std::string dump_witnesses(const u8 ***wp);
1314
std::string dump_unilateral_close_info(const struct unilateral_close_info *ip);
1415
std::string dump_utxo(const struct utxo *in);

0 commit comments

Comments
 (0)