Consolidate shutdown state.
fatal_alert isn't read at all right now, and warn_alert is only checked
for close_notify. We only need three states:
- Not shutdown.
- Got a fatal alert (don't care which).
- Got a warning close_notify.
Leave ssl->shutdown alone for now as it's tied up with SSL_set_shutdown
and friends. To distinguish the remaining two, we only need a boolean.
Change-Id: I5877723af82b76965c75cefd67ec1f981242281b
Reviewed-on: https://boringssl-review.googlesource.com/7434
Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index b34fa56..71d9b5c 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -4058,8 +4058,10 @@
* the handshake hash for TLS 1.1 and below. */
EVP_MD_CTX handshake_md5;
- int warn_alert;
- int fatal_alert;
+ /* clean_shutdown is one if the connection was cleanly shutdown with a
+ * close_notify and zero otherwise. */
+ char clean_shutdown;
+
/* we allow one fatal and one warning alert to be outstanding, send close
* alert via the warning alert */
int alert_dispatch;