Skip to content

Commit

Permalink
hsmd: increase HSM_MAX_VERSION to 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ksedgwic authored and devrandom committed Jan 26, 2023
1 parent eb84201 commit 03aae88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions common/hsm_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define HSM_MIN_VERSION 1

/* wire/hsmd_wire.csv contents version:
* dd89bf9323dff42200003fb864abb6608f3aa645b636fdae3ec81d804ac05196
* edd3d288fc88a5470adc2f99abcbfe4d4af29fae0c7a80b4226f28810a815524
*/
#define HSM_MAX_VERSION 2
#define HSM_MAX_VERSION 3
#endif /* LIGHTNING_COMMON_HSM_VERSION_H */
2 changes: 1 addition & 1 deletion hsmd/hsmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ static struct io_plan *init_hsm(struct io_conn *conn,
struct secret *hsm_encryption_key;
struct bip32_key_version bip32_key_version;
u32 minversion, maxversion;
const u32 our_minversion = 2, our_maxversion = 2;
const u32 our_minversion = 2, our_maxversion = 3;

/* This must be lightningd. */
assert(is_lightningd(c));
Expand Down
3 changes: 2 additions & 1 deletion lightningd/hsm_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ struct ext_key *hsm_init(struct lightningd *ld)
}

ld->hsm_fd = fds[0];
u32 min_version = 3; /* payment modifiers need hsmd_preapprove_{invoice,keysend} */
if (!wire_sync_write(ld->hsm_fd, towire_hsmd_init(tmpctx,
&chainparams->bip32_key_version,
chainparams,
Expand All @@ -112,7 +113,7 @@ struct ext_key *hsm_init(struct lightningd *ld)
IFDEV(ld->dev_force_bip32_seed, NULL),
IFDEV(ld->dev_force_channel_secrets, NULL),
IFDEV(ld->dev_force_channel_secrets_shaseed, NULL),
HSM_MIN_VERSION,
min_version,
HSM_MAX_VERSION)))
err(EXITCODE_HSM_GENERIC_ERROR, "Writing init msg to hsm");

Expand Down

0 comments on commit 03aae88

Please sign in to comment.