)]}'
{
  "commit": "b95c7e53d7d4376dbba18c3e3bbba99d66e3fbff",
  "tree": "86ba92eb76e01ff43ab6c1ecbd2dbf87386b90b2",
  "parents": [
    "64bf8c50a327217c5f56ba6a4d19ba98b1a07788"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Fri Jul 22 16:28:22 2022 -0700"
  },
  "committer": {
    "name": "Boringssl LUCI CQ",
    "email": "boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Mon Jul 25 18:53:51 2022 +0000"
  },
  "message": "Fix up book-keeping between the write buffer and pending writes.\n\nWriting application data goes through three steps:\n\n1. Encrypt the data into the write buffer.\n2. Flush the write buffer to the network.\n3. Report to SSL_write\u0027s caller that the write succeeded.\n\nIn principle, steps 2 and 3 are done together, but it is possible that\nBoringSSL needs to write something, but we are not in the middle of\nservicing an SSL_write call. Then we must perform (2) but cannot perform\n(3).\n\nTLS 1.3 0-RTT on a client introduces a case like this. Suppose we write\nsome 0-RTT data, but it is blocked on the network. Meanwhile, the\napplication tries to read from the socket (protocols like HTTP/2 read\nand write concurrently). We discover ServerHello..Finished and must then\nrespond with EndOfEarlyData..Finished. But to write, we must flush the\ncurrent write buffer.\n\nTo fix this, https://boringssl-review.googlesource.com/14164 split (2)\nand (3) more explicitly. The write buffer may be flushed to the network\nat any point, but the wpend_* book-keeping is separate. It represents\nwhether (3) is done. As part of that, we introduced a wpend_pending\nboolean to track whether there was pending data.\n\nThis introduces an interesting corner case. We now keep NewSessionTicket\nmessages buffered until the next SSL_write. (KeyUpdate ACKs are\nimplemented similarly.) Suppose the caller calls SSL_write(nullptr, 0)\nto flush the NewSessionTicket and this hits EWOULDBLOCK. We\u0027ll track a\nzero-length pending write in wpend_*! A future attempt to write non-zero\ndata would then violate the moving buffer check. This is strange because\nwe don\u0027t build records for zero-length application writes in the first\nplace.\n\nInstead, wpend_pending should have been wpend_tot \u003e 0. Remove that and\nrearrange the code to check that properly. Also remove wpend_ret as it\nhas the same data as wpend_tot.\n\nChange-Id: I58c23842cd55e8a8dfbb1854b61278b108b5c7ea\nReviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/53546\nReviewed-by: Bob Beck \u003cbbe@google.com\u003e\nCommit-Queue: Bob Beck \u003cbbe@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2400f903e47789db26bdc1be1e201c190a023c36",
      "old_mode": 33188,
      "old_path": "ssl/internal.h",
      "new_id": "41630f503e08e314d84f49cc32c331504fd1d514",
      "new_mode": 33188,
      "new_path": "ssl/internal.h"
    },
    {
      "type": "modify",
      "old_id": "fa73d34a764623fdb01e8378d1fb470157826b73",
      "old_mode": 33188,
      "old_path": "ssl/s3_lib.cc",
      "new_id": "2adf386971dd4229328275ca999a488c0dced32e",
      "new_mode": 33188,
      "new_path": "ssl/s3_lib.cc"
    },
    {
      "type": "modify",
      "old_id": "bc3e99adec9013d9800129d503b93a88e8e2a998",
      "old_mode": 33188,
      "old_path": "ssl/s3_pkt.cc",
      "new_id": "efe5905e887c6cae8619a86ca371fbe275bee7e4",
      "new_mode": 33188,
      "new_path": "ssl/s3_pkt.cc"
    },
    {
      "type": "modify",
      "old_id": "bbcc3b136b809cd1f9ab0eca09d4c9221a0cf841",
      "old_mode": 33188,
      "old_path": "ssl/ssl_lib.cc",
      "new_id": "703574847aae073b7d65acc153976cc203d7f5c2",
      "new_mode": 33188,
      "new_path": "ssl/ssl_lib.cc"
    },
    {
      "type": "modify",
      "old_id": "0811cb4ee9c56f629a6b00c525329985c37880d0",
      "old_mode": 33188,
      "old_path": "ssl/ssl_test.cc",
      "new_id": "55b705195a21fd30c5114fe285140886fa2c5ae0",
      "new_mode": 33188,
      "new_path": "ssl/ssl_test.cc"
    }
  ]
}
