Fix discarding records in bidirectional shutdown.
When discarding a record, it's important to start reading the next one,
or the state machine retry signaling doesn't work.
BUG=526437
Change-Id: I5e4a5155310d097c0033cdf5d06712410a01ee08
Reviewed-on: https://boringssl-review.googlesource.com/5768
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
index d4eb7ef..250973e 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -651,10 +651,9 @@
}
if (s->shutdown & SSL_SENT_SHUTDOWN) {
- /* but we have not received a shutdown */
- s->rwstate = SSL_NOTHING;
+ /* close_notify has been sent, so discard all records other than alerts. */
rr->length = 0;
- return 0;
+ goto start;
}
if (rr->type == SSL3_RT_CHANGE_CIPHER_SPEC) {