X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Freq.c;h=ce0fcbcb3b3c3d13ecb02b3db0e72f3053702f1f;hb=d40a1f72b6a298ee34c9de2c96b222d70609ce4c;hp=a16febd6c7115f998027d164a35c282ee956beb9;hpb=902c6b95a3a3dbf7e5e3dd4b11ec58300ccb8a97;p=oweals%2Fopenssl.git diff --git a/apps/req.c b/apps/req.c index a16febd6c7..ce0fcbcb3b 100644 --- a/apps/req.c +++ b/apps/req.c @@ -126,8 +126,8 @@ typedef enum OPTION_choice { OPT_PKEYOPT, OPT_SIGOPT, OPT_BATCH, OPT_NEWHDR, OPT_MODULUS, OPT_VERIFY, OPT_NODES, OPT_NOOUT, OPT_VERBOSE, OPT_UTF8, OPT_NAMEOPT, OPT_REQOPT, OPT_SUBJ, OPT_SUBJECT, OPT_TEXT, OPT_X509, - OPT_ASN1_KLUDGE, OPT_NO_ASN1_KLUDGE, OPT_MULTIVALUE_RDN, - OPT_DAYS, OPT_SET_SERIAL, OPT_EXTENSIONS, OPT_REQEXTS, OPT_MD + OPT_MULTIVALUE_RDN, OPT_DAYS, OPT_SET_SERIAL, OPT_EXTENSIONS, + OPT_REQEXTS, OPT_MD } OPTION_CHOICE; OPTIONS req_options[] = { @@ -163,10 +163,7 @@ OPTIONS req_options[] = { {"text", OPT_TEXT, '-', "Text form of request"}, {"x509", OPT_X509, '-', "Output a x509 structure instead of a cert request"}, - {"asn1-kludge", OPT_ASN1_KLUDGE, '-', - "Output the request in a format that is wrong"}, {OPT_MORE_STR, 1, 1, "(Required by some CA's)"}, - {"no-asn1-kludge", OPT_NO_ASN1_KLUDGE, '-'}, {"subj", OPT_SUBJ, 's', "Set or modify request subject"}, {"subject", OPT_SUBJECT, '-', "Output the request's subject"}, {"multivalue-rdn", OPT_MULTIVALUE_RDN, '-', @@ -208,7 +205,7 @@ int req_main(int argc, char **argv) int pkey_type = -1, private = 0; int informat = FORMAT_PEM, outformat = FORMAT_PEM, keyform = FORMAT_PEM; int modulus = 0, multirdn = 0, verify = 0, noout = 0, text = 0; - int nodes = 0, kludge = 0, newhdr = 0, subject = 0, pubkey = 0; + int nodes = 0, newhdr = 0, subject = 0, pubkey = 0; long newkey = -1; unsigned long chtype = MBSTRING_ASC, nmflag = 0, reqflag = 0; char nmflag_set = 0; @@ -338,12 +335,6 @@ int req_main(int argc, char **argv) case OPT_X509: x509 = 1; break; - case OPT_ASN1_KLUDGE: - kludge = 1; - break; - case OPT_NO_ASN1_KLUDGE: - kludge = 0; - break; case OPT_DAYS: days = atoi(opt_arg()); break; @@ -575,7 +566,7 @@ int req_main(int argc, char **argv) BIO_printf(bio_err, "writing new private key to stdout\n"); else BIO_printf(bio_err, "writing new private key to '%s'\n", keyout); - out = bio_open_owner(keyout, "w", private); + out = bio_open_owner(keyout, outformat, private); if (out == NULL) goto end; @@ -610,12 +601,7 @@ int req_main(int argc, char **argv) } if (!newreq) { - /* - * Since we are using a pre-existing certificate request, the kludge - * 'format' info should not be changed. - */ - kludge = -1; - in = bio_open_default(infile, RB(informat)); + in = bio_open_default(infile, 'r', informat); if (in == NULL) goto end; @@ -643,11 +629,6 @@ int req_main(int argc, char **argv) i = make_REQ(req, pkey, subj, multirdn, !x509, chtype); subj = NULL; /* done processing '-subj' option */ - if ((kludge > 0) - && !sk_X509_ATTRIBUTE_num(req->req_info->attributes)) { - sk_X509_ATTRIBUTE_free(req->req_info->attributes); - req->req_info->attributes = NULL; - } if (!i) { BIO_printf(bio_err, "problems making Certificate Request\n"); goto end; @@ -745,8 +726,6 @@ int req_main(int argc, char **argv) goto end; } - req->req_info->enc.modified = 1; - if (verbose) { print_name(bio_err, "new subject=", X509_REQ_get_subject_name(req), nmflag); @@ -785,7 +764,8 @@ int req_main(int argc, char **argv) out = bio_open_default(outfile, keyout != NULL && outfile != NULL && - strcmp(keyout, outfile) == 0 ? "a" : "w"); + strcmp(keyout, outfile) == 0 ? 'a' : 'w', + outformat); if (out == NULL) goto end;