Multi valued AVA support.
[openssl.git] / apps / openssl.c
index 895d8f76b24f5cedd8110e09bb36e7a92eb39176..45af2ba7f9a8281afcb7ab527a82941deba867b0 100644 (file)
 #include <openssl/x509.h>
 #include <openssl/pem.h>
 #include <openssl/ssl.h>
+#ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
+#endif
 #define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */
 #include "progs.h"
 #include "s_apps.h"
@@ -229,6 +231,10 @@ int main(int Argc, char *Argv[])
        arg.data=NULL;
        arg.count=0;
 
+       if (bio_err == NULL)
+               if ((bio_err=BIO_new(BIO_s_file())) != NULL)
+                       BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
+
        if (getenv("OPENSSL_DEBUG_MEMORY") != NULL) /* if not defined, use compiled-in library defaults */
                {
                if (!(0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off")))
@@ -253,10 +259,6 @@ int main(int Argc, char *Argv[])
 
        apps_startup();
 
-       if (bio_err == NULL)
-               if ((bio_err=BIO_new(BIO_s_file())) != NULL)
-                       BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
-
        /* Lets load up our environment a little */
        p=getenv("OPENSSL_CONF");
        if (p == NULL)
@@ -358,7 +360,7 @@ end:
                BIO_free(bio_err);
                bio_err=NULL;
                }
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 #define LIST_STANDARD_COMMANDS "list-standard-commands"