version 1.7, 2015/08/22 16:36:05 |
version 1.8, 2015/09/11 14:30:23 |
|
|
|
|
struct { |
struct { |
int base64; |
int base64; |
char *engine; |
|
int hex; |
int hex; |
char *outfile; |
char *outfile; |
} rand_config; |
} rand_config; |
|
|
.type = OPTION_FLAG, |
.type = OPTION_FLAG, |
.opt.flag = &rand_config.base64, |
.opt.flag = &rand_config.base64, |
}, |
}, |
#ifndef OPENSSL_NO_ENGINE |
|
{ |
{ |
.name = "engine", |
|
.argname = "id", |
|
.desc = "Use the engine specified by the given identifier", |
|
.type = OPTION_ARG, |
|
.opt.arg = &rand_config.engine, |
|
}, |
|
#endif |
|
{ |
|
.name = "hex", |
.name = "hex", |
.desc = "Hexadecimal output", |
.desc = "Hexadecimal output", |
.type = OPTION_FLAG, |
.type = OPTION_FLAG, |
|
|
rand_usage() |
rand_usage() |
{ |
{ |
fprintf(stderr, |
fprintf(stderr, |
"usage: rand [-base64 | -hex] [-engine id] [-out file] num\n"); |
"usage: rand [-base64 | -hex] [-out file] num\n"); |
options_usage(rand_options); |
options_usage(rand_options); |
} |
} |
|
|
|
|
rand_usage(); |
rand_usage(); |
goto err; |
goto err; |
} |
} |
|
|
#ifndef OPENSSL_NO_ENGINE |
|
setup_engine(bio_err, rand_config.engine, 0); |
|
#endif |
|
|
|
out = BIO_new(BIO_s_file()); |
out = BIO_new(BIO_s_file()); |
if (out == NULL) |
if (out == NULL) |