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: fix hsm_secret generation #4304

Merged
merged 2 commits into from
Jan 4, 2021

Conversation

darosior
Copy link
Collaborator

@darosior darosior commented Jan 3, 2021

Based on #4284 , fixes #4302 .

Copy link
Member

@cdecker cdecker left a comment

Choose a reason for hiding this comment

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

ACK 6455c90

tests/test_wallet.py Outdated Show resolved Hide resolved
tools/hsmtool.c Show resolved Hide resolved
Fixes ElementsProject#4302
Changelog-fixed: hsmtool: the `generatehsm` command now generates an appropriately-sized hsm_secret
Signed-off-by: Antoine Poinsot <[email protected]>
@cdecker
Copy link
Member

cdecker commented Jan 4, 2021

Rebased on top of #4303

ACK dbbcc27

@cdecker cdecker merged commit 19afe15 into ElementsProject:master Jan 4, 2021
@darosior darosior deleted the fix_generatehsm branch January 4, 2021 18:20
Copy link
Collaborator

@jsarenik jsarenik left a comment

Choose a reason for hiding this comment

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

Sorry I noticed just now, but the hsm_secret contains 32 bytes of binary, not plaintext.

@@ -530,7 +532,9 @@ static int generate_hsm(const char *hsm_secret_path)
if (fd < 0) {
errx(ERROR_USAGE, "Unable to create hsm_secret file");
}
if (!write_all(fd, bip32_seed, bip32_seed_len))
/* Write only the first 32 bytes, length of the (plaintext) seed in the
Copy link
Collaborator

Choose a reason for hiding this comment

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

plaintext?

@darosior
Copy link
Collaborator Author

darosior commented Mar 9, 2021 via email

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.

hsmtool: generatehsm does not generate a valid hsm_secret (anymore?)
3 participants