From: Dmitry Belyavskiy Date: Wed, 5 May 2021 12:29:28 +0000 (+0200) Subject: Avoid sending alerts after shutdown X-Git-Tag: openssl-3.0.0-alpha17~235 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22d1138fe2fde9a16e80b81de1d848ae6fa879ef;p=thirdparty%2Fopenssl.git Avoid sending alerts after shutdown Fixes #11388 Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/15159) --- diff --git a/ssl/s3_msg.c b/ssl/s3_msg.c index 066623d5fb4..4b0906820eb 100644 --- a/ssl/s3_msg.c +++ b/ssl/s3_msg.c @@ -52,6 +52,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);