diff options
author | Ulf Möller <ulf@openssl.org> | 2000-01-21 01:15:56 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 2000-01-21 01:15:56 +0000 |
commit | e7f97e2d22e386df60c8da63277727a931bf22b7 (patch) | |
tree | 45c42494189d95fada508ac3ff806dee37c00d22 /apps/enc.c | |
parent | 731d9c5fb5d0535e3c84866e3c355cbf21a92a67 (diff) |
Check RAND_bytes() return value or use RAND_pseudo_bytes().
Diffstat (limited to 'apps/enc.c')
-rw-r--r-- | apps/enc.c | 6 |
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, |