external/boringssl: Sync to 6d50f475e319de153a43e1dba5a1beca95948c63.

This includes the following changes:

https://boringssl.googlesource.com/boringssl/+log/0726fb76ebe7f422e3c4fb2e25a0064926975770..6d50f475e319de153a43e1dba5a1beca95948c63

This also updates the build files to add the new GTest-based targets and
work with the C++ file in libssl.

Test: cts-tradefed run cts -m CtsLibcoreOkHttpTestCases -a arm64-v8a
Test: cts-tradefed run cts -m CtsLibcoreTestCases -a arm64-v8a

Change-Id: I99718d51c901fe2e2e1e0398fc61fe1e76ccdb3f
diff --git a/src/ssl/handshake_server.c b/src/ssl/handshake_server.c
index 6ce49f5..a4396f4 100644
--- a/src/ssl/handshake_server.c
+++ b/src/ssl/handshake_server.c
@@ -451,9 +451,8 @@
         break;
 
       case SSL3_ST_SW_FLUSH:
-        if (BIO_flush(ssl->wbio) <= 0) {
-          ssl->rwstate = SSL_WRITING;
-          ret = -1;
+        ret = ssl->method->flush_flight(ssl);
+        if (ret <= 0) {
           goto end;
         }
 
@@ -839,10 +838,6 @@
   }
 
   if (hs->state == SSL3_ST_SR_CLNT_HELLO_B) {
-    /* Unlike other callbacks, the early callback is not run a second time if
-     * paused. */
-    hs->state = SSL3_ST_SR_CLNT_HELLO_C;
-
     /* Run the early callback. */
     if (ssl->ctx->select_certificate_cb != NULL) {
       switch (ssl->ctx->select_certificate_cb(&client_hello)) {
@@ -860,6 +855,7 @@
           /* fallthrough */;
       }
     }
+    hs->state = SSL3_ST_SR_CLNT_HELLO_C;
   }
 
   /* Negotiate the protocol version if we have not done so yet. */