Skip to content

Commit

Permalink
hsmd: increase the min version
Browse files Browse the repository at this point in the history
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: #7074
Changelog-None: hsmd: increase the min version
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Feb 19, 2024
1 parent cdb0001 commit 209f2d1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/hsm_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
3 changes: 2 additions & 1 deletion hsmd/hsmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <ccan/tal/str/str.h>
#include <common/daemon_conn.h>
#include <common/hsm_encryption.h>
#include <common/hsm_version.h>
#include <common/memleak.h>
#include <common/status.h>
#include <common/status_wiregen.h>
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion hsmd/libhsmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 209f2d1

Please sign in to comment.