mirror of
https://github.com/openssl/openssl.git
synced 2025-02-11 14:22:43 +08:00
Always flush the BIO when we send any alert
At the moment we flush the write BIO if we send a fatal alert, but not a warning one. This can mean the warning is never sent if we never do another write and subsequently flush the BIO. Instead we should just always flush after writing an alert. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3432)
This commit is contained in:
parent
84344efa7a
commit
270d65fa34
@ -105,12 +105,10 @@ int ssl3_dispatch_alert(SSL *s)
|
|||||||
s->s3->alert_dispatch = 1;
|
s->s3->alert_dispatch = 1;
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Alert sent to BIO. If it is important, flush it now. If the
|
* Alert sent to BIO - now flush. If the message does not get sent due
|
||||||
* message does not get sent due to non-blocking IO, we will not
|
* to non-blocking IO, we will not worry too much.
|
||||||
* worry too much.
|
|
||||||
*/
|
*/
|
||||||
if (s->s3->send_alert[0] == SSL3_AL_FATAL)
|
(void)BIO_flush(s->wbio);
|
||||||
(void)BIO_flush(s->wbio);
|
|
||||||
|
|
||||||
if (s->msg_callback)
|
if (s->msg_callback)
|
||||||
s->msg_callback(1, s->version, SSL3_RT_ALERT, s->s3->send_alert,
|
s->msg_callback(1, s->version, SSL3_RT_ALERT, s->s3->send_alert,
|
||||||
|
Loading…
Reference in New Issue
Block a user