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

Hsmtool (and hsm_secret encryption) refactorings #4307

Merged
merged 9 commits into from
Jan 6, 2021

Commits on Jan 4, 2021

  1. hsmtool: use errx() instead of err() everywhere

    errx() was printing the confusing errno as well ("Error could not [...] :Success")
    
    Signed-off-by: Antoine Poinsot <[email protected]>
    darosior authored and cdecker committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    afa66e7 View commit details
    Browse the repository at this point in the history
  2. lightning: confirm password on hsm_secret encryption

    Changelog-changed: lightningd: the `--encrypted-hsm` now asks you to confirm your password when first set
    Changelog-changed: hsmtool: the `encrypt` now asks you to confirm your password
    Signed-off-by: Antoine Poinsot <[email protected]>
    darosior authored and cdecker committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    4225221 View commit details
    Browse the repository at this point in the history
  3. lightningd: group hsm_secret encryption key derivation

    This avoids duplication of both logic and error-prone values, such as
    the salt. Grouping all hsm encryption logic into a public API will also
    allow us to fuzz it.
    
    Signed-off-by: Antoine Poinsot <[email protected]>
    darosior authored and cdecker committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    2d21bf8 View commit details
    Browse the repository at this point in the history
  4. lightningd: regroup hsm_secret password input logic

    Signed-off-by: Antoine Poinsot <[email protected]>
    darosior authored and cdecker committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    fe7834c View commit details
    Browse the repository at this point in the history
  5. hsmd: group hsm_secret encryption

    Signed-off-by: Antoine Poinsot <[email protected]>
    darosior authored and cdecker committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    a57fb38 View commit details
    Browse the repository at this point in the history
  6. hsmd: regroup hsm_secret decryption logic

    Signed-off-by: Antoine Poinsot <[email protected]>
    darosior authored and cdecker committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    aa7f5e1 View commit details
    Browse the repository at this point in the history
  7. hsmd: cleanup encrypted hsm_secret detection

    This makes use of the constant defined in the previous commits to more
    accurately detect plaintext, encrypted, and invalid seeds. We now error
    on invalid seeds.
    
    Changelog-changed: hsmd: we now error at startup on invalid hsm_secret
    Changelog-changed: hsmtool: all commands now error on invalid hsm_secret
    Signed-off-by: Antoine Poinsot <[email protected]>
    darosior authored and cdecker committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    0b5dbc2 View commit details
    Browse the repository at this point in the history
  8. libfuzz: add a NULL-termination in to_string

    It's more useful if we actually want to use the output as, well, a
    string..
    
    Signed-off-by: Antoine Poinsot <[email protected]>
    darosior authored and cdecker committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    47b52bf View commit details
    Browse the repository at this point in the history
  9. tests/fuzz: add a fuzz target for hsm_encryption

    Signed-off-by: Antoine Poinsot <[email protected]>
    darosior authored and cdecker committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    dc5c2db View commit details
    Browse the repository at this point in the history