]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
random-seed: use SHA256_DIGEST_SIZE
authorLennart Poettering <lennart@poettering.net>
Wed, 17 Aug 2022 09:31:45 +0000 (11:31 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 19 Aug 2022 10:53:04 +0000 (12:53 +0200)
src/random-seed/random-seed.c

index b265b7f85cdbe98cf559c6963d13cd6de0c70155..dedbdb2667bc1742a0b342d38c1cdfc6cec5ae06 100644 (file)
@@ -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);