From: Lennart Poettering Date: Wed, 17 Aug 2022 09:31:45 +0000 (+0200) Subject: random-seed: use SHA256_DIGEST_SIZE X-Git-Tag: v252-rc1~407^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00b4663813829ad3391d03383b82eee5d439de70;p=thirdparty%2Fsystemd.git random-seed: use SHA256_DIGEST_SIZE --- diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c index b265b7f85cd..dedbdb2667b 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);