From 58ce4cf71ca9b5054406ea3e732d9c268ea4aab2 Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Thu, 10 Mar 2022 21:30:39 +0100 Subject: [PATCH] cli: check if the pass and the confirmation pass match Changelog-Fixed: check if the pass and the confirmation pass match from the command line Signed-off-by: Vincenzo Palazzo --- lightningd/options.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lightningd/options.c b/lightningd/options.c index 4828180d6..66c7ca951 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -518,6 +518,12 @@ static char *opt_set_hsm_password(struct lightningd *ld) passwd_confirmation = read_stdin_pass_with_exit_code(&err_msg, &opt_exitcode); if (!passwd_confirmation) return err_msg; + + if (!streq(passwd, passwd_confirmation)) { + opt_exitcode = HSM_BAD_PASSWORD; + return "Passwords confirmation mismatch."; + } + printf("\n"); ld->config.keypass = tal(NULL, struct secret);