Standardize apps use of -rand, etc.
authorRich Salz <rsalz@openssl.org>
Wed, 5 Jul 2017 14:58:48 +0000 (10:58 -0400)
committerRich Salz <rsalz@openssl.org>
Sun, 16 Jul 2017 23:20:45 +0000 (19:20 -0400)
commit3ee1eac27a2e3120fbdc60e12db091c082b8de21
treec34ee07aa725e2019dbce1f7621702eb2bb5fd69
parente90fc053c33a2241004451cfdeecfbf3cbdeb728
Standardize apps use of -rand, etc.

Standardized the -rand flag and added a new one:
    -rand file...
            Always reads the specified files
    -writerand file
            Always writes to the file on exit

For apps that use a config file, the RANDFILE config parameter reads
the file at startup (to seed the RNG) and write to it on exit if
the -writerand flag isn't used.

Ensured that every app that took -rand also took -writerand, and
made sure all of that agreed with all the documentation.

Fix error reporting in write_file and -rand

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/3862)
49 files changed:
apps/app_rand.c
apps/apps.h
apps/ca.c
apps/cms.c
apps/dgst.c
apps/dhparam.c
apps/dsaparam.c
apps/ecparam.c
apps/enc.c
apps/gendsa.c
apps/genrsa.c
apps/openssl.c
apps/passwd.c
apps/pkcs12.c
apps/pkcs8.c
apps/pkeyutl.c
apps/rand.c
apps/req.c
apps/rsautl.c
apps/s_client.c
apps/s_server.c
apps/smime.c
apps/speed.c
apps/srp.c
apps/ts.c
apps/x509.c
crypto/rand/randfile.c
doc/man1/ca.pod
doc/man1/cms.pod
doc/man1/dgst.pod
doc/man1/dhparam.pod
doc/man1/dsaparam.pod
doc/man1/ecparam.pod
doc/man1/enc.pod
doc/man1/gendsa.pod
doc/man1/genrsa.pod
doc/man1/passwd.pod
doc/man1/pkcs12.pod
doc/man1/pkcs8.pod
doc/man1/pkeyutl.pod
doc/man1/rand.pod
doc/man1/req.pod
doc/man1/rsautl.pod
doc/man1/s_client.pod
doc/man1/s_server.pod
doc/man1/smime.pod
doc/man1/speed.pod
doc/man1/ts.pod
doc/man1/x509.pod