diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2002-01-21 03:02:36 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2002-01-21 03:02:36 +0000 |
commit | c9501c223f0a3d48a17418afd107e7bfb25af6b1 (patch) | |
tree | ec206960238bbceddf610d8957418af1e37a4772 /crypto/conf/conf_mod.c | |
parent | 9dd5ae65533ec43e66efe66e1bbcddce4cb05509 (diff) |
Initial ENGINE config module, docs to follow.
Fix buffer overrun errors in OPENSSL_conf().
Diffstat (limited to 'crypto/conf/conf_mod.c')
-rw-r--r-- | crypto/conf/conf_mod.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c index e2e357fe6a..234eb7a06e 100644 --- a/crypto/conf/conf_mod.c +++ b/crypto/conf/conf_mod.c @@ -520,3 +520,32 @@ void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data) pmod->usr_data = usr_data; } +/* Return default config file name */ + +char *CONF_get1_default_config_file(void) + { + char *file; + int len; + + file = getenv("OPENSSL_CONF"); + if (file) + return BUF_strdup(file); + + len = strlen(X509_get_default_cert_area()); +#ifndef OPENSSL_SYS_VMS + len++; +#endif + len += strlen(OPENSSL_CONF); + + file = OPENSSL_malloc(len + 1); + + if (!file) + return NULL; + strcpy(file,X509_get_default_cert_area()); +#ifndef OPENSSL_SYS_VMS + strcat(file,"/"); +#endif + strcat(file,OPENSSL_CONF); + + return file; + } |