summaryrefslogtreecommitdiffstats
path: root/ssl/s3_msg.c
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2021-05-05 14:29:28 +0200
committerDmitry Belyavskiy <beldmit@gmail.com>2021-05-06 17:11:20 +0200
commita9e808fadcff1b1b4bf5dece753ee5eb00c9cc16 (patch)
treec32aa0834b452267aa85173c40d75bbc02205e4b /ssl/s3_msg.c
parent9f85ab647c8c9f47a1523f99facdf15fc34797a0 (diff)
Avoid sending alerts after shutdown
Fixes #11388 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15159) (cherry picked from commit 22d1138fe2fde9a16e80b81de1d848ae6fa879ef)
Diffstat (limited to 'ssl/s3_msg.c')
-rw-r--r--ssl/s3_msg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ssl/s3_msg.c b/ssl/s3_msg.c
index 339fb2774a..721bbb7320 100644
--- a/ssl/s3_msg.c
+++ b/ssl/s3_msg.c
@@ -48,6 +48,8 @@ int ssl3_send_alert(SSL *s, int level, int desc)
* protocol_version alerts */
if (desc < 0)
return -1;
+ if (s->shutdown & SSL_SENT_SHUTDOWN && desc != SSL_AD_CLOSE_NOTIFY)
+ return -1;
/* If a fatal one, remove from cache */
if ((level == SSL3_AL_FATAL) && (s->session != NULL))
SSL_CTX_remove_session(s->session_ctx, s->session);