summaryrefslogtreecommitdiffstats
path: root/ssl/statem/statem.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-07-24 16:55:32 +0200
committerRichard Levitte <levitte@openssl.org>2019-07-31 06:45:21 +0200
commitc3612970465d0a13f2fc5b47bc28ca18516a699d (patch)
tree05b18630fed9a1722c6776717fbff7c2d08b85bb /ssl/statem/statem.c
parent036913b1076da41f257c640a5e6230476c647eff (diff)
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 <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9452)
Diffstat (limited to 'ssl/statem/statem.c')
-rw-r--r--ssl/statem/statem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index a35573c935..bd9277b71e 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -118,7 +118,8 @@ void ossl_statem_set_renegotiate(SSL *s)
void ossl_statem_fatal(SSL *s, int al, int func, int reason, const char *file,
int line)
{
- ERR_put_error(ERR_LIB_SSL, func, reason, file, line);
+ ERR_raise(ERR_LIB_SSL, reason);
+ ERR_set_debug(file, line, NULL); /* Override what ERR_raise set */
/* We shouldn't call SSLfatal() twice. Once is enough */
if (s->statem.in_init && s->statem.state == MSG_FLOW_ERROR)
return;