summaryrefslogtreecommitdiffstats
path: root/ssl/statem/statem.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-11-20 23:07:56 +0100
committerRichard Levitte <levitte@openssl.org>2021-01-12 19:02:11 +0100
commit5a2d0ef36f4c130758a9d5e84f93004458e3ce60 (patch)
treeb7030edbc51adfd768bcada35e6023fb347d268d /ssl/statem/statem.c
parentd6d42cda5fbc05aeaadf8c760db60e9089e3609b (diff)
Clean away extraneous library specific FETCH_FAILED reason codes
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13467)
Diffstat (limited to 'ssl/statem/statem.c')
-rw-r--r--ssl/statem/statem.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index 009f370f97..a70f8bc53c 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -111,6 +111,18 @@ void ossl_statem_set_renegotiate(SSL *s)
s->statem.request_state = TLS_ST_SW_HELLO_REQ;
}
+void ossl_statem_send_fatal(SSL *s, int al)
+{
+ /* We shouldn't call SSLfatal() twice. Once is enough */
+ if (s->statem.in_init && s->statem.state == MSG_FLOW_ERROR)
+ return;
+ s->statem.in_init = 1;
+ s->statem.state = MSG_FLOW_ERROR;
+ if (al != SSL_AD_NO_ALERT
+ && s->statem.enc_write_state != ENC_WRITE_STATE_INVALID)
+ ssl3_send_alert(s, SSL3_AL_FATAL, al);
+}
+
/*
* Error reporting building block that's used instead of ERR_set_error().
* In addition to what ERR_set_error() does, this puts the state machine
@@ -125,14 +137,7 @@ void ossl_statem_fatal(SSL *s, int al, int reason, const char *fmt, ...)
ERR_vset_error(ERR_LIB_SSL, reason, fmt, args);
va_end(args);
- /* We shouldn't call SSLfatal() twice. Once is enough */
- if (s->statem.in_init && s->statem.state == MSG_FLOW_ERROR)
- return;
- s->statem.in_init = 1;
- s->statem.state = MSG_FLOW_ERROR;
- if (al != SSL_AD_NO_ALERT
- && s->statem.enc_write_state != ENC_WRITE_STATE_INVALID)
- ssl3_send_alert(s, SSL3_AL_FATAL, al);
+ ossl_statem_send_fatal(s, al);
}
/*