Restore module loading
authorRichard Levitte <levitte@openssl.org>
Fri, 29 May 2015 06:07:10 +0000 (08:07 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 29 May 2015 10:41:50 +0000 (12:41 +0200)
The module loading feature got broken a while ago, so restore it, but
have it a bit more explicit this time around.

Reviewed-by: Stephen Henson <steve@openssl.org>
43 files changed:
apps/apps.c
apps/apps.h
apps/asn1pars.c
apps/ca.c
apps/ciphers.c
apps/cms.c
apps/crl.c
apps/crl2p7.c
apps/dgst.c
apps/dhparam.c
apps/dsa.c
apps/dsaparam.c
apps/ec.c
apps/ecparam.c
apps/enc.c
apps/engine.c
apps/gendsa.c
apps/genpkey.c
apps/genrsa.c
apps/nseq.c
apps/ocsp.c
apps/openssl.c
apps/passwd.c
apps/pkcs12.c
apps/pkcs7.c
apps/pkcs8.c
apps/pkey.c
apps/pkeyparam.c
apps/pkeyutl.c
apps/prime.c
apps/rand.c
apps/req.c
apps/rsa.c
apps/rsautl.c
apps/s_client.c
apps/s_server.c
apps/smime.c
apps/speed.c
apps/spkac.c
apps/srp.c
apps/ts.c
apps/verify.c
apps/x509.c

index 74646afae6b0ef92a4a0e1727a1fc75b16521565..60f71c3b8bde652b3cb2f1ac25a0ffa77474844f 100644 (file)
@@ -496,20 +496,14 @@ static char *app_get_pass(char *arg, int keepbio)
     return BUF_strdup(tpass);
 }
 
-CONF *app_load_config(const char *filename)
+static CONF *app_load_config_(BIO *in, const char *filename)
 {
     long errorline = -1;
     CONF *conf;
     int i;
-    BIO *in;
-
-    in = bio_open_default(filename, "r");
-    if (in == NULL)
-        return NULL;
 
     conf = NCONF_new(NULL);
     i = NCONF_load_bio(conf, in, &errorline);
-    BIO_free(in);
     if (i > 0)
         return conf;
 
@@ -522,6 +516,51 @@ CONF *app_load_config(const char *filename)
     NCONF_free(conf);
     return NULL;
 }
+CONF *app_load_config(const char *filename)
+{
+    BIO *in;
+    CONF *conf;
+
+    in = bio_open_default(filename, "r");
+    if (in == NULL)
+        return NULL;
+
+    conf = app_load_config_(in, filename);
+    BIO_free(in);
+    return conf;
+}
+CONF *app_load_config_quiet(const char *filename)
+{
+    BIO *in;
+    CONF *conf;
+
+    in = bio_open_default_quiet(filename, "r");
+    if (in == NULL)
+        return NULL;
+
+    conf = app_load_config_(in, filename);
+    BIO_free(in);
+    return conf;
+}
+
+int app_load_modules(const CONF *config)
+{
+    CONF *to_free = NULL;
+
+    if (config == NULL)
+       config = to_free = app_load_config_quiet(default_config_file);
+    if (config == NULL)
+       return 1;
+
+    if (CONF_modules_load(config, NULL, 0) <= 0) {
+        BIO_printf(bio_err, "Error configuring OpenSSL modules\n");
+        ERR_print_errors(bio_err);
+        NCONF_free(to_free);
+        return 0;
+    }
+    NCONF_free(to_free);
+    return 1;
+}
 
 int add_oid_section(CONF *conf)
 {
index a8e0071f4df47d5584567e9cf3ea0ad6ee40433e..a8652a1bb7ff66e4ffe238704b5a52fc49a4ce30 100644 (file)
@@ -154,7 +154,10 @@ extern BIO *bio_err;
 BIO *dup_bio_in(void);
 BIO *dup_bio_out(void);
 BIO *bio_open_default(const char *filename, const char *mode);
-CONF *app_load_config(const char* filename);
+BIO *bio_open_default_quiet(const char *filename, const char *mode);
+CONF *app_load_config(const char *filename);
+CONF *app_load_config_quiet(const char *filename);
+int app_load_modules(const CONF *config);
 void unbuffer(FILE *fp);
 
 /* Often used in calls to bio_open_default. */
index d188f4a5c19dd42ce8b19dbc217b9ff70c84626f..bf53a349b2e85ce19e31428b2adeac61de71b9ac 100644 (file)
@@ -186,8 +186,11 @@ int asn1parse_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (oidfile != NULL) {
-        in = bio_open_default(oidfile, "r");
+      in = bio_open_default(oidfile, "r");
         if (in == NULL)
             goto end;
         OBJ_create_objects(in);
index 437a375427ef6e86f79beb2acdebc409c2bbecab..4dc9176c8a01d2c59b3681a5fb62fb01723c82df 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -485,6 +485,8 @@ end_of_options:
     BIO_printf(bio_err, "Using configuration from %s\n", configfile);
     if ((conf = app_load_config(configfile)) == NULL)
         goto end;
+    if (!app_load_modules(conf))
+        goto end;
 
     /* Lets get the config section we are using */
     if (section == NULL) {
index 47132fdfc51e68ae41defdd2ac5058113e8ae526..b1b3bddd76dd28df1892623ebc4aea527b4309a0 100644 (file)
@@ -148,6 +148,9 @@ int ciphers_main(int argc, char **argv)
     else if (argc != 0)
         goto opthelp;
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     ctx = SSL_CTX_new(meth);
     if (ctx == NULL)
         goto err;
index 5293fbdc6d16ec523734f6a500ee8ad8e23e1b8a..7ccca5be9644ebacc5c049049a3832c1df3043ce 100644 (file)
@@ -664,12 +664,14 @@ int cms_main(int argc, char **argv)
     } else if (!operation)
         goto opthelp;
 
-
     if (!app_passwd(passinarg, NULL, &passin, NULL)) {
         BIO_printf(bio_err, "Error getting password\n");
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (need_rand) {
         app_RAND_load_file(NULL, (inrand != NULL));
         if (inrand != NULL)
index 443889a75363bc77d04a7ec4adfbfb60240c85cd..17391e24c038931aff0287ba76424c4060488dbb 100644 (file)
@@ -217,6 +217,9 @@ int crl_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     x = load_crl(infile, informat);
     if (x == NULL)
         goto end;
index f05ad4ae524824e426c57b6fa6657cba9ae2a687..e4e39cfe38672cb5d0bdda3617b9ea9ef99b9d6e 100644 (file)
@@ -148,6 +148,9 @@ int crl2pkcs7_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (!nocrl) {
         in = bio_open_default(infile, RB(informat));
         if (in == NULL)
index 5d23492779893e4561f1d0099f8d94962999dfad..308555c46d7cbd4ef1e489709fcfef32ed351e6e 100644 (file)
@@ -236,6 +236,9 @@ int dgst_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (do_verify && !sigfile) {
         BIO_printf(bio_err,
                    "No signature to verify: use the -signature option\n");
index c66c5916cf9748a0eb5bada7e489c96394c2743c..931bf10226b676302cbc3a20f26c6119486c542d 100644 (file)
@@ -230,6 +230,9 @@ int dhparam_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (argv[0] && (!opt_int(argv[0], &num) || num <= 0))
         goto end;
 
index d864c75022dedafb7823f7c918f7708110b812cc..f02f29399ab77dfcaf0c030663f68879a27729b4 100644 (file)
@@ -196,6 +196,9 @@ int dsa_main(int argc, char **argv)
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     BIO_printf(bio_err, "read DSA key\n");
     {
         EVP_PKEY *pkey;
index cf29b800d32a9614d6fdd125c5c8eb629e5b316b..ffd81ff7e585c2ec4e9d56830122c24344d3ceba 100644 (file)
@@ -185,6 +185,9 @@ int dsaparam_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (argc == 1) {
         if (!opt_int(argv[0], &num))
             goto end;
index 31a50eea92a877a3d3c04192fccd682bb3c70ff7..83a6aa4bab769910ce67995521c7daa958740d95 100644 (file)
--- a/apps/ec.c
+++ b/apps/ec.c
@@ -199,6 +199,9 @@ int ec_main(int argc, char **argv)
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     in = bio_open_default(infile, RB(informat));
     if (in == NULL)
         goto end;
index 755b1be18250415c6f9614530577092dbe190a33..ae755735b7b162ef9d60199e890b36bd38a5507b 100644 (file)
@@ -220,6 +220,9 @@ int ecparam_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     in = bio_open_default(infile, RB(informat));
     if (in == NULL)
         goto end;
index e4d490f25848dd7ac84f65bb9ffd943e061f8118..d045d159651627bb8ba56ed4170551020b023f93 100644 (file)
@@ -294,6 +294,9 @@ int enc_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (cipher && EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) {
         BIO_printf(bio_err, "%s: AEAD ciphers not supported\n", prog);
         goto end;
index 832cb0afaa739dcd31882c7f156b2611bf792b77..91af7bff72e17f936dca42ed5f38c049c148b2d8 100644 (file)
@@ -369,6 +369,9 @@ int engine_main(int argc, char **argv)
         }
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     for (i = 0; i < sk_OPENSSL_STRING_num(engines); i++) {
         const char *id = sk_OPENSSL_STRING_value(engines, i);
         if ((e = ENGINE_by_id(id)) != NULL) {
index 75bd802e6634abe74fa860d298ad2b293b0dee50..a832ec3ded727ab800815b778ee8ec3dcb4e9c3f 100644 (file)
@@ -143,6 +143,9 @@ int gendsa_main(int argc, char **argv)
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     in = bio_open_default(dsaparams, "r");
     if (in == NULL)
         goto end2;
index de14bd3810fe88aefced724540327286253c505c..b9843cfef7b078770cafe773cb99886ca5199ea4 100644 (file)
@@ -179,6 +179,9 @@ int genpkey_main(int argc, char **argv)
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     out = bio_open_default(outfile, "wb");
     if (out == NULL)
         goto end;
index e09e576c8b91de3c4b81f52a696a2e63fba14e45..80d9ea6f01f91a10542dba4ca5a285fe2561777d 100644 (file)
@@ -166,6 +166,9 @@ int genrsa_main(int argc, char **argv)
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     out = bio_open_default(outfile, "w");
     if (out == NULL)
         goto end;
index 3fa496c488b867292bbd0695ddb5569c9b8e757b..5c8ed172c2cafccee21cfff3380d11306bbaf214 100644 (file)
@@ -109,6 +109,9 @@ int nseq_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     in = bio_open_default(infile, "r");
     if (in == NULL)
         goto end;
index c71b0d6d2cba0f260b1a8d1cf9a26cf462c3fab9..4c3aa394104e0db34f5aa47fcbddde639c9cefaf 100644 (file)
@@ -482,6 +482,9 @@ int ocsp_main(int argc, char **argv)
     if (!req && !reqin && !respin && !(port && ridx_filename))
         goto opthelp;
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     out = bio_open_default(outfile, "w");
     if (out == NULL)
         goto end;
index 7713f9fbdb84a4120a18a372431cd2a91bcfb5f6..e04ddce3c9e9926d681f4995361f18f60dd6bb8a 100644 (file)
@@ -289,12 +289,16 @@ void unbuffer(FILE *fp)
     setbuf(fp, NULL);
 }
 
-BIO *bio_open_default(const char *filename, const char *mode)
+static BIO *bio_open_default_(const char *filename, const char *mode, int quiet)
 {
     BIO *ret;
 
     if (filename == NULL || strcmp(filename, "-") == 0) {
         ret = *mode == 'r' ? dup_bio_in() : dup_bio_out();
+        if (quiet) {
+            ERR_clear_error();
+            return ret;
+        }
         if (ret != NULL)
             return ret;
         BIO_printf(bio_err,
@@ -302,6 +306,10 @@ BIO *bio_open_default(const char *filename, const char *mode)
                    *mode == 'r' ? "stdin" : "stdout", strerror(errno));
     } else {
         ret = BIO_new_file(filename, mode);
+        if (quiet) {
+            ERR_clear_error();
+            return ret;
+        }
         if (ret != NULL)
             return ret;
         BIO_printf(bio_err,
@@ -312,6 +320,14 @@ BIO *bio_open_default(const char *filename, const char *mode)
     ERR_print_errors(bio_err);
     return NULL;
 }
+BIO *bio_open_default(const char *filename, const char *mode)
+{
+    return bio_open_default_(filename, mode, 0);
+}
+BIO *bio_open_default_quiet(const char *filename, const char *mode)
+{
+    return bio_open_default_(filename, mode, 1);
+}
 
 #if defined( OPENSSL_SYS_VMS)
 extern char **copy_argv(int *argc, char **argv);
index 8dd85428706514b4110dcfbc6919c999175bf75c..f34ef9f5343655a7e08451162267c4df79770922 100644 (file)
@@ -202,6 +202,9 @@ int passwd_main(int argc, char **argv)
         goto opthelp;
 # endif
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (infile && in_stdin) {
         BIO_printf(bio_err, "%s: Can't combine -in and -stdin\n", prog);
         goto end;
index 367ba8775424880a8a634bd44301603e8d93627b..82131e8527c9491b64eada02ba195a23efc6bafa 100644 (file)
@@ -342,6 +342,9 @@ int pkcs12_main(int argc, char **argv)
         mpass = macpass;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (export_cert || inrand) {
         app_RAND_load_file(NULL, (inrand != NULL));
         if (inrand != NULL)
index 7c62a8658e6939b3e8d964823dc3aa09817c5eed..248e0d6db26cd477cc04624517a44dcc4313f7ea 100644 (file)
@@ -193,6 +193,9 @@ int pkcs7_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     in = bio_open_default(infile, RB(informat));
     if (in == NULL)
         goto end;
index b4af160035cbdf009bdb92a810e958266fc3f397..f8a340edaf999ce2040d37de2c9c4d8c97c9bca7 100644 (file)
@@ -223,6 +223,9 @@ int pkcs8_main(int argc, char **argv)
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if ((pbe_nid == -1) && !cipher)
         pbe_nid = NID_pbeWithMD5AndDES_CBC;
 
index f0930a74f0161598b2044601077b5566004927da..875087fd18fe4420f9fbbb93e25c5264458d90f0 100644 (file)
@@ -165,6 +165,9 @@ int pkey_main(int argc, char **argv)
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     out = bio_open_default(outfile, "wb");
     if (out == NULL)
         goto end;
index fbd19a78cd7a9ced9f0266cbc36a5f8e70437a58..6039dad9d1905429cac32de01a6573842d090c0c 100644 (file)
@@ -118,6 +118,9 @@ int pkeyparam_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     in = bio_open_default(infile, "r");
     if (in == NULL)
         goto end;
index 87e49501ab372afa3438c37402c21dc71c10fe18..4c267c1eecf1d13c45e484262b9415c0fd2f5bef 100644 (file)
@@ -229,6 +229,9 @@ int pkeyutl_main(int argc, char **argv)
     if (ctx == NULL)
         goto opthelp;
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (sigfile && (pkey_op != EVP_PKEY_OP_VERIFY)) {
         BIO_printf(bio_err,
                    "%s: Signature file specified for non verify\n", prog);
index 04a83ab04ed5d844dd216a36ae3ffd6bc9e9bb91..d7f3869fdcab916009c6a6628a20c2e56df67ac9 100644 (file)
@@ -109,6 +109,9 @@ int prime_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (argc == 0 && !generate) {
         BIO_printf(bio_err, "%s: No prime specified\n", prog);
         goto end;
index 498e7dae7065f628bf20847c420df5d99b98f4fa..432e784496d0d0d82586699366a5b9935122751a 100644 (file)
@@ -126,6 +126,9 @@ int rand_main(int argc, char **argv)
     if (sscanf(argv[0], "%d", &num) != 1 || num < 0)
         goto opthelp;
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     app_RAND_load_file(NULL, (inrand != NULL));
     if (inrand != NULL)
         BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
index a4cf3125f9f164fb86722a12537be2b635e37f89..3bae59ec8b857fedc76f928d03cc27399b1a0e77 100644 (file)
@@ -380,6 +380,9 @@ int req_main(int argc, char **argv)
     if (verbose)
         BIO_printf(bio_err, "Using configuration from %s\n", template);
     req_conf = app_load_config(template);
+    if (!app_load_modules(req_conf))
+        goto end;
+
     if (req_conf != NULL) {
         p = NCONF_get_string(req_conf, NULL, "oid_file");
         if (p == NULL)
index 858699bc18cd5c542d6180cb0d128d9d29c007c7..87cb70254e8047e7695615f8d30909ac771172a0 100644 (file)
@@ -254,6 +254,9 @@ int rsa_main(int argc, char **argv)
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (check && pubin) {
         BIO_printf(bio_err, "Only private keys can be checked\n");
         goto end;
index 0ef61050cb818c839f94d19057bb5289127fd636..8ba838b43fa2df1e288186da1f01316cc7db7b42 100644 (file)
@@ -214,6 +214,9 @@ int rsautl_main(int argc, char **argv)
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
 /* FIXME: seed PRNG only if needed */
     app_RAND_load_file(NULL, 0);
 
index 6c14af0e277b2aa8dddb5b5e28e7d67f4e40a2d0..009e5fe8956b86b079874fc8bbcbd482d9a93a36 100644 (file)
@@ -1059,6 +1059,9 @@ int s_client_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (proxystr) {
         if (connectstr == NULL) {
             BIO_printf(bio_err, "%s: -proxy requires use of -connect\n", prog);
index 6bbabcc5f418f662bda32d8748bf177e6d3848a4..189019d1b2e20b4e930e62a45f3276503c29a1e6 100644 (file)
@@ -1438,6 +1438,9 @@ int s_server_main(int argc, char *argv[])
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (s_key_file == NULL)
         s_key_file = s_cert_file;
 
index 3f48278cd1c670a7ebf412a7cd0185b19bae24e3..45898de4c14ddc39571c8f552c26d5ea340136e8 100644 (file)
@@ -411,6 +411,9 @@ int smime_main(int argc, char **argv)
         goto end;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if (need_rand) {
         app_RAND_load_file(NULL, (inrand != NULL));
         if (inrand != NULL)
index 4b3da8758890bfdcb111df116c3a214254a99022..b93237e5912cd840f726b13a8970a44f7fea64c0 100644 (file)
@@ -856,6 +856,9 @@ int speed_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     /* Remaining arguments are algorithms. */
     for ( ; *argv; argv++) {
         if (found(*argv, doit_choices, &i)) {
index bd99f0e66aca6dd9d6ef3de0ccafe62786060b9f..d41331caba4ce6f193c0ea565d22b07056da2c9d 100644 (file)
@@ -186,6 +186,8 @@ int spkac_main(int argc, char **argv)
 
     if ((conf = app_load_config(infile)) == NULL)
         goto end;
+    if (!app_load_modules(conf))
+        goto end;
 
     spkstr = NCONF_get_string(conf, spksect, spkac);
 
index b91d7d076580f4e891df310a59f18057dc8084db..c730d6d1532b7032b14e7cf8ce203b1b32d20276 100644 (file)
@@ -354,6 +354,8 @@ int srp_main(int argc, char **argv)
         conf = app_load_config(configfile);
         if (conf == NULL)
             goto end;
+       if (!app_load_modules(conf))
+            goto end;
 
         /* Lets get the config section we are using */
         if (section == NULL) {
index be2482c6ceab929a0d28dc2578d3e2fae2884508..dfbf7eaeb3f2d03a267ac481af9f840e105432c4 100644 (file)
--- a/apps/ts.c
+++ b/apps/ts.c
@@ -316,6 +316,10 @@ int ts_main(int argc, char **argv)
         goto end;
     }
 
+    conf = load_config_file(configfile);
+    if (!app_load_modules(conf))
+        goto end;
+
     /*
      * Check consistency of parameters and execute the appropriate function.
      */
@@ -331,13 +335,10 @@ int ts_main(int argc, char **argv)
         ret = data != NULL && digest != NULL;
         if (ret)
             goto opthelp;
-        /* Load the config file for possible policy OIDs. */
-        conf = load_config_file(configfile);
         ret = !query_command(data, digest, md, policy, no_nonce, cert,
                              in, out, text);
         break;
     case OPT_REPLY:
-        conf = load_config_file(configfile);
         if (in == NULL) {
             ret = !(queryfile != NULL && conf != NULL && !token_in);
             if (ret)
index cb1be9a765408ffa6753a40972e7e8ef855f2c00..02351945679621d49fc75cba66afeba828de1961 100644 (file)
@@ -177,6 +177,9 @@ int verify_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     if ((store = setup_verify(CAfile, CApath)) == NULL)
         goto end;
     X509_STORE_set_verify_cb(store, cb);
index 1a6e32782bfde81ad67485275b775d23ffdcb9a1..77a2a6b437101941405e4d96a82b7de8cfec07c3 100644 (file)
@@ -489,6 +489,9 @@ int x509_main(int argc, char **argv)
         goto opthelp;
     }
 
+    if (!app_load_modules(NULL))
+        goto end;
+
     out = bio_open_default(outfile, "w");
     if (out == NULL)
         goto end;