)]}'
{
  "commit": "9734e4453bd755562e40388fc7e6d36933b10edc",
  "tree": "b39e5f88fa111e370073d42b2263a3e87860a6b1",
  "parents": [
    "e9c5d72c09e01a0f71f30f7c3454e5e7f8711476"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Tue Jun 15 13:58:12 2021 -0400"
  },
  "committer": {
    "name": "Boringssl LUCI CQ",
    "email": "boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Wed Jun 16 21:10:48 2021 +0000"
  },
  "message": "More reliably report handshake errors through SSL_write.\n\nThis CL fixes a couple of things. First, we never tested that SSL_write\nrefuses to write application data after a fatal alert, so add some tests\nhere. With those tests, we can revise some of this logic:\n\nNext, this removes the write_shutdown check in SSL_write and instead\nrelies on the lower-level versions of the check in the write_app_data,\netc., hooks. This improves error-reporting on handshake errors:\n\nWe generally try to make SSL_do_handshake errors sticky, analogous to\nhandshakeErr in the Go implementation. SSL_write and SSL_read both\nimplicitly call SSL_do_handshake. Callers driving the two in parallel\nwill naturally call SSL_do_handshake twice. Since the error effectively\napplies to both operations, we save and replay handshake errors\n(hs-\u003eerror).\n\nHandshake errors typically come with sending alerts, which also sets\nwrite_shutdown so we don\u0027t try to send more data over the channel.\nChecking this early in SSL_write means we don\u0027t get a chance to replay\nthe handshake error. So this CL defers it, and the test ensures we still\nultimately get it right.\n\nFinally, https://crbug.com/1078515 is a particular incarnation of this.\nIf the server enables 0-RTT and then reverts to TLS 1.2, clients need\nto catch the error and retry. There, deferring the SSL_write check\nisn\u0027t sufficient, because the can_early_write bit removes the write\npath\u0027s dependency on the handshake, so we don\u0027t call into\nSSL_do_handshake at all.\n\nFor now, I\u0027ve made this error path clear can_early_write. I suspect\nwe want it to apply to all handshake errors, though it\u0027s weird because\nthe handshake error is effectively a read error in 0-RTT. We don\u0027t\ncurrently replay record decryption failures at SSL_write, even though\nthose also send a fatal alert and thus break all subsequent writes.\n\nBug: chromium:1078515\nChange-Id: Icdfae6a8f2e7c1b1c921068dca244795a670807f\nReviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/48065\nCommit-Queue: David Benjamin \u003cdavidben@google.com\u003e\nReviewed-by: Adam Langley \u003cagl@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1fb43fbddf05d55b3435f0aacf92fef4728a1682",
      "old_mode": 33188,
      "old_path": "ssl/handshake_client.cc",
      "new_id": "1f26242cf28d70ac31151cac71f0a8af9b401e56",
      "new_mode": 33188,
      "new_path": "ssl/handshake_client.cc"
    },
    {
      "type": "modify",
      "old_id": "12117616439d2852075e9c9b1d632b76c8337153",
      "old_mode": 33188,
      "old_path": "ssl/ssl_lib.cc",
      "new_id": "8b67cf8a071c9fbc877d07b7526cc3b60114777d",
      "new_mode": 33188,
      "new_path": "ssl/ssl_lib.cc"
    },
    {
      "type": "modify",
      "old_id": "e2a41b86654e798d9e4ce937d7ebdfe4df16fa1d",
      "old_mode": 33188,
      "old_path": "ssl/ssl_test.cc",
      "new_id": "ceb52def0ca8e3dfb751856be8c4eccd1e06869b",
      "new_mode": 33188,
      "new_path": "ssl/ssl_test.cc"
    }
  ]
}
