Get rid of some unnecessary casts and add a necessary one.
[oweals/openssl.git] / apps / x509.c
index 210a25fb09b5cc62089b8379316c1d46567ca4e4..cc4824786259a559cc57c4f257481cf2086f2e42 100644 (file)
@@ -114,7 +114,7 @@ static char *x509_usage[]={
 " -text           - print the certificate in text form\n",
 " -C              - print out C code forms\n",
 " -md2/-md5/-sha1/-mdc2 - digest to do an RSA sign with\n",
-" -config         - configuration file with X509V3 extensions to add\n",
+" -extfile        - configuration file with X509V3 extensions to add\n",
 NULL
 };
 
@@ -213,7 +213,7 @@ int MAIN(int argc, char **argv)
                                goto bad;
                                }
                        }
-               else if (strcmp(*argv,"-config") == 0)
+               else if (strcmp(*argv,"-extfile") == 0)
                        {
                        if (--argc < 1) goto bad;
                        extfile= *(++argv);
@@ -323,7 +323,7 @@ bad:
 
        if (extfile) {
                long errorline;
-               X509V3_CTX ctx;
+               X509V3_CTX ctx2;
                if (!(extconf=CONF_load(NULL,extfile,&errorline))) {
                        if (errorline <= 0)
                                BIO_printf(bio_err,
@@ -337,9 +337,9 @@ bad:
                }
                if(!(extsect = CONF_get_string(extconf, "default",
                                         "extensions"))) extsect = "default";
-               X509V3_set_ctx_test(&ctx);
-               X509V3_set_conf_lhash(&ctx, extconf);
-               if(!X509V3_EXT_add_conf(extconf, &ctx, extsect, NULL)) {
+               X509V3_set_ctx_test(&ctx2);
+               X509V3_set_conf_lhash(&ctx2, extconf);
+               if(!X509V3_EXT_add_conf(extconf, &ctx2, extsect, NULL)) {
                        BIO_printf(bio_err,
                                "Error Loading extension section %s\n",
                                                                 extsect);
@@ -868,11 +868,11 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
        EVP_PKEY_free(upkey);
 
        if(conf) {
-               X509V3_CTX ctx;
+               X509V3_CTX ctx2;
                X509_set_version(x,2); /* version 3 certificate */
-                X509V3_set_ctx(&ctx, xca, x, NULL, NULL, 0);
-                X509V3_set_conf_lhash(&ctx, conf);
-                if(!X509V3_EXT_add_conf(conf, &ctx, section, x)) goto end;
+                X509V3_set_ctx(&ctx2, xca, x, NULL, NULL, 0);
+                X509V3_set_conf_lhash(&ctx2, conf);
+                if(!X509V3_EXT_add_conf(conf, &ctx2, section, x)) goto end;
        }
 
        if (!X509_sign(x,pkey,digest)) goto end;