)]}'
{
  "commit": "4c5ddb80477738d8063d3b65038b5879b20f8e84",
  "tree": "96c2e50b172635d46e902d3b1473a05e11c94e18",
  "parents": [
    "c6972eb1f090adc26046859ce3424221de8e210e"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Fri Mar 11 22:56:19 2016 -0500"
  },
  "committer": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Mon Apr 18 20:30:32 2016 +0000"
  },
  "message": "Set rwstate consistently.\n\nWe reset it to SSL_NOTHING at the start of ever SSL_get_error-using operation.\nThen we only set it to a non-NOTHING value in the rest of the stack on error\npaths.\n\nCurrently, ssl-\u003erwstate is set all over the place. Sometimes the pattern is:\n\n  ssl-\u003erwstate \u003d SSL_WRITING;\n  if (BIO_write(...) \u003c\u003d 0) {\n    goto err;\n  }\n  ssl-\u003erwstate \u003d SSL_NOTHING;\n\nSometimes we only set it to the non-NOTHING value on error.\n\n  if (BIO_write(...) \u003c\u003d 0) {\n    ssl-\u003erwstate \u003d SSL_WRITING;\n  }\n  ssl-\u003erwstate \u003d SSL_NOTHING;\n\nSometimes we just set it to SSL_NOTHING far from any callback in random places.\n\nThe third case is arbitrary and clearly should be removed.\n\nBut, in the second case, we sometimes forget to undo it afterwards. This is\nlargely harmless since an error in the error queue overrides rwstate, but we\ndon\u0027t always put something in the error queue (falling back to\nSSL_ERROR_SYSCALL for \"I\u0027m not sure why it failed. Perhaps it was one of your\ncallbacks? Check your errno equivalent.\"), but in that case a stray rwstate\nvalue will cause it to be wrong.\n\nWe could fix the cases where we fail to set SSL_NOTHING on success cases, but\nthis doesn\u0027t account for there being multiple SSL_get_error operations. The\nconsumer may have an SSL_read and an SSL_write running concurrently. Instead,\nit seems the best option is to lift the SSL_NOTHING reset to the operations and\nset SSL_WRITING and friends as in the second case.\n\n(Someday hopefully we can fix this to just be an enum that is internally\nreturned. It can convert to something stateful at the API layer.)\n\nChange-Id: I54665ec066a64eb0e48a06e2fcd0d2681a42df7f\nReviewed-on: https://boringssl-review.googlesource.com/7453\nReviewed-by: David Benjamin \u003cdavidben@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8596f3278c275f343f339819078f4f7f48af2202",
      "old_mode": 33188,
      "old_path": "ssl/d1_both.c",
      "new_id": "cc95a70b058ffc3e1e823300cd428abbd87e27bd",
      "new_mode": 33188,
      "new_path": "ssl/d1_both.c"
    },
    {
      "type": "modify",
      "old_id": "b29d56cf919d84992983b4cbe1170f95d2b4a71c",
      "old_mode": 33188,
      "old_path": "ssl/d1_clnt.c",
      "new_id": "2fc9094b935477cbfc896487cc31a96c7c4b84b1",
      "new_mode": 33188,
      "new_path": "ssl/d1_clnt.c"
    },
    {
      "type": "modify",
      "old_id": "4298580297e4eef552bfdf22fc732752d4e84572",
      "old_mode": 33188,
      "old_path": "ssl/d1_lib.c",
      "new_id": "e48fbf1a369ead5184164d3ae51b871437f9d3b6",
      "new_mode": 33188,
      "new_path": "ssl/d1_lib.c"
    },
    {
      "type": "modify",
      "old_id": "72ef8ac5d047a0a664d65d2655f00c530d47074e",
      "old_mode": 33188,
      "old_path": "ssl/d1_pkt.c",
      "new_id": "4690486c19f5f400eafa868952c294ab7b676366",
      "new_mode": 33188,
      "new_path": "ssl/d1_pkt.c"
    },
    {
      "type": "modify",
      "old_id": "fef8541762dde620278d03c37cc4f26f00789275",
      "old_mode": 33188,
      "old_path": "ssl/d1_srvr.c",
      "new_id": "d3532810c25f46bbccb5aeff339e5b5f2206378c",
      "new_mode": 33188,
      "new_path": "ssl/d1_srvr.c"
    },
    {
      "type": "modify",
      "old_id": "7bb31de60980fb1761a5aba7a00f339b3682e8a0",
      "old_mode": 33188,
      "old_path": "ssl/s3_both.c",
      "new_id": "5d364abf9c94895bb890ca06e74f448f043afd27",
      "new_mode": 33188,
      "new_path": "ssl/s3_both.c"
    },
    {
      "type": "modify",
      "old_id": "8dd4abd0f258809d09e119c0401b78b2abd83359",
      "old_mode": 33188,
      "old_path": "ssl/s3_clnt.c",
      "new_id": "6f381cfa8ffc0a847d25a9876de9144865cf9761",
      "new_mode": 33188,
      "new_path": "ssl/s3_clnt.c"
    },
    {
      "type": "modify",
      "old_id": "9038fda448ecb613ee911da8e984b04a05f0b473",
      "old_mode": 33188,
      "old_path": "ssl/s3_pkt.c",
      "new_id": "d9c21d42798045533f59b2fc263d533b289de921",
      "new_mode": 33188,
      "new_path": "ssl/s3_pkt.c"
    },
    {
      "type": "modify",
      "old_id": "0821b3a20eadfeabed29b8ff133193bfa922cd21",
      "old_mode": 33188,
      "old_path": "ssl/s3_srvr.c",
      "new_id": "f06ee5684752421adca1041e289f2c4fc653b635",
      "new_mode": 33188,
      "new_path": "ssl/s3_srvr.c"
    },
    {
      "type": "modify",
      "old_id": "7fd74e48471e3ae7654e9c8bfca698ad8d0cccde",
      "old_mode": 33188,
      "old_path": "ssl/ssl_buffer.c",
      "new_id": "272b13b0581338db8d8e7c44b3ccc4576d25dfeb",
      "new_mode": 33188,
      "new_path": "ssl/ssl_buffer.c"
    },
    {
      "type": "modify",
      "old_id": "1d4ccb741930e0878172c197aec660b302962993",
      "old_mode": 33188,
      "old_path": "ssl/ssl_lib.c",
      "new_id": "d62cdae09a3dd816fe0b383ee51d8568040100fa",
      "new_mode": 33188,
      "new_path": "ssl/ssl_lib.c"
    }
  ]
}
