Browse Source

lightningd/opening: seed is a privkey not an sha256.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
a8b9177e9e
  1. 8
      lightningd/opening/opening.c
  2. 2
      lightningd/opening/opening_control_wire.csv

8
lightningd/opening/opening.c

@ -64,7 +64,7 @@ struct state {
struct channel *channel;
};
static void derive_our_basepoints(const struct sha256 *seed,
static void derive_our_basepoints(const struct privkey *seed,
struct points *points,
struct secrets *secrets,
struct sha256 *shaseed,
@ -76,7 +76,7 @@ static void derive_our_basepoints(const struct sha256 *seed,
struct sha256 shaseed;
} keys;
hkdf_sha256(&keys, sizeof(keys), NULL, 0, seed, sizeof(seed),
hkdf_sha256(&keys, sizeof(keys), NULL, 0, seed, sizeof(*seed),
"c-lightning", strlen("c-lightning"));
secrets->funding_privkey = keys.f;
@ -90,7 +90,7 @@ static void derive_our_basepoints(const struct sha256 *seed,
|| !pubkey_from_privkey(&keys.d, &points->delayed_payment_basepoint))
status_failed(WIRE_OPENING_KEY_DERIVATION_FAILED,
"seed = %s",
type_to_string(trc, struct sha256, seed));
type_to_string(trc, struct privkey, seed));
/* BOLT #3:
*
@ -593,7 +593,7 @@ int main(int argc, char *argv[])
{
u8 *msg, *peer_msg;
struct state *state = tal(NULL, struct state);
struct sha256 seed;
struct privkey seed;
struct points our_points;
if (argc == 2 && streq(argv[1], "--version")) {

2
lightningd/opening/opening_control_wire.csv

@ -8,7 +8,7 @@ opening_init,36,min_config,36,struct channel_config
opening_init,72,max_config,36,struct channel_config
opening_init,108,crypto_state,144,struct crypto_state
# Seed to generate all the keys from
opening_init,252,seed,32
opening_init,252,seed,32,struct privkey
# This means we offer the open.
opening_open,1

Can't render this file because it has a wrong number of fields in line 3.
Loading…
Cancel
Save