From 00b4663813829ad3391d03383b82eee5d439de70 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 17 Aug 2022 11:31:45 +0200 Subject: [PATCH] random-seed: use SHA256_DIGEST_SIZE --- src/random-seed/random-seed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c index b265b7f85c..dedbdb2667 100644 --- a/src/random-seed/random-seed.c +++ b/src/random-seed/random-seed.c @@ -293,7 +293,7 @@ static int run(int argc, char *argv[]) { * and replace the last 32 bytes of the seed with the hash output, so that the * new seed file can't regress in entropy. */ if (hashed_old_seed) { - uint8_t hash[32]; + uint8_t hash[SHA256_DIGEST_SIZE]; sha256_process_bytes(&k, sizeof(k), &hash_state); /* Hash length to distinguish from old seed. */ sha256_process_bytes(buf, k, &hash_state); sha256_finish_ctx(&hash_state, hash); -- 2.25.1