return e;
}
-int load_config(char *filename, BIO *err)
+int load_config(BIO *err, CONF *cnf)
{
- unsigned long flags;
- if (filename)
- flags = 0;
- else
- flags = CONF_MFLAGS_IGNORE_MISSING_FILE;
+ if (!cnf)
+ cnf = config;
+ if (!cnf)
+ return 1;
- if (CONF_modules_load_file(filename, NULL, flags) <= 0)
+ OPENSSL_load_builtin_modules();
+
+ if (CONF_modules_load(cnf, NULL, 0) <= 0)
{
- if (err)
- {
- BIO_printf(err, "Error loading config file\n");
- ERR_print_errors(err);
- }
+ BIO_printf(err, "Error configuring OpenSSL\n");
+ ERR_print_errors(err);
return 0;
}
return 1;
int CONF_parse_list(const char *list, int sep, int nospc,
int (*list_cb)(const char *elem, int len, void *usr), void *arg);
+void OPENSSL_load_builtin_modules(void);
+
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.