CONCERNING #8837
During the generatehsm function, when you insert the passphrase, it appears as if the input is also saved as password, so the checkhsm function works right only if you insert the same input for both password and passphrase. This is in contrast with the expected behaviour of this function, since the password and the passphrase are both optional and should be allowed to be set independently from one another.
STEP TO REPRODUCE ISSUE
1 - Create HSM using ./tools/lightning-hsmtool generatehsm /tmp/hsm_test
2 - Don't set any password (press ENTER)
3 - Insert a word when the passphrase is asked (for example "qwerty")
4 - Run ./tools/lightning-hsmtool checkhsm /tmp/hsm_test
5 - When Enter hsm_secret password: is displayed, insert password (just press ENTER because of step 2)
Expected result
lightning-hsmtool asks for mnemonic passphrase:
Enter your mnemonic passphrase:
Actual behavior
lightning-hsmtool: Wrong passphrase: Undefined error: 0
In order to make checkhsm work:
a - Run ./tools/lightning-hsmtool checkhsm /tmp/hsm_test
b - When Enter hsm_secret password: is displayed, insert the passphrase set before (in this case "qwerty", step 3)
c - When Enter your mnemonic passphrase: is displayed, insert the passphrase set in step 3 ("qwerty")
d - When Introduce your BIP39 word list separated by space (at least 12 words): is displayed, insert mnemonic (it can be get by running cat /tmp/hsm_test)
e - OK is displayed
CONCERNING #8837
During the
generatehsmfunction, when you insert the passphrase, it appears as if the input is also saved as password, so thecheckhsmfunction works right only if you insert the same input for both password and passphrase. This is in contrast with the expected behaviour of this function, since the password and the passphrase are both optional and should be allowed to be set independently from one another.STEP TO REPRODUCE ISSUE
1 - Create HSM using
./tools/lightning-hsmtool generatehsm /tmp/hsm_test2 - Don't set any password (press ENTER)
3 - Insert a word when the passphrase is asked (for example "qwerty")
4 - Run
./tools/lightning-hsmtool checkhsm /tmp/hsm_test5 - When
Enter hsm_secret password:is displayed, insert password (just press ENTER because of step 2)Expected result
lightning-hsmtoolasks for mnemonic passphrase:Enter your mnemonic passphrase:Actual behavior
lightning-hsmtool: Wrong passphrase: Undefined error: 0In order to make
checkhsmwork:a - Run
./tools/lightning-hsmtool checkhsm /tmp/hsm_testb - When
Enter hsm_secret password:is displayed, insert the passphrase set before (in this case "qwerty", step 3)c - When
Enter your mnemonic passphrase:is displayed, insert the passphrase set in step 3 ("qwerty")d - When
Introduce your BIP39 word list separated by space (at least 12 words):is displayed, insert mnemonic (it can be get by runningcat /tmp/hsm_test)e -
OKis displayed