diff options
author | 2022-03-24 09:49:44 +0100 | |
---|---|---|
committer | 2022-03-26 00:10:09 -0600 | |
commit | da63c26e6c8bce8ba908e10ac93c1dc7a984d93c (patch) | |
tree | 1f046d9138c5d351408d6022c2638acf9d642bda | |
parent | Initial commit (diff) | |
download | seedrng-da63c26e6c8bce8ba908e10ac93c1dc7a984d93c.tar.xz seedrng-da63c26e6c8bce8ba908e10ac93c1dc7a984d93c.zip |
Send informational messages on stdout
Currently, the messages about saving the seed or seeding the RNG are
sent to stderr, but they are informational messages we want to see when
the program works as expected; only error messages should be directed to
stderr.
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | seedrng.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -347,7 +347,7 @@ static int seed_from_file_if_exists(const char *filename, bool credit, struct bl blake2s_update(hash, &seed_len, sizeof(seed_len)); blake2s_update(hash, seed, seed_len); - fprintf(stderr, "Seeding %zd bits %s crediting\n", seed_len * 8, credit ? "and" : "without"); + fprintf(stdout, "Seeding %zd bits %s crediting\n", seed_len * 8, credit ? "and" : "without"); ret = seed_rng(seed, seed_len, credit); if (ret < 0) fprintf(stderr, "ERROR: Unable to seed: %s\n", strerror(-ret)); @@ -408,7 +408,7 @@ int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused))) blake2s_update(&hash, new_seed, new_seed_len); blake2s_final(&hash, new_seed + new_seed_len - BLAKE2S_HASH_LEN); - fprintf(stderr, "Saving %zu bits of %s seed for next boot\n", new_seed_len * 8, new_seed_creditable ? "creditable" : "non-creditable"); + fprintf(stdout, "Saving %zu bits of %s seed for next boot\n", new_seed_len * 8, new_seed_creditable ? "creditable" : "non-creditable"); fd = open(NON_CREDITABLE_SEED, O_WRONLY | O_CREAT | O_TRUNC, 0400); if (fd < 0) { fprintf(stderr, "ERROR: Unable to open seed file for writing: %s\n", strerror(errno)); |