Small change to accept the command line parameter '-rand file'. This
parameter takes precedence over the RANDFILE option in the configuration file.
This commit is contained in:
parent
4dd4535441
commit
ac57d15b75
13
apps/req.c
13
apps/req.c
@ -156,6 +156,7 @@ int MAIN(int argc, char **argv)
|
|||||||
char *req_exts = NULL;
|
char *req_exts = NULL;
|
||||||
EVP_CIPHER *cipher=NULL;
|
EVP_CIPHER *cipher=NULL;
|
||||||
int modulus=0;
|
int modulus=0;
|
||||||
|
char *inrand=NULL;
|
||||||
char *passargin = NULL, *passargout = NULL;
|
char *passargin = NULL, *passargout = NULL;
|
||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
char *p;
|
char *p;
|
||||||
@ -239,6 +240,11 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passargout= *(++argv);
|
passargout= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
inrand= *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-newkey") == 0)
|
else if (strcmp(*argv,"-newkey") == 0)
|
||||||
{
|
{
|
||||||
int is_numeric;
|
int is_numeric;
|
||||||
@ -542,7 +548,12 @@ bad:
|
|||||||
|
|
||||||
if (newreq && (pkey == NULL))
|
if (newreq && (pkey == NULL))
|
||||||
{
|
{
|
||||||
char *randfile = CONF_get_string(req_conf,SECTION,"RANDFILE");
|
char *randfile;
|
||||||
|
|
||||||
|
if (inrand)
|
||||||
|
randfile = inrand;
|
||||||
|
else
|
||||||
|
randfile = CONF_get_string(req_conf,SECTION,"RANDFILE");
|
||||||
app_RAND_load_file(randfile, bio_err, 0);
|
app_RAND_load_file(randfile, bio_err, 0);
|
||||||
|
|
||||||
if (newkey <= 0)
|
if (newkey <= 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user