Compute should_ack_sni in one place Right now it's split over the SNI extractor and the code that calls the SNI callback. But the only thing that reads it is the code to send the ServerHello extension, so we don't need to half-compute it earlier. Change-Id: Ia0fdd502ab21bec2ccdde99185951601a4650efe Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/69747 Reviewed-by: Bob Beck <bbe@google.com> Auto-Submit: David Benjamin <davidben@google.com> Commit-Queue: Bob Beck <bbe@google.com>
diff --git a/ssl/extensions.cc b/ssl/extensions.cc index 3f35276..7f06ded 100644 --- a/ssl/extensions.cc +++ b/ssl/extensions.cc
@@ -3794,6 +3794,7 @@ return true; default: + hs->should_ack_sni = ssl->s3->hostname != nullptr; return true; } }
diff --git a/ssl/handshake_server.cc b/ssl/handshake_server.cc index 508f9bf..148a29c 100644 --- a/ssl/handshake_server.cc +++ b/ssl/handshake_server.cc
@@ -616,7 +616,6 @@ // // Clear state in case we previously extracted SNI from ClientHelloOuter. ssl->s3->hostname.reset(); - hs->should_ack_sni = false; return true; } @@ -653,8 +652,6 @@ return false; } ssl->s3->hostname.reset(raw); - - hs->should_ack_sni = true; return true; }