From c3612970465d0a13f2fc5b47bc28ca18516a699d Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 24 Jul 2019 16:55:32 +0200 Subject: Avoid using ERR_put_error() directly in OpenSSL code If compiled with 'no-deprecated', ERR_put_error() is undefined. We had one spot where we were using it directly, because the file and line information was passed from elsewhere. Fortunately, it's possible to use ERR_raise() for that situation, and call ERR_set_debug() immediately after and thereby override the information that ERR_raise() stored in the error record. util/mkerr.pl needed a small adjustment to not generate code that won't compile in a 'no-deprecated' configuration. Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/9452) --- engines/e_afalg_err.c | 3 ++- engines/e_capi_err.c | 3 ++- engines/e_dasync_err.c | 3 ++- engines/e_ossltest_err.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/e_afalg_err.c b/engines/e_afalg_err.c index c436f10a41..4db6d660c9 100644 --- a/engines/e_afalg_err.c +++ b/engines/e_afalg_err.c @@ -66,5 +66,6 @@ static void ERR_AFALG_error(int function, int reason, char *file, int line) { if (lib_code == 0) lib_code = ERR_get_next_error_library(); - ERR_PUT_error(lib_code, function, reason, file, line); + ERR_raise(lib_code, reason); + ERR_set_debug(file, line, NULL); } diff --git a/engines/e_capi_err.c b/engines/e_capi_err.c index acbec41d08..e2b1f7561f 100644 --- a/engines/e_capi_err.c +++ b/engines/e_capi_err.c @@ -89,5 +89,6 @@ static void ERR_CAPI_error(int function, int reason, char *file, int line) { if (lib_code == 0) lib_code = ERR_get_next_error_library(); - ERR_PUT_error(lib_code, function, reason, file, line); + ERR_raise(lib_code, reason); + ERR_set_debug(file, line, NULL); } diff --git a/engines/e_dasync_err.c b/engines/e_dasync_err.c index 0920690af6..a2e6c0dc86 100644 --- a/engines/e_dasync_err.c +++ b/engines/e_dasync_err.c @@ -51,5 +51,6 @@ static void ERR_DASYNC_error(int function, int reason, char *file, int line) { if (lib_code == 0) lib_code = ERR_get_next_error_library(); - ERR_PUT_error(lib_code, function, reason, file, line); + ERR_raise(lib_code, reason); + ERR_set_debug(file, line, NULL); } diff --git a/engines/e_ossltest_err.c b/engines/e_ossltest_err.c index b81e00b43c..d9ee80cb83 100644 --- a/engines/e_ossltest_err.c +++ b/engines/e_ossltest_err.c @@ -51,5 +51,6 @@ static void ERR_OSSLTEST_error(int function, int reason, char *file, int line) { if (lib_code == 0) lib_code = ERR_get_next_error_library(); - ERR_PUT_error(lib_code, function, reason, file, line); + ERR_raise(lib_code, reason); + ERR_set_debug(file, line, NULL); } -- cgit v1.2.3