)]}'
{
  "commit": "2a52444f9d9e66b0dc317b8b25bdb4a3e4c7518c",
  "tree": "4c388c5780ccfd5ec17a65f7910603b738287305",
  "parents": [
    "172b291d3db3fa17b51e76cf02eb2d5e24db1af0"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Thu Mar 16 01:01:27 2023 -0400"
  },
  "committer": {
    "name": "Boringssl LUCI CQ",
    "email": "boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Tue Mar 21 22:18:39 2023 +0000"
  },
  "message": "Reimplement X509 parsing without templates\n\nThis is a cursory conversion and is, currently, very tedious because it\nneeds to bridge calling conventions. After tasn_*.c and all the\nunderlying primitives have CBS/CBB-based calling conventions, this\nshould be a lot cleaner.\n\nThis is to break a dependency cycle:\n\n- We\u0027d like to rewrite d2i_X509 with CBS\n\n- To do that, we need to rewrite its underlying types with CBS\n\n- Those parsers are tied up in tasn_dec.c, so we effectively need to\n  rewrite tasn_dec.c with CBS.\n\n- CBS is designed for DER, not BER, so such a change would most\n  naturally switch the TLV parser to require DER.\n\n- We\u0027ve *almost* done that already except\n  https://boringssl-review.googlesource.com/c/boringssl/+/51626 had to\n  stop at non-minimal definite lengths, which are allowed in BER but\n  forbidden in DER. See b/18228011 for a bunch of certificates which\n  have a non-minimal definite length at *just* the signature field.\n\n- So, to do that, we\u0027d ideally special case just that field, or BIT\n  STRINGs in general, to tolerate minimal lengths. That\u0027s easiest done\n  when d2i_X509 is CBS, so we can just do what we want in imperative\n  code. And thus we\u0027re back full circle.\n\nSo, detach X509 from the templates now. It\u0027s a bit tedious because we\nneed to switch calling conventions for now, but it breaks the cycle.\nLater, we can revisit this and get all the benefits of a fully CBS-based\npath.\n\nFor now, I haven\u0027t added an ASN1_ITEM. If it comes up, we can make an\nEXTERN ASN1_ITEM.\n\nUpdate-Note: The ASN1_ITEM removal means custom ASN.1 templates (which\nare discouraged in favor of our much simpler CBS and CBB types) using\nX509 will fail to compile. We don\u0027t believe anyone is relying on this,\nbut this can be restored if we find something.\n\nUpdate-Note: Certificate parsing is slightly stricter: the outermost\nTLVs, except for the signature field, no longer accept non-minimal\nlengths, as mandated by DER. This strictness was broadly already applied\nby the libssl parser.\n\nBug: 547\nChange-Id: Ie5ad8ba4bb39f54fdd3dd45c53965b72a3850709\nReviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/58185\nReviewed-by: Bob Beck \u003cbbe@google.com\u003e\nCommit-Queue: David Benjamin \u003cdavidben@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "737cb1058ae6ea3fe3551468cee6cb55d950a28c",
      "old_mode": 33188,
      "old_path": "crypto/x509/x509_test.cc",
      "new_id": "8adba6c68f97a4499811f06afb704be985d890f4",
      "new_mode": 33188,
      "new_path": "crypto/x509/x509_test.cc"
    },
    {
      "type": "modify",
      "old_id": "23508c07f4f5e28726e6a2bf3446b4eaba65db84",
      "old_mode": 33188,
      "old_path": "crypto/x509/x_all.c",
      "new_id": "6808ab78b1a74bea13edb0ec7f275da8e1f27b2d",
      "new_mode": 33188,
      "new_path": "crypto/x509/x_all.c"
    },
    {
      "type": "modify",
      "old_id": "5205267f527fabb4170e5cf737a3a7851c86e693",
      "old_mode": 33188,
      "old_path": "crypto/x509/x_x509.c",
      "new_id": "1aa2d2e6f2be128916bf1331b0444f65d2ddf988",
      "new_mode": 33188,
      "new_path": "crypto/x509/x_x509.c"
    },
    {
      "type": "modify",
      "old_id": "4141007edea843b469f64678edc195b0da88db79",
      "old_mode": 33188,
      "old_path": "include/openssl/x509.h",
      "new_id": "9a49b407f77c38af5a7d2e4b2079e53f14d3802f",
      "new_mode": 33188,
      "new_path": "include/openssl/x509.h"
    }
  ]
}
