Don't try to write empty early data in the tool.

We'll return 0 and get confused. (Negotiating early data and not using
it is plausible if, say, the client preconnects but gets a ServerHello
before any request binds the socket.)

Change-Id: I94d458e18c58223f73c9340cac06e5ec5f8c84a0
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/47684
Reviewed-by: Adam Langley <agl@google.com>
grpc-202302
David Benjamin 4 years ago committed by Adam Langley
parent 3675eb3f2a
commit ef1d779d7b
  1. 2
      tool/client.cc

@ -313,6 +313,7 @@ static bool DoConnection(SSL_CTX *ctx,
}
early_data = std::string(data.begin(), data.end());
}
if (!early_data.empty()) {
int ed_size = early_data.size();
int ssl_ret = SSL_write(ssl.get(), early_data.data(), ed_size);
if (ssl_ret <= 0) {
@ -324,6 +325,7 @@ static bool DoConnection(SSL_CTX *ctx,
return false;
}
}
}
fprintf(stderr, "Connected.\n");
bssl::UniquePtr<BIO> bio_stderr(BIO_new_fp(stderr, BIO_NOCLOSE));

Loading…
Cancel
Save