From 209f2d185a3f33094c30507a7d9d13279dc86414 Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Mon, 19 Feb 2024 10:04:01 +0100 Subject: [PATCH] hsmd: increase the min version Increasing the min version of the hsmd due that we added new code that required the hsmd to sign an announcements. One of the solution is to increase the min version in this way a signer like VLS fails directly during the init phase. Link: https://github.com/ElementsProject/lightning/issues/7074 Changelog-None: hsmd: increase the min version Signed-off-by: Vincenzo Palazzo --- common/hsm_version.h | 2 +- hsmd/hsmd.c | 3 ++- hsmd/libhsmd.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/hsm_version.h b/common/hsm_version.h index 5a2c2deac84a..bb9d561f6ceb 100644 --- a/common/hsm_version.h +++ b/common/hsm_version.h @@ -23,6 +23,6 @@ * v5 with hsmd_revoke_commitment_tx: 5742538f87ef5d5bf55b66dc19e52c8683cfeb1b887d3e64ba530ba9a4d8e638 * v5 with sign_any_cannouncement: 5fdb9068c43a21887dc03f7dce410d2e3eeff6277f0d49b4fc56595a798fd4a4 */ -#define HSM_MIN_VERSION 3 +#define HSM_MIN_VERSION 5 #define HSM_MAX_VERSION 5 #endif /* LIGHTNING_COMMON_HSM_VERSION_H */ diff --git a/hsmd/hsmd.c b/hsmd/hsmd.c index 1aec53028500..3b31947c9ce2 100644 --- a/hsmd/hsmd.c +++ b/hsmd/hsmd.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -436,7 +437,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 = 3; + const u32 our_minversion = HSM_MIN_VERSION, our_maxversion = HSM_MAX_VERSION; /* This must be lightningd. */ assert(is_lightningd(c)); diff --git a/hsmd/libhsmd.c b/hsmd/libhsmd.c index a6cacdb90e38..d506edca9057 100644 --- a/hsmd/libhsmd.c +++ b/hsmd/libhsmd.c @@ -2297,7 +2297,7 @@ u8 *hsmd_init(struct secret hsm_secret, * incompatibility detection) with alternate implementations. */ return take(towire_hsmd_init_reply_v4( - NULL, 4, + NULL, 5, /* Capabilities arg needs to be a tal array */ tal_dup_arr(tmpctx, u32, capabilities, ARRAY_SIZE(capabilities), 0),