diff --git a/hsmd/libhsmd.c b/hsmd/libhsmd.c index a641e3f87..4dc90f655 100644 --- a/hsmd/libhsmd.c +++ b/hsmd/libhsmd.c @@ -271,7 +271,7 @@ static u8 *handle_derive_secret(struct hsmd_client *c, const u8 *msg_in) return hsmd_status_malformed_request(c, msg_in); hkdf_sha256(&secret, sizeof(struct secret), NULL, 0, - &secretstuff.derived_secret, sizeof(&secretstuff.derived_secret), + &secretstuff.derived_secret, sizeof(secretstuff.derived_secret), info, tal_bytelen(info)); return towire_hsmd_derive_secret_reply(NULL, &secret); diff --git a/tests/test_misc.py b/tests/test_misc.py index 9a7cf8738..9deeba63c 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -2268,7 +2268,7 @@ def test_makesecret(node_factory): l1 = node_factory.get_node(options={"dev-force-privkey": "1212121212121212121212121212121212121212121212121212121212121212"}) secret = l1.rpc.makesecret("73636220736563726574")["secret"] - assert (secret == "04fe01631fcedc8d91f39ab43244e63afebaed68ee21d2f1c325fd1242726a18") + assert (secret == "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed") # Same if we do it by parameter name assert l1.rpc.makesecret(hex="73636220736563726574")["secret"] == secret diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 67b242bc1..8ff19370d 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -2640,9 +2640,13 @@ def test_commando(node_factory, executor): def test_commando_rune(node_factory): - l1, l2 = node_factory.line_graph(2, fundchannel=False) + l1, l2 = node_factory.get_nodes(2) + + # Force l1's commando secret + l1.rpc.datastore(key=['commando', 'secret'], hex='1241faef85297127c2ac9bde95421b2c51e5218498ae4901dc670c974af4284b') + l1.restart() + l1.rpc.connect(l2.info['id'], 'localhost', l2.port) - # l1's commando secret is 1241faef85297127c2ac9bde95421b2c51e5218498ae4901dc670c974af4284b. # I put that into a test node's commando.py to generate these runes (modified readonly to match ours): # $ l1-cli commando-rune # "rune": "zKc2W88jopslgUBl0UE77aEe5PNCLn5WwqSusU_Ov3A9MA=="