Modify "openssl engine" to handle and display internal control
[openssl.git] / apps / gendh.c
index 0b47867c2036289cb5144b60f29d73bd331e436f..14928d84a3e724b9378ed462463092a9515c5a41 100644 (file)
@@ -143,23 +143,7 @@ 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);
-               }
+        e = setup_engine(bio_err, engine, 0);
 
        out=BIO_new(BIO_s_file());
        if (out == NULL)