提交 5538ba99 编写于 作者: B Bernd Edlinger

Fix a possible recursion in SSLfatal handling

Fixes: #7161 (hopefully)
Reviewed-by: NMatt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7175)

(cherry picked from commit 6839a7a7f4973a3fc2f87b12664c26d524bef1f4)
上级 18ef2dbb
...@@ -118,11 +118,12 @@ void ossl_statem_set_renegotiate(SSL *s) ...@@ -118,11 +118,12 @@ void ossl_statem_set_renegotiate(SSL *s)
void ossl_statem_fatal(SSL *s, int al, int func, int reason, const char *file, void ossl_statem_fatal(SSL *s, int al, int func, int reason, const char *file,
int line) int line)
{ {
ERR_put_error(ERR_LIB_SSL, func, reason, file, line);
/* We shouldn't call SSLfatal() twice. Once is enough */ /* We shouldn't call SSLfatal() twice. Once is enough */
assert(s->statem.state != MSG_FLOW_ERROR); if (s->statem.in_init && s->statem.state == MSG_FLOW_ERROR)
return;
s->statem.in_init = 1; s->statem.in_init = 1;
s->statem.state = MSG_FLOW_ERROR; s->statem.state = MSG_FLOW_ERROR;
ERR_put_error(ERR_LIB_SSL, func, reason, file, line);
if (al != SSL_AD_NO_ALERT if (al != SSL_AD_NO_ALERT
&& s->statem.enc_write_state != ENC_WRITE_STATE_INVALID) && s->statem.enc_write_state != ENC_WRITE_STATE_INVALID)
ssl3_send_alert(s, SSL3_AL_FATAL, al); ssl3_send_alert(s, SSL3_AL_FATAL, al);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册