summaryrefslogtreecommitdiffstats
path: root/crypto/conf/conf_lib.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-10-19 08:26:32 +0000
committerRichard Levitte <levitte@openssl.org>2000-10-19 08:26:32 +0000
commitbefb3e7a4de7af6039ae2d37e995675e8f5fddc5 (patch)
treea1c6b5be70bcc2bc810f6164ad35ca93afc5b641 /crypto/conf/conf_lib.c
parentc6f1787bbd8012b372158c15ac84abf75261be3e (diff)
Make it possible for methods to load from something other than a BIO,
by providing a function pointer that is given a name instead of a BIO. For example, this could be used to load configuration data from an LDAP server.
Diffstat (limited to 'crypto/conf/conf_lib.c')
-rw-r--r--crypto/conf/conf_lib.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/crypto/conf/conf_lib.c b/crypto/conf/conf_lib.c
index a1d31cf953..2005c87350 100644
--- a/crypto/conf/conf_lib.c
+++ b/crypto/conf/conf_lib.c
@@ -252,24 +252,13 @@ void NCONF_free_data(CONF *conf)
int NCONF_load(CONF *conf, const char *file, long *eline)
{
- int ret;
- BIO *in=NULL;
-
-#ifdef VMS
- in=BIO_new_file(file, "r");
-#else
- in=BIO_new_file(file, "rb");
-#endif
- if (in == NULL)
+ if (conf == NULL)
{
- CONFerr(CONF_F_CONF_LOAD,ERR_R_SYS_LIB);
+ CONFerr(CONF_F_NCONF_LOAD,CONF_R_NO_CONF);
return 0;
}
- ret = NCONF_load_bio(conf, in, eline);
- BIO_free(in);
-
- return ret;
+ return conf->meth->load(conf, file, eline);
}
#ifndef NO_FP_API
@@ -279,7 +268,7 @@ int NCONF_load_fp(CONF *conf, FILE *fp,long *eline)
int ret;
if(!(btmp = BIO_new_fp(fp, BIO_NOCLOSE)))
{
- CONFerr(CONF_F_CONF_LOAD_FP,ERR_R_BUF_LIB);
+ CONFerr(CONF_F_NCONF_LOAD_FP,ERR_R_BUF_LIB);
return 0;
}
ret = NCONF_load_bio(conf, btmp, eline);
@@ -296,7 +285,7 @@ int NCONF_load_bio(CONF *conf, BIO *bp,long *eline)
return 0;
}
- return conf->meth->load(conf, bp, eline);
+ return conf->meth->load_bio(conf, bp, eline);
}
STACK_OF(CONF_VALUE) *NCONF_get_section(CONF *conf,char *section)