#include <openssl/dh.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
-#include <openssl/rand.h>
#ifndef NO_DSA
#include <openssl/dsa.h>
BIO *in=NULL,*out=NULL;
int informat,outformat,check=0,noout=0,C=0,ret=1;
char *infile,*outfile,*prog;
- char *inrand=NULL, *inegd=NULL;
+ char *inrand=NULL;
int num = 0, g = 0;
apps_startup();
if (--argc < 1) goto bad;
inrand= *(++argv);
}
- else if (strcmp(*argv,"-egd") == 0)
- {
- if (--argc < 1) goto bad;
- inegd= *(++argv);
- }
else if (((sscanf(*argv,"%d",&num) == 0) || (num <= 0)))
goto bad;
argv++;
BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n");
BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n");
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
- BIO_printf(bio_err," load the file (or the files in the directory) into\n");
+ BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
BIO_printf(bio_err," the random number generator\n");
- BIO_printf(bio_err," -egd file load random seed from EGD socket\n");
BIO_printf(bio_err," -noout no output\n");
goto end;
}
if(num) {
- if (!app_RAND_load_file(NULL, bio_err, 1)
- && inrand == NULL && inegd == NULL)
+ if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
{
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
}
if (inrand != NULL)
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
app_RAND_load_files(inrand));
- if (inegd != NULL)
- BIO_printf(bio_err,"%ld egd bytes loaded\n",
- RAND_egd(inegd));
#ifndef NO_DSA
if (dsaparam)
goto end;
}
if (outfile == NULL)
+ {
BIO_set_fp(out,stdout,BIO_NOCLOSE);
+#ifdef VMS
+ {
+ BIO *tmpbio = BIO_new(BIO_f_linebuffer());
+ out = BIO_push(tmpbio, out);
+ }
+#endif
+ }
else
{
if (BIO_write_filename(out,outfile) <= 0)
ret=0;
end:
if (in != NULL) BIO_free(in);
- if (out != NULL) BIO_free(out);
+ if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh);
EXIT(ret);
}