Wrap the inclusion of openssl/engine.h with a protective check for
[oweals/openssl.git] / crypto / conf / conf_lib.c
index 4f0c1c6fc7fec65ae940bc5b47cc5aaba9873c5e..a55a5457c634998c070ddc0a7b087230f6d3aa6b 100644 (file)
@@ -137,7 +137,7 @@ LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline)
        return NULL;
        }
 
-STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section)
+STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section)
        {
        if (conf == NULL)
                {
@@ -151,7 +151,7 @@ STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section)
                }
        }
 
-char *CONF_get_string(LHASH *conf,char *group,char *name)
+char *CONF_get_string(LHASH *conf,const char *group,const char *name)
        {
        if (conf == NULL)
                {
@@ -165,7 +165,7 @@ char *CONF_get_string(LHASH *conf,char *group,char *name)
                }
        }
 
-long CONF_get_number(LHASH *conf,char *group,char *name)
+long CONF_get_number(LHASH *conf,const char *group,const char *name)
        {
        int status;
        long result = 0;
@@ -184,7 +184,7 @@ long CONF_get_number(LHASH *conf,char *group,char *name)
        if (status == 0)
                {
                /* This function does not believe in errors... */
-               ERR_get_error();
+               ERR_clear_error();
                }
        return result;
        }
@@ -294,7 +294,7 @@ int NCONF_load_bio(CONF *conf, BIO *bp,long *eline)
        return conf->meth->load_bio(conf, bp, eline);
        }
 
-STACK_OF(CONF_VALUE) *NCONF_get_section(CONF *conf,char *section)
+STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section)
        {
        if (conf == NULL)
                {
@@ -311,7 +311,7 @@ STACK_OF(CONF_VALUE) *NCONF_get_section(CONF *conf,char *section)
        return _CONF_get_section_values(conf, section);
        }
 
-char *NCONF_get_string(CONF *conf,char *group,char *name)
+char *NCONF_get_string(const CONF *conf,const char *group,const char *name)
        {
        char *s = _CONF_get_string(conf, group, name);
 
@@ -327,10 +327,12 @@ char *NCONF_get_string(CONF *conf,char *group,char *name)
                }
        CONFerr(CONF_F_NCONF_GET_STRING,
                CONF_R_NO_VALUE);
+       ERR_add_error_data(4,"group=",group," name=",name);
        return NULL;
        }
 
-int NCONF_get_number_e(CONF *conf,char *group,char *name,long *result)
+int NCONF_get_number_e(const CONF *conf,const char *group,const char *name,
+                      long *result)
        {
        char *str;
 
@@ -355,7 +357,7 @@ int NCONF_get_number_e(CONF *conf,char *group,char *name,long *result)
        }
 
 #ifndef OPENSSL_NO_FP_API
-int NCONF_dump_fp(CONF *conf, FILE *out)
+int NCONF_dump_fp(const CONF *conf, FILE *out)
        {
        BIO *btmp;
        int ret;
@@ -369,7 +371,7 @@ int NCONF_dump_fp(CONF *conf, FILE *out)
        }
 #endif
 
-int NCONF_dump_bio(CONF *conf, BIO *out)
+int NCONF_dump_bio(const CONF *conf, BIO *out)
        {
        if (conf == NULL)
                {
@@ -380,8 +382,9 @@ int NCONF_dump_bio(CONF *conf, BIO *out)
        return conf->meth->dump(conf, out);
        }
 
+
 /* This function should be avoided */
-#undef NCONF_get_number
+#if 0
 long NCONF_get_number(CONF *conf,char *group,char *name)
        {
        int status;
@@ -395,4 +398,4 @@ long NCONF_get_number(CONF *conf,char *group,char *name)
                }
        return ret;
        }
-
+#endif