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

Conversation

vincenzopalazzo
Copy link
Collaborator

This is a mistake that I introduced while I implemented the lightningd custom error for hsmd.

In particular, when the command line parser check
if the file is encrypted make an additional check regarding the existence of the file.

This can be a not useful check, but due to the delicate nature of the hsm file, it is better to check if exist and if it doesn't exist an informative line inside the log is emitted that notifies the user that the file does not exist.

This log may return useful while debugging disaster
(that can happen) to understand that there is something strange (eg. the user moves the hsm file somewhere else).

Fixes #5719

Signed-off-by: Vincenzo Palazzo vincenzopalazzodev@gmail.com

@vincenzopalazzo vincenzopalazzo marked this pull request as ready for review November 21, 2022 08:14
lightningd/options.c Outdated Show resolved Hide resolved
@cdecker
Copy link
Member

cdecker commented Nov 21, 2022

ACK 259585a

Copy link
Contributor

@orbitalturtle orbitalturtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirming that testing this, the change worked for me, thanks for taking a look at this @vincenzopalazzo

@cdecker cdecker added this to the v22.11 milestone Nov 30, 2022
@cdecker cdecker force-pushed the macros/hsmd_password branch 2 times, most recently from 7e76e7d to 3579b9d Compare November 30, 2022 13:57
This is a mistake that I introduced while I implemented the lightningd custom error for hsmd.

In particular, when the command line parser check
if the file is encrypted make an additional check regarding the existence of the file.

This can be a not useful check, but due to the delicate nature of the hsm file, it is better to check if exist and if it doesn't exist an informative line inside the log is emitted that notifies the user that the file does not exist.

This log may return useful while debugging disaster
(that can happen) to understand that there is something strange (eg. the user moves the hsm file somewhere else).

Fixes ElementsProject#5719

Changelog-Fixed: lightningd: do not abort while parsing hsm pwd

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
@cdecker cdecker merged commit 2064982 into ElementsProject:master Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

encrypted-hsm doesn't automatically create secret if it's missing
3 participants