BIO *bio_out = NULL;
BIO *bio_err = NULL;
-static void apps_startup()
+static int apps_startup()
{
#ifdef SIGPIPE
signal(SIGPIPE, SIG_IGN);
CRYPTO_malloc_init();
ERR_load_crypto_strings();
ERR_load_SSL_strings();
- OpenSSL_add_all_algorithms();
- OpenSSL_add_ssl_algorithms();
+
OPENSSL_load_builtin_modules();
- setup_ui_method();
- /*SSL_library_init();*/
#ifndef OPENSSL_NO_ENGINE
ENGINE_load_builtin_engines();
#endif
+ if (!app_load_modules(NULL)) {
+ ERR_print_errors(bio_err);
+ BIO_printf(bio_err, "Error loading default configuration\n");
+ return 0;
+ }
+
+ OpenSSL_add_all_algorithms();
+ OpenSSL_add_ssl_algorithms();
+ setup_ui_method();
+ /*SSL_library_init();*/
+ return 1;
}
static void apps_shutdown()
size_t len;
char *p;
- if ((t = getenv("OPENSSL_CONF")) != NULL
- || (t = getenv("SSLEAY_CONF")) != NULL)
+ if ((t = getenv("OPENSSL_CONF")) != NULL)
return BUF_strdup(t);
t = X509_get_default_cert_area();
#endif
}
- apps_startup();
+ if (!apps_startup())
+ goto end;
+
prog = prog_init();
pname = opt_progname(argv[0]);
{
char *prog;
HELPLIST_CHOICE o;
+ int done = 0;
prog = opt_init(argc, argv, list_options);
while ((o = opt_next()) != OPT_EOF) {
switch (o) {
- case OPT_EOF:
+ case OPT_EOF: /* Never hit, but suppresses warning */
case OPT_ERR:
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
return 1;
list_disabled();
break;
}
+ done = 1;
+ }
+
+ if (!done) {
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ return 1;
}
return 0;