Add documentation on the added functionality in 'openssl ca'.
[openssl.git] / apps / genrsa.c
index dbc23e40aa85f46afd009cc5d8a262c8b8b5aaa7..0ce23946ef5b2cb9ac3775a312a28524249e193b 100644 (file)
  * [including the GNU Public Licence.]
  */
 
+/* Until the key-gen callbacks are modified to use newer prototypes, we allow
+ * deprecated functions for openssl-internal code */
+#ifdef OPENSSL_NO_DEPRECATED
+#undef OPENSSL_NO_DEPRECATED
+#endif
+
 #ifndef OPENSSL_NO_RSA
 #include <stdio.h>
 #include <string.h>
@@ -81,7 +87,9 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
+#ifndef OPENSSL_NO_ENGINE
        ENGINE *e = NULL;
+#endif
        int ret=1;
        RSA *rsa=NULL;
        int i,num=DEFBITS;
@@ -90,7 +98,9 @@ int MAIN(int argc, char **argv)
        unsigned long f4=RSA_F4;
        char *outfile=NULL;
        char *passargout = NULL, *passout = NULL;
+#ifndef OPENSSL_NO_ENGINE
        char *engine=NULL;
+#endif
        char *inrand=NULL;
        BIO *out=NULL;
 
@@ -122,11 +132,13 @@ int MAIN(int argc, char **argv)
                        f4=3;
                else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
                        f4=RSA_F4;
+#ifndef OPENSSL_NO_ENGINE
                else if (strcmp(*argv,"-engine") == 0)
                        {
                        if (--argc < 1) goto bad;
                        engine= *(++argv);
                        }
+#endif
                else if (strcmp(*argv,"-rand") == 0)
                        {
                        if (--argc < 1) goto bad;
@@ -177,7 +189,9 @@ bad:
                BIO_printf(bio_err," -passout arg    output file pass phrase source\n");
                BIO_printf(bio_err," -f4             use F4 (0x10001) for the E value\n");
                BIO_printf(bio_err," -3              use 3 for the E value\n");
+#ifndef OPENSSL_NO_ENGINE
                BIO_printf(bio_err," -engine e       use engine e, possibly a hardware device.\n");
+#endif
                BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
                BIO_printf(bio_err,"                 load the file (or the files in the directory) into\n");
                BIO_printf(bio_err,"                 the random number generator\n");
@@ -191,7 +205,9 @@ bad:
                goto err;
        }
 
+#ifndef OPENSSL_NO_ENGINE
         e = setup_engine(bio_err, engine, 0);
+#endif
 
        if (outfile == NULL)
                {