summaryrefslogtreecommitdiff
path: root/src/random-seed
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-08-17 11:31:45 +0200
committerLennart Poettering <lennart@poettering.net>2022-08-19 12:53:04 +0200
commit00b4663813829ad3391d03383b82eee5d439de70 (patch)
tree6ba9f2cfaacd3720f23c953de1643104787e0fe8 /src/random-seed
parent3c4d5f2ff5ce5f69fb50ff1c5c15ba52c72395f1 (diff)
downloadsystemd-00b4663813829ad3391d03383b82eee5d439de70.tar.gz
random-seed: use SHA256_DIGEST_SIZE
Diffstat (limited to 'src/random-seed')
-rw-r--r--src/random-seed/random-seed.c2
1 files changed, 1 insertions, 1 deletions
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);