fuzz: fix fuzzing compilation.

It had bitrotted.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-07-25 16:29:09 +09:30
committed by neil saitug
parent 7bbfef5054
commit 8f6afedafe
5 changed files with 8 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ void run(const uint8_t *data, size_t size)
struct secret *hsm_secret, decrypted_hsm_secret, encryption_key;
char *passphrase;
struct encrypted_hsm_secret encrypted_secret;
char *emsg;
/* Take the first 32 bytes as the plaintext hsm_secret seed,
* and the remaining ones as the passphrase. */
@@ -24,7 +25,7 @@ void run(const uint8_t *data, size_t size)
passphrase = to_string(NULL, data + 32, size - 32);
/* A valid seed, a valid passphrase. This should not fail. */
assert(!hsm_secret_encryption_key(passphrase, &encryption_key));
assert(!hsm_secret_encryption_key_with_exitcode(passphrase, &encryption_key, &emsg));
/* Roundtrip */
assert(encrypt_hsm_secret(&encryption_key, hsm_secret,
&encrypted_secret));