Fix openssl passwd -1
[oweals/openssl.git] / apps / x509.c
index 87123397173906f9b03ed5da59eaa76decb79119..76dd66db86250b039e8af0a51b1a286e86d0c5ca 100644 (file)
@@ -73,7 +73,6 @@
 #include <openssl/x509v3.h>
 #include <openssl/objects.h>
 #include <openssl/pem.h>
-#include <openssl/engine.h>
 
 #undef PROG
 #define PROG x509_main
@@ -130,8 +129,6 @@ static char *x509_usage[]={
 " -extensions     - section from config file with X509V3 extensions to add\n",
 " -clrext         - delete extensions before signing and input certificate\n",
 " -nameopt arg    - various certificate name options\n",
-" -engine e       - use engine e, possibly a hardware device.\n",
-" -certopt arg    - various certificate text options\n",
 NULL
 };
 
@@ -148,7 +145,6 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
-       ENGINE *e = NULL;
        int ret=1;
        X509_REQ *req=NULL;
        X509 *x=NULL,*xca=NULL;
@@ -178,8 +174,7 @@ int MAIN(int argc, char **argv)
        char *extsect = NULL, *extfile = NULL, *passin = NULL, *passargin = NULL;
        int need_rand = 0;
        int checkend=0,checkoffset=0;
-       unsigned long nmflag = 0, certflag = 0;
-       char *engine=NULL;
+       unsigned long nmflag = 0;
 
        reqfile=0;
 
@@ -331,11 +326,6 @@ int MAIN(int argc, char **argv)
                        alias= *(++argv);
                        trustout = 1;
                        }
-               else if (strcmp(*argv,"-certopt") == 0)
-                       {
-                       if (--argc < 1) goto bad;
-                       if (!set_cert_ex(&certflag, *(++argv))) goto bad;
-                       }
                else if (strcmp(*argv,"-nameopt") == 0)
                        {
                        if (--argc < 1) goto bad;
@@ -347,11 +337,6 @@ int MAIN(int argc, char **argv)
                        alias= *(++argv);
                        trustout = 1;
                        }
-               else if (strcmp(*argv,"-engine") == 0)
-                       {
-                       if (--argc < 1) goto bad;
-                       engine= *(++argv);
-                       }
                else if (strcmp(*argv,"-C") == 0)
                        C= ++num;
                else if (strcmp(*argv,"-email") == 0)
@@ -435,24 +420,6 @@ bad:
                goto end;
                }
 
-       if (engine != NULL)
-               {
-               if((e = ENGINE_by_id(engine)) == NULL)
-                       {
-                       BIO_printf(bio_err,"invalid engine \"%s\"\n",
-                               engine);
-                       goto end;
-                       }
-               if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
-                       {
-                       BIO_printf(bio_err,"can't use that engine\n");
-                       goto end;
-                       }
-               BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
-               /* Free our "structural" reference. */
-               ENGINE_free(e);
-               }
-
        if (need_rand)
                app_RAND_load_file(NULL, bio_err, 0);
 
@@ -807,7 +774,7 @@ bad:
                                }
                        else if (text == i)
                                {
-                               X509_print_ex(out,x,nmflag, certflag);
+                               X509_print(out,x);
                                }
                        else if (startdate == i)
                                {