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 <vincenzopalazzodev@gmail.com>
This commit is contained in:
Vincenzo Palazzo 2022-03-10 21:30:39 +01:00 committed by Rusty Russell
parent be75518559
commit 58ce4cf71c

View file

@ -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);