summaryrefslogtreecommitdiff
path: root/src/lib/libssl/src/apps/rand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/src/apps/rand.c')
-rw-r--r--src/lib/libssl/src/apps/rand.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/libssl/src/apps/rand.c b/src/lib/libssl/src/apps/rand.c
index fa35505c18..44a1d46a03 100644
--- a/src/lib/libssl/src/apps/rand.c
+++ b/src/lib/libssl/src/apps/rand.c
@@ -68,8 +68,8 @@
68 68
69/* -out file - write to file 69/* -out file - write to file
70 * -rand file:file - PRNG seed files 70 * -rand file:file - PRNG seed files
71 * -base64 - encode output 71 * -base64 - base64 encode output
72 * -hex - hex encode output 72 * -hex - hex encode output
73 * num - write 'num' bytes 73 * num - write 'num' bytes
74 */ 74 */
75 75
@@ -172,7 +172,7 @@ int MAIN(int argc, char **argv)
172 BIO_printf(bio_err, "-engine e - use engine e, possibly a hardware device.\n"); 172 BIO_printf(bio_err, "-engine e - use engine e, possibly a hardware device.\n");
173#endif 173#endif
174 BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); 174 BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
175 BIO_printf(bio_err, "-base64 - encode output\n"); 175 BIO_printf(bio_err, "-base64 - base64 encode output\n");
176 BIO_printf(bio_err, "-hex - hex encode output\n"); 176 BIO_printf(bio_err, "-hex - hex encode output\n");
177 goto err; 177 goto err;
178 } 178 }
@@ -225,13 +225,15 @@ int MAIN(int argc, char **argv)
225 goto err; 225 goto err;
226 if (!hex) 226 if (!hex)
227 BIO_write(out, buf, chunk); 227 BIO_write(out, buf, chunk);
228 else { 228 else
229 int i; 229 {
230 for (i = 0; i < chunk; i++) 230 for (i = 0; i < chunk; i++)
231 BIO_printf(out, "%02x", buf[i]); 231 BIO_printf(out, "%02x", buf[i]);
232 } 232 }
233 num -= chunk; 233 num -= chunk;
234 } 234 }
235 if (hex)
236 BIO_puts(out, "\n");
235 (void)BIO_flush(out); 237 (void)BIO_flush(out);
236 238
237 app_RAND_write_file(NULL, bio_err); 239 app_RAND_write_file(NULL, bio_err);