diff options
author | Matt Caswell <matt@openssl.org> | 2020-11-04 12:31:55 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-11-06 11:34:48 +0100 |
commit | b8ae4a83de0de38fd382f3981e503f2ab5461c07 (patch) | |
tree | a38fef22dbc431360c7b348454e08a681e05e09a /crypto/conf/conf_mod.c | |
parent | x509_vfy.c: Call verification callback individually per strict check in check... (diff) | |
download | openssl-b8ae4a83de0de38fd382f3981e503f2ab5461c07.tar.xz openssl-b8ae4a83de0de38fd382f3981e503f2ab5461c07.zip |
Don't clear errors on failure in CONF_modules_load_file_ex()
The call to CONF_modules_load() in CONF_modules_load_file_ex() can
return a negative number to indicate failure. This was incorrectly
being interpreted as "success" and therefore errors were being cleared
incorrectly.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13311)
Diffstat (limited to 'crypto/conf/conf_mod.c')
-rw-r--r-- | crypto/conf/conf_mod.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c index bd945766b8..e7fb890378 100644 --- a/crypto/conf/conf_mod.c +++ b/crypto/conf/conf_mod.c @@ -187,10 +187,11 @@ int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename, if ((flags & CONF_MFLAGS_IGNORE_RETURN_CODES) != 0 && !diagnostics) ret = 1; - if (ret) + if (ret > 0) ERR_pop_to_mark(); else ERR_clear_last_mark(); + return ret; } |