Skip to content

Purged seed and all private key material from remote-hsmd #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions contrib/remote_hsmd/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,13 @@ Some popular tests:
export THETEST=tests/test_connection.py::test_fee_limits
export THETEST=tests/test_closing.py::test_option_upfront_shutdown_script


rust-lightning-signer
----------------------------------------------------------------

cargo run --bin server |& tee log3


Signing Formats
----------------------------------------------------------------

```
rust-lightning c-lightning rust-lightning-signer
p2pkh P2PKH
Expand All @@ -107,6 +104,11 @@ p2shwsh
```


Failing tests after removing seed from hsmd:
```

export THETEST=tests/test_misc.py::test_blockchaintrack
export THETEST=tests/test_misc.py::test_new_node_is_mainnet
export THETEST=tests/test_misc.py::test_getsharedsecret
export THETEST=tests/test_wallet.py::test_hsm_secret_encryption
export THETEST=tests/test_wallet.py::test_hsmtool_secret_decryption
```
11 changes: 11 additions & 0 deletions contrib/remote_hsmd/dump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extern "C" {
#include <common/utils.h>
#include <common/utxo.h>
#include <secp256k1_recovery.h>
#include <wally_bip32.h>
}

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

string dump_ext_pubkey(const struct ext_key *xp)
{
char *out;
int rv = bip32_key_to_base58(xp, BIP32_FLAG_KEY_PUBLIC, &out);
assert(rv == WALLY_OK);
string retval(out);
wally_free_string(out);
return retval;
}

string dump_witnesses(const u8 ***wp)
{
ostringstream ostrm;
Expand Down
1 change: 1 addition & 0 deletions contrib/remote_hsmd/dump.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ std::string dump_secp256k1_ecdsa_recoverable_signature(const secp256k1_ecdsa_rec
std::string dump_secret(const struct secret *sp);
std::string dump_node_id(const struct node_id *pp);
std::string dump_pubkey(const struct pubkey *kp);
std::string dump_ext_pubkey(const struct ext_key *xp);
std::string dump_witnesses(const u8 ***wp);
std::string dump_unilateral_close_info(const struct unilateral_close_info *ip);
std::string dump_utxo(const struct utxo *in);
Expand Down
Loading