Update from HEAD.
authorDr. Stephen Henson <steve@openssl.org>
Mon, 9 Apr 2007 11:46:36 +0000 (11:46 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 9 Apr 2007 11:46:36 +0000 (11:46 +0000)
crypto/conf/conf.h
crypto/conf/conf_mod.c
crypto/conf/conf_sap.c

index 4c073dd83171f926100c64a6391da589de3fe155..8aa06bc5ecbdfcc635ccde118422297f52468847 100644 (file)
@@ -114,6 +114,7 @@ typedef void conf_finish_func(CONF_IMODULE *md);
 #define CONF_MFLAGS_SILENT             0x4
 #define CONF_MFLAGS_NO_DSO             0x8
 #define CONF_MFLAGS_IGNORE_MISSING_FILE        0x10
+#define CONF_MFLAGS_DEFAULT_SECTION    0x20
 
 int CONF_set_default_method(CONF_METHOD *meth);
 void CONF_set_nconf(CONF *conf,LHASH *hash);
index 587211a59c19b3533c78766f6e8589f66cf66553..1373d46a4ebd11538b5a0ed2a7eaaaa7668b77ca 100644 (file)
@@ -126,17 +126,18 @@ int CONF_modules_load(const CONF *cnf, const char *appname,
        {
        STACK_OF(CONF_VALUE) *values;
        CONF_VALUE *vl;
-       char *vsection;
+       char *vsection = NULL;
 
        int ret, i;
 
        if (!cnf)
                return 1;
 
-       if (appname == NULL)
-               appname = "openssl_conf";
+       if (appname)
+               vsection = NCONF_get_string(cnf, NULL, appname);
 
-       vsection = NCONF_get_string(cnf, NULL, appname); 
+       if (!appname || (!vsection && (flags & CONF_MFLAGS_DEFAULT_SECTION)))
+               vsection = NCONF_get_string(cnf, NULL, "openssl_conf");
 
        if (!vsection)
                {
index e15c2e55463a4594de49debd72891a5d26663d2f..9c53bac1a8c12e6b9d45c45e7fcc4df6a458819e 100644 (file)
@@ -88,8 +88,8 @@ void OPENSSL_config(const char *config_name)
 
 
        ERR_clear_error();
-       if (CONF_modules_load_file(NULL, NULL,
-                                       CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0)
+       if (CONF_modules_load_file(NULL, config_name,
+       CONF_MFLAGS_DEFAULT_SECTION|CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0)
                {
                BIO *bio_err;
                ERR_load_crypto_strings();