Produce PEM we would consume.
[openssl.git] / apps / ecparam.c
index 167fd1faaa66ee82f2284ca81bb292b04d582eb1..50eef797ccd36003e573d97433e269cd397517d4 100644 (file)
@@ -68,6 +68,8 @@
  * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
  *
  */
+
+#include <openssl/opensslconf.h>
 #ifndef OPENSSL_NO_EC
 #include <assert.h>
 #include <stdio.h>
@@ -127,9 +129,6 @@ int MAIN(int argc, char **argv)
        char    *infile = NULL, *outfile = NULL, *prog;
        BIO     *in = NULL, *out = NULL;
        int     informat, outformat, noout = 0, C = 0, ret = 1;
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE  *e = NULL;
-#endif
        char    *engine = NULL;
 
        BIGNUM  *ec_p = NULL, *ec_a = NULL, *ec_b = NULL,
@@ -338,7 +337,7 @@ bad:
                }
 
 #ifndef OPENSSL_NO_ENGINE
-       e = setup_engine(bio_err, engine, 0);
+       setup_engine(bio_err, engine, 0);
 #endif
 
        if (list_curves)
@@ -403,6 +402,9 @@ bad:
                        }
                else
                        nid = OBJ_sn2nid(curve_name);
+
+               if (nid == 0)
+                       nid = EC_curve_nist2nid(curve_name);
        
                if (nid == 0)
                        {
@@ -723,4 +725,10 @@ static int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
        BIO_printf(out, "\n\t};\n\n");
        return 1;
        }
+#else /* !OPENSSL_NO_EC */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
+
 #endif