summaryrefslogtreecommitdiffstats
path: root/crypto/conf/conf_mod.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-11-04 16:14:00 +0100
committerRichard Levitte <levitte@openssl.org>2020-11-13 09:35:31 +0100
commita150f8e1fcc38752fef4d7c75d765d8efc7d46d6 (patch)
treef7f62c9a5d8407d8b17820fbef67378aa7b9ddbb /crypto/conf/conf_mod.c
parent9311d0c471ca2eaa259e8c1bbbeb7c46394c7ba2 (diff)
CRYPTO: refactor ERR_raise()+ERR_add_error_data() to ERR_raise_data()
This is not done absolutely everywhere, as there are places where the use of ERR_add_error_data() is quite complex, but at least the simple cases are done. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13318)
Diffstat (limited to 'crypto/conf/conf_mod.c')
-rw-r--r--crypto/conf/conf_mod.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c
index 9a07beb6b6..cb1bf7cd3c 100644
--- a/crypto/conf/conf_mod.c
+++ b/crypto/conf/conf_mod.c
@@ -121,8 +121,9 @@ int CONF_modules_load(const CONF *cnf, const char *appname,
if (values == NULL) {
if (!(flags & CONF_MFLAGS_SILENT)) {
ERR_clear_last_mark();
- ERR_raise(ERR_LIB_CONF, CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION);
- ERR_add_error_data(2, "openssl_conf=", vsection);
+ ERR_raise_data(ERR_LIB_CONF,
+ CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION,
+ "openssl_conf=%s", vsection);
} else {
ERR_pop_to_mark();
}
@@ -228,8 +229,8 @@ static int module_run(const CONF *cnf, const char *name, const char *value,
if (!md) {
if (!(flags & CONF_MFLAGS_SILENT)) {
- ERR_raise(ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME);
- ERR_add_error_data(2, "module=", name);
+ ERR_raise_data(ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME,
+ "module=%s", name);
}
return -1;
}
@@ -237,14 +238,10 @@ static int module_run(const CONF *cnf, const char *name, const char *value,
ret = module_init(md, name, value, cnf);
if (ret <= 0) {
- if (!(flags & CONF_MFLAGS_SILENT)) {
- char rcode[DECIMAL_SIZE(ret) + 1];
-
- ERR_raise(ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR);
- BIO_snprintf(rcode, sizeof(rcode), "%-8d", ret);
- ERR_add_error_data(6, "module=", name, ", value=", value,
- ", retcode=", rcode);
- }
+ if (!(flags & CONF_MFLAGS_SILENT))
+ ERR_raise_data(ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR,
+ "module=%s, value=%s retcode=%-8d",
+ name, value, ret);
}
return ret;
@@ -287,8 +284,7 @@ static CONF_MODULE *module_load_dso(const CONF *cnf,
err:
DSO_free(dso);
- ERR_raise(ERR_LIB_CONF, errcode);
- ERR_add_error_data(4, "module=", name, ", path=", path);
+ ERR_raise_data(ERR_LIB_CONF, errcode, "module=%s, path=%s", name, path);
return NULL;
}