diff options
author | Rich Salz <rsalz@akamai.com> | 2020-11-11 18:03:38 -0500 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-11-13 14:45:22 +0100 |
commit | 1696b8909bbe1485871ce68ed129bf91af5e17e2 (patch) | |
tree | 6a18dba8afb0297ed730c3acc15c60065d823b2a /apps/dsaparam.c | |
parent | 256d41d4371720ccfe1a4fead6bd28ed5071bcdd (diff) |
Remove -C from dhparam,dsaparam,ecparam
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13384)
Diffstat (limited to 'apps/dsaparam.c')
-rw-r--r-- | apps/dsaparam.c | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/apps/dsaparam.c b/apps/dsaparam.c index 06d1b95902..8bbd65700d 100644 --- a/apps/dsaparam.c +++ b/apps/dsaparam.c @@ -28,7 +28,7 @@ static int gendsa_cb(EVP_PKEY_CTX *ctx); typedef enum OPTION_choice { OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, - OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_TEXT, OPT_C, + OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_TEXT, OPT_NOOUT, OPT_GENKEY, OPT_ENGINE, OPT_VERBOSE, OPT_R_ENUM, OPT_PROV_ENUM } OPTION_CHOICE; @@ -50,7 +50,6 @@ const OPTIONS dsaparam_options[] = { {"out", OPT_OUT, '>', "Output file"}, {"outform", OPT_OUTFORM, 'F', "Output format - DER or PEM"}, {"text", OPT_TEXT, '-', "Print as text"}, - {"C", OPT_C, '-', "Output C code"}, {"noout", OPT_NOOUT, '-', "No output"}, {"verbose", OPT_VERBOSE, '-', "Verbose output"}, {"genkey", OPT_GENKEY, '-', "Generate a DSA key"}, @@ -70,7 +69,7 @@ int dsaparam_main(int argc, char **argv) EVP_PKEY *params = NULL, *pkey = NULL; EVP_PKEY_CTX *ctx = NULL; int numbits = -1, num = 0, genkey = 0; - int informat = FORMAT_PEM, outformat = FORMAT_PEM, noout = 0, C = 0; + int informat = FORMAT_PEM, outformat = FORMAT_PEM, noout = 0; int ret = 1, i, text = 0, private = 0; char *infile = NULL, *outfile = NULL, *prog; OPTION_CHOICE o; @@ -107,9 +106,6 @@ int dsaparam_main(int argc, char **argv) case OPT_TEXT: text = 1; break; - case OPT_C: - C = 1; - break; case OPT_GENKEY: genkey = 1; break; @@ -190,47 +186,6 @@ int dsaparam_main(int argc, char **argv) EVP_PKEY_print_params(out, params, 0, NULL); } - if (C) { - BIGNUM *p = NULL, *q = NULL, *g = NULL; - unsigned char *data; - int len, bits_p; - - EVP_PKEY_get_bn_param(params, "p", &p); - EVP_PKEY_get_bn_param(params, "q", &q); - EVP_PKEY_get_bn_param(params, "g", &g); - len = BN_num_bytes(p); - bits_p = BN_num_bits(p); - - data = app_malloc(len + 20, "BN space"); - - BIO_printf(bio_out, "static DSA *get_dsa%d(void)\n{\n", bits_p); - print_bignum_var(bio_out, p, "dsap", bits_p, data); - print_bignum_var(bio_out, q, "dsaq", bits_p, data); - print_bignum_var(bio_out, g, "dsag", bits_p, data); - BN_free(p); - BN_free(q); - BN_free(g); - BIO_printf(bio_out, " DSA *dsa = DSA_new();\n" - " BIGNUM *p, *q, *g;\n" - "\n"); - BIO_printf(bio_out, " if (dsa == NULL)\n" - " return NULL;\n"); - BIO_printf(bio_out, " if (!DSA_set0_pqg(dsa, p = BN_bin2bn(dsap_%d, sizeof(dsap_%d), NULL),\n", - bits_p, bits_p); - BIO_printf(bio_out, " q = BN_bin2bn(dsaq_%d, sizeof(dsaq_%d), NULL),\n", - bits_p, bits_p); - BIO_printf(bio_out, " g = BN_bin2bn(dsag_%d, sizeof(dsag_%d), NULL))) {\n", - bits_p, bits_p); - BIO_printf(bio_out, " DSA_free(dsa);\n" - " BN_free(p);\n" - " BN_free(q);\n" - " BN_free(g);\n" - " return NULL;\n" - " }\n" - " return dsa;\n}\n"); - OPENSSL_free(data); - } - if (outformat == FORMAT_ASN1 && genkey) noout = 1; |