I've always wanted to make the CONF library more adaptable. Here's

the result.

I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface.  Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.

In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c.  conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right).  conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML?  I can :-)).

Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
This commit is contained in:
Richard Levitte
2000-04-09 12:04:35 +00:00
parent 05e15b046f
commit d86b6915be
10 changed files with 1277 additions and 337 deletions

View File

@@ -67,7 +67,10 @@ main()
long eline;
char *s,*s2;
conf=CONF_load(NULL,"openssl.conf",&eline);
#ifdef USE_WIN32
CONF_set_default_method(CONF_WIN32);
#endif
conf=CONF_load(NULL,"ssleay.cnf",&eline);
if (conf == NULL)
{
ERR_load_crypto_strings();
@@ -88,5 +91,8 @@ main()
s=CONF_get_string(conf,"s_client","cipher1");
printf("s_client:cipher1=%s\n",(s == NULL)?"NULL":s);
printf("---------------------------- DUMP ------------------------\n");
CONF_dump_fp(conf, stdout);
exit(0);
}