)]}'
{
  "commit": "9d428efdba9c929546f67ca87640697d447af544",
  "tree": "fbedda1b582e83356ada748313da38a5d1e4ca5f",
  "parents": [
    "6ac867026a49ffda6b4d6c7fab675642041dbf07"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Tue Dec 19 14:35:15 2017 -0500"
  },
  "committer": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Thu Dec 21 22:55:47 2017 +0000"
  },
  "message": "Fix several issues with tls-boringssl.c.\n\nAn earlier CL added IPPS support via BoringSSL, but the change had many\nissues. This fixes the following:\n\n- random() with srandom(time(NULL)) is not an acceptable source of\n  entropy for a cryptographic library. Fortunately, BoringSSL ignores\n  calls to RAND_seed anyway, so delete it all.\n\n- ERR_error_string(NULL) is not thread-safe. (We\u0027ve really got to get\n  rid of that function, but there are a lot of callers to clear\n  through.) Use ERR_error_string_n with a local buffer.\n\n- Using the version-specific APIs disables TLS 1.2. Instead, use\n  TLS_method (client and server distinctions on methods are ignored in\n  BoringSSL), and configure the minimum protocol version accordingly.\n\n- SSL 3.0 is gone. Ignore _HTTP_TLS_ALLOW_SSL3 altogether. The old code\n  called SSLv3_*_method() which always fail in BoringSSL and, were they\n  not to fail, would have disabled all secure versions of TLS!\n\n- The SSL_set_tlsext_host_name call was guarded by a\n  HAVE_SSL_SET_TLSEXT_HOST_NAME, but config.h was not updated. Remove\n  the guard.\n\n- Server support was not added, so make the operation actually fail.\n  Remove the commented out code (which wouldn\u0027t work as calling\n  SSL_CTX_* functions after SSL_new doesn\u0027t do anything).\n\n- The code to call SSL_connect vs SSL_accept had a typo and only called\n  SSL_accept. In case someone wants server support in the future, use\n  the generic SSL_do_handshake which is equivalent, provided the caller\n  uses SSL_set_{connect,accept}_state.\n\nThis also cleans a couple things up:\n\n- SSL_load_error_strings is a no-op in BoringSSL. SSL_library_init is\n  also a no-op on Android, but there do exist configuations where it is\n  not, so I\u0027ve left it in.\n\n- SSL_write returns int, not ssize_t. The casts are unnecessary.\n\n- Extracting the SSL_CTX from the SSL to free it is weird. One can just\n  free it earlier. The SSL owns a reference to the SSL_CTX and will\n  do the rest for you.\n\n- Delete some unused functions whose comments even still say \"gnutls\" on\n  them.\n\nIMPORTANT: This does NOT fix the following:\n\n- This file does not verify peer certificates at all. This means any\n  network attacker could use a different certificate and break the\n  connection anyway. I do not know how printer certificates are\n  typically checked or how Android\u0027s trust store is set up, so someone\n  with more domain knowledge may need to help out here. (Are printer\n  certs typically checked at all? [0] suggests yes, amazingly.)\n\n[0] https://support.microsoft.com/en-us/help/2021626/when-attempting-to-add-an-ipp-printer-over-https--you-receive-an-error\n\nTest: mma. Additionally tested by Mopria folks. See review comments.\nChange-Id: Ife007038290ff79f3413179a26c0d40c1bb2c85b\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6aec3146a446dee8f1de0f5ac79d723dc5340223",
      "old_mode": 33188,
      "old_path": "cups/tls-boringssl.c",
      "new_id": "a8b7de54414a51145da9a33637a3eb8f41d280b1",
      "new_mode": 33188,
      "new_path": "cups/tls-boringssl.c"
    }
  ]
}
