Don't ignore config_name parameter passed to OPENSSL_config(). Use
[openssl.git] / crypto / conf / conf_mod.c
index 7c9b42f7678e76fa97447380f61c7bdf96a814b2..e40cc50dd67e8ead61832f834b6fc7d4491659a7 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)
                {