diff options
author | Rich Salz <rsalz@openssl.org> | 2017-07-05 16:58:48 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-07-17 01:20:45 +0200 |
commit | 3ee1eac27a2e3120fbdc60e12db091c082b8de21 (patch) | |
tree | c34ee07aa725e2019dbce1f7621702eb2bb5fd69 /apps/passwd.c | |
parent | Don't use "version" in "OpenSSL Version 1.1.0" etc (diff) | |
download | openssl-3ee1eac27a2e3120fbdc60e12db091c082b8de21.tar.xz openssl-3ee1eac27a2e3120fbdc60e12db091c082b8de21.zip |
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)
Diffstat (limited to 'apps/passwd.c')
-rw-r--r-- | apps/passwd.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/passwd.c b/apps/passwd.c index 7ce40e058c..eb5a622af7 100644 --- a/apps/passwd.c +++ b/apps/passwd.c @@ -65,7 +65,8 @@ typedef enum OPTION_choice { OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, OPT_IN, OPT_NOVERIFY, OPT_QUIET, OPT_TABLE, OPT_REVERSE, OPT_APR1, - OPT_1, OPT_5, OPT_6, OPT_CRYPT, OPT_AIXMD5, OPT_SALT, OPT_STDIN + OPT_1, OPT_5, OPT_6, OPT_CRYPT, OPT_AIXMD5, OPT_SALT, OPT_STDIN, + OPT_R_ENUM, } OPTION_CHOICE; const OPTIONS passwd_options[] = { @@ -90,6 +91,7 @@ const OPTIONS passwd_options[] = { # ifndef OPENSSL_NO_DES {"crypt", OPT_CRYPT, '-', "Standard Unix password algorithm (default)"}, # endif + OPT_R_OPTIONS, {NULL} }; @@ -182,6 +184,10 @@ int passwd_main(int argc, char **argv) in_stdin = 1; pw_source_defined = 1; break; + case OPT_R_CASES: + if (!opt_rand(o)) + goto end; + break; } } argc = opt_num_rest(); |