summaryrefslogtreecommitdiffstats
path: root/apps/enc.c
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>2000-01-21 01:15:56 +0000
committerUlf Möller <ulf@openssl.org>2000-01-21 01:15:56 +0000
commite7f97e2d22e386df60c8da63277727a931bf22b7 (patch)
tree45c42494189d95fada508ac3ff806dee37c00d22 /apps/enc.c
parent731d9c5fb5d0535e3c84866e3c355cbf21a92a67 (diff)
Check RAND_bytes() return value or use RAND_pseudo_bytes().
Diffstat (limited to 'apps/enc.c')
-rw-r--r--apps/enc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/enc.c b/apps/enc.c
index e584241bf1..ca30276d29 100644
--- a/apps/enc.c
+++ b/apps/enc.c
@@ -448,7 +448,11 @@ bad:
"invalid hex salt value\n");
goto end;
}
- } else RAND_bytes(salt, PKCS5_SALT_LEN);
+ } else if (RAND_bytes(salt, PKCS5_SALT_LEN) <= 0) {
+ BIO_printf(bio_err,
+ "prng not seeded\n");
+ goto end;
+ }
/* If -P option then don't bother writing */
if((printkey != 2)
&& (BIO_write(wbio,magic,