summaryrefslogtreecommitdiffstats
path: root/crypto/conf
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2002-01-22 22:29:58 +0000
committerBen Laurie <ben@openssl.org>2002-01-22 22:29:58 +0000
commit0fc5cf0870c0c9e4240e118ee7a86e5d8b4a6891 (patch)
treea607373c3d631901191b83a22b04fa96b3e34a62 /crypto/conf
parentf78d4a35f865d7678a8b8e7a496e72a19f3df014 (diff)
Make no config file not an error. Move /dev/crypto config to ctrl.
Diffstat (limited to 'crypto/conf')
-rw-r--r--crypto/conf/conf.h1
-rw-r--r--crypto/conf/conf_def.c5
-rw-r--r--crypto/conf/conf_err.c1
-rw-r--r--crypto/conf/conf_mall.c5
4 files changed, 9 insertions, 3 deletions
diff --git a/crypto/conf/conf.h b/crypto/conf/conf.h
index a0bbeb4d58..a179a5f612 100644
--- a/crypto/conf/conf.h
+++ b/crypto/conf/conf.h
@@ -232,6 +232,7 @@ void ERR_load_CONF_strings(void);
#define CONF_R_NO_CONF 105
#define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106
#define CONF_R_NO_SECTION 107
+#define CONF_R_NO_SUCH_FILE 114
#define CONF_R_NO_VALUE 108
#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
#define CONF_R_UNKNOWN_MODULE_NAME 113
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c
index 04d128bc75..20b0760fcd 100644
--- a/crypto/conf/conf_def.c
+++ b/crypto/conf/conf_def.c
@@ -192,7 +192,10 @@ static int def_load(CONF *conf, const char *name, long *line)
#endif
if (in == NULL)
{
- CONFerr(CONF_F_CONF_LOAD,ERR_R_SYS_LIB);
+ if(ERR_GET_REASON(ERR_peek_top_error()) == BIO_R_NO_SUCH_FILE)
+ CONFerr(CONF_F_CONF_LOAD,CONF_R_NO_SUCH_FILE);
+ else
+ CONFerr(CONF_F_CONF_LOAD,ERR_R_SYS_LIB);
return 0;
}
diff --git a/crypto/conf/conf_err.c b/crypto/conf/conf_err.c
index e1bd8b3b2c..ee07bfe9d9 100644
--- a/crypto/conf/conf_err.c
+++ b/crypto/conf/conf_err.c
@@ -100,6 +100,7 @@ static ERR_STRING_DATA CONF_str_reasons[]=
{CONF_R_NO_CONF ,"no conf"},
{CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE ,"no conf or environment variable"},
{CONF_R_NO_SECTION ,"no section"},
+{CONF_R_NO_SUCH_FILE ,"no such file"},
{CONF_R_NO_VALUE ,"no value"},
{CONF_R_UNABLE_TO_CREATE_NEW_SECTION ,"unable to create new section"},
{CONF_R_UNKNOWN_MODULE_NAME ,"unknown module name"},
diff --git a/crypto/conf/conf_mall.c b/crypto/conf/conf_mall.c
index 814d5df877..59c7cfb966 100644
--- a/crypto/conf/conf_mall.c
+++ b/crypto/conf/conf_mall.c
@@ -92,9 +92,10 @@ void OPENSSL_config(void)
if (!file)
return;
- ret = CONF_modules_load_file(file, "openssl_config", 0);
+ ret=CONF_modules_load_file(file, "openssl_config", 0) <= 0
+ && ERR_GET_REASON(ERR_peek_top_error()) != CONF_R_NO_SUCH_FILE;
OPENSSL_free(file);
- if (ret <= 0)
+ if (ret)
{
BIO *bio_err;
ERR_load_crypto_strings();