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

Recover mode for recovering using codex32 secret string. #6302

Merged
merged 11 commits into from
Jul 31, 2023

Commits on Jul 30, 2023

  1. Configuration menu
    Copy the full SHA
    544de37 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    32a8df8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b8d3320 View commit details
    Browse the repository at this point in the history
  4. lightningd/common: Added --recover flag to populate HSM_secret with a…

    …ppropriate secret through a valid codex32 secret.
    adi2011 authored and rustyrussell committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    a9bfe0f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6e6becd View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e9a3f3c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    589b164 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f21493f View commit details
    Browse the repository at this point in the history
  9. codex32: minor cleanups.

    Nothing major here:
    1. size_t for lengths.
    2. pass engine to checksum_verify, as caller wants ->len (avoid repeating 13/15 magic numbers).
    3. Use x.member instesad of (&x)->member.
    4. Return memcmp result directly instead of if.
    5. Spacing removal, `;;` removal.
    6. codexl is a bool `true`/`false` not 0/1 (it's the same, but clearer)
    7. Make sanity_check assign *fail directly.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    be61a9d View commit details
    Browse the repository at this point in the history
  10. codex32: document the complete representations from BIP, adjust numbers.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    5fef61c View commit details
    Browse the repository at this point in the history
  11. codex32: rework.

    Firstly, I wanted the results easier to use:
    1. Make them always lower case, even if the string was UPPER.
    2. Decode the payload for them.
    3. Don't give the user any fields they don't need, and make
       the field sizes explicit.
    
    Secondly, I wanted to avoid the pattern of "check in one place, assume
    in another", in favour of "check on use".
    
    So, I changed the code to lower the string if it needs to at the start,
    and then changed the pull functions so we always use them to get data:
    this way we should fail clearly and gracefully if we don't have enough data.
    
    I made all the checks explicit, where we assign the fields.
    
    I also addressed the FIXME: I think the array is *often* one shorter,
    but not always, so I trim the last byte at the end if needed.
    
    [ Aditya modified the tests to work ]
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    40701a0 View commit details
    Browse the repository at this point in the history