From cfcdde14d85200aa1ccb0cab2e1b10abeb4868d1 Mon Sep 17 00:00:00 2001 From: Ken Sedgwick Date: Fri, 15 Mar 2024 14:24:02 -0700 Subject: [PATCH] hsmd: support HSM_VERSION 6 Changelog-Changed: hsmd: the hsmd now supports HSM_VERSION 6 This is actually optional, everything would be ok leaving native hsmd support at HSM_VERSION 5 instead. --- hsmd/hsmd.c | 2 +- hsmd/libhsmd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hsmd/hsmd.c b/hsmd/hsmd.c index 52c550f98..c41a08546 100644 --- a/hsmd/hsmd.c +++ b/hsmd/hsmd.c @@ -457,7 +457,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 = 4, our_maxversion = 5; + const u32 our_minversion = 4, our_maxversion = 6; /* This must be lightningd. */ assert(is_lightningd(c)); diff --git a/hsmd/libhsmd.c b/hsmd/libhsmd.c index 73c5c79f9..69f34f9f2 100644 --- a/hsmd/libhsmd.c +++ b/hsmd/libhsmd.c @@ -1206,7 +1206,7 @@ static u8 *handle_get_per_commitment_point(struct hsmd_client *c, const u8 *msg_ return hsmd_status_bad_request_fmt( c, msg_in, "bad per_commit_point %" PRIu64, n); - if (n >= 2) { + if (hsmd_mutual_version < 6 && n >= 2) { old_secret = tal(tmpctx, struct secret); if (!per_commit_secret(&shaseed, old_secret, n - 2)) { return hsmd_status_bad_request_fmt(