projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Document the changed HMAC API.
[openssl.git]
/
apps
/
gendsa.c
diff --git
a/apps/gendsa.c
b/apps/gendsa.c
index 01bbcebf0eeae73f422ef2f6c4b56182ec0039ff..9259c6ccaad4a7346221221a9263d468a9cbb3d3 100644
(file)
--- a/
apps/gendsa.c
+++ b/
apps/gendsa.c
@@
-69,8
+69,6
@@
# include <openssl/x509.h>
# include <openssl/pem.h>
# include <openssl/x509.h>
# include <openssl/pem.h>
-# define DEFBITS 512
-
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
OPT_OUT, OPT_PASSOUT, OPT_ENGINE, OPT_RAND, OPT_CIPHER
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
OPT_OUT, OPT_PASSOUT, OPT_ENGINE, OPT_RAND, OPT_CIPHER
@@
-99,7
+97,7
@@
int gendsa_main(int argc, char **argv)
char *inrand = NULL, *dsaparams = NULL;
char *outfile = NULL, *passoutarg = NULL, *passout = NULL, *prog;
OPTION_CHOICE o;
char *inrand = NULL, *dsaparams = NULL;
char *outfile = NULL, *passoutarg = NULL, *passout = NULL, *prog;
OPTION_CHOICE o;
- int ret = 1;
+ int ret = 1
, private = 0
;
prog = opt_init(argc, argv, gendsa_options);
while ((o = opt_next()) != OPT_EOF) {
prog = opt_init(argc, argv, gendsa_options);
while ((o = opt_next()) != OPT_EOF) {
@@
-133,6
+131,7
@@
int gendsa_main(int argc, char **argv)
}
argc = opt_num_rest();
argv = opt_rest();
}
argc = opt_num_rest();
argv = opt_rest();
+ private = 1;
if (argc != 1)
goto opthelp;
if (argc != 1)
goto opthelp;
@@
-143,10
+142,7
@@
int gendsa_main(int argc, char **argv)
goto end;
}
goto end;
}
- if (!app_load_modules(NULL))
- goto end;
-
- in = bio_open_default(dsaparams, "r");
+ in = bio_open_default(dsaparams, 'r', FORMAT_PEM);
if (in == NULL)
goto end2;
if (in == NULL)
goto end2;
@@
-157,7
+153,7
@@
int gendsa_main(int argc, char **argv)
BIO_free(in);
in = NULL;
BIO_free(in);
in = NULL;
- out = bio_open_
default(outfile, "w"
);
+ out = bio_open_
owner(outfile, FORMAT_PEM, private
);
if (out == NULL)
goto end2;
if (out == NULL)
goto end2;
@@
-175,6
+171,7
@@
int gendsa_main(int argc, char **argv)
app_RAND_write_file(NULL);
app_RAND_write_file(NULL);
+ assert(private);
if (!PEM_write_bio_DSAPrivateKey(out, dsa, enc, NULL, 0, NULL, passout))
goto end;
ret = 0;
if (!PEM_write_bio_DSAPrivateKey(out, dsa, enc, NULL, 0, NULL, passout))
goto end;
ret = 0;