Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightningd: do not abort while parsing hsm pwd #5725

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lightningd/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,15 @@ static char *opt_set_hsm_password(struct lightningd *ld)
int is_encrypted;

is_encrypted = is_hsm_secret_encrypted("hsm_secret");
/* While lightningd is performing the first initialization
* this check is always true because the file does not exist.
*
* Maybe the is_hsm_secret_encrypted is performing a not useful
* check at this stage, but the hsm is a delicate part,
* so it is a good information to have inside the log. */
if (is_encrypted == -1)
return tal_fmt(NULL, "Could not access 'hsm_secret': %s",
strerror(errno));
log_info(ld->log, "'hsm_secret' does not exist (%s)",
strerror(errno));

prompt(ld, "The hsm_secret is encrypted with a password. In order to "
"decrypt it and start the node you must provide the password.");
Expand Down