rgb-cln/hsmd
darosior d393cda215 hsmd: encrypt hsm_secret if 'lightningd' pass an encryption key
This splits maybe_create_hsm_secret() in two parts (either encrypted
or in clear) for clarity, and adds an encryption detection in load_hsm().
There are actually three cases if an encryption key is passed:
- There is no hsm_secret => just create it and store the encrypted seed
- There is an encrypted hsm_secret => the provided key should be able to
decrypt the seed, if the wrong key is passed libsodium will nicely error
and hsmd will exit() to not throw a backtrace (using status_failed() as for
other errors) at the face of an user who mistyped its password.
- There is a non-encrypted hsm_secret => load the seed, delete the
hsm_secret, create the hsm_secret, store the encrypted seed.
2019-10-09 22:00:38 -05:00
..
Makefile wire: use common/bigsize routines 2019-07-31 23:25:59 +00:00
capabilities.h hsmd: add message to sign the mutual close transaction. 2018-07-24 00:40:01 +02:00
hsm_wire.csv lightningd: pass the hsm_secret encryption key in hsm_init 2019-10-09 22:00:38 -05:00
hsmd.c hsmd: encrypt hsm_secret if 'lightningd' pass an encryption key 2019-10-09 22:00:38 -05:00