)]}'
{
  "commit": "acf6149ad878f66c2de240f24617f280371e13a3",
  "tree": "83b573e1ae96776a405f80b45b390f8af2eb4695",
  "parents": [
    "6b48efac7b3b229c17cff55e5cfd9f9a0aea9b70"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Sat Mar 13 14:51:50 2021 -0500"
  },
  "committer": {
    "name": "CQ bot account: commit-bot@chromium.org",
    "email": "commit-bot@chromium.org",
    "time": "Mon Mar 15 19:25:01 2021 +0000"
  },
  "message": "Align with OpenSSL on constness of static ASN1_OBJECTs.\n\nASN1_OBJECTs are awkward. Sometimes they are static, when returned from\nOBJ_nid2obj, and sometimes they are dynamic, when parsed from\ncrypto/asn1.\n\nMost structures in crypto/asn1 need to support unknown OIDs and thus\nmust own their ASN1_OBJECTs. But they also may be initialized with\nstatic ones in various APIs, such as X509_ALGOR_set0. To make that work,\nASN1_OBJECT_free detects static ASN1_OBJECTs and is a no-op.\n\nFunctions like X509_ALGOR_set0 take ownership, so OpenSSL has them take\na non-const ASN1_OBJECT*. To match, OBJ_nid2obj then returns a non-const\nASN1_OBJECT*, to signal that it is freeable.\n\nHowever, this means OBJ_nid2obj\u0027s mutability doesn\u0027t match its return\ntype. In the fork, we switched OBJ_nid2obj to return const. But, in\ndoing so, we had to make X509_ALGOR_set0 and X509_PUBKEY_set0_param take\nconst ASN1_OBJECT, even though they would actually take ownership of\ndynamic ASN1_OBJECTs. There are also a few internal casts with a TODO to\nbe const-correct.\n\nNeither situation is ideal. (Perhaps a more sound model would be to copy\nstatic ASN1_OBJECTs before putting them in most structs. But that would\nnot match current usage.) But I think aligning with OpenSSL is the\nlesser evil here, since it avoids misleading set0 functions. Managing\nownership of ASN1_OBJECTs is much more common than mutating them. To\nthat end, I\u0027ve added a note that ASN1_OBJECTs you didn\u0027t create must be\nassumed immutable[*].\n\nUpdate-Note: The change to OBJ_nid2obj should be compatible. The changes\nto X509_PUBKEY_set0_param and X509_ALGOR_set0 may require fixing some\npointer types.\n\n[*] This is *almost* honored by all of our functions. The exception is\nc2i_ASN1_OBJECT, which instead checks the DYNAMIC flag as part of the\nobject reuse business. This would come up if we ever embedded\nASN1_OBJECTs directly in structs.\n\nChange-Id: I1e6c700645c12b43323dd3887adb74e795c285b9\nReviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/46164\nCommit-Queue: David Benjamin \u003cdavidben@google.com\u003e\nCommit-Queue: Adam Langley \u003cagl@google.com\u003e\nReviewed-by: Adam Langley \u003cagl@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3bf1abf32d1c5d60c0eb16a8f62330471d58cf58",
      "old_mode": 33188,
      "old_path": "crypto/obj/obj.c",
      "new_id": "3053132da4a9231a70fdfc2729c0bbc68671cbd8",
      "new_mode": 33188,
      "new_path": "crypto/obj/obj.c"
    },
    {
      "type": "modify",
      "old_id": "107bdea7f9abd6aaecb4dbd6f1b3294a4e8cc6e6",
      "old_mode": 33188,
      "old_path": "crypto/pkcs7/pkcs7_x509.c",
      "new_id": "5afd28b76c0544e6526cfbf56c54fee672ee9b9c",
      "new_mode": 33188,
      "new_path": "crypto/pkcs7/pkcs7_x509.c"
    },
    {
      "type": "modify",
      "old_id": "9ab6e9dab484a524a7f6516b08c7dc198662bc5b",
      "old_mode": 33188,
      "old_path": "crypto/x509/x509_req.c",
      "new_id": "d7da62048b4389601c607de45f531b73be514feb",
      "new_mode": 33188,
      "new_path": "crypto/x509/x509_req.c"
    },
    {
      "type": "modify",
      "old_id": "13c9a8cc8066eb42b4ba719c9c93de12135cd9d1",
      "old_mode": 33188,
      "old_path": "crypto/x509/x_algor.c",
      "new_id": "7b3d7903dbff4a2a70e19e17720f09305f5bbca3",
      "new_mode": 33188,
      "new_path": "crypto/x509/x_algor.c"
    },
    {
      "type": "modify",
      "old_id": "9d9397cb80aad6a6c9f79e38917bbae4ae2b6fae",
      "old_mode": 33188,
      "old_path": "crypto/x509/x_attrib.c",
      "new_id": "194f9e18ce559b705572cd1a89b8d174a64380f5",
      "new_mode": 33188,
      "new_path": "crypto/x509/x_attrib.c"
    },
    {
      "type": "modify",
      "old_id": "37dee49801a9ca9e4ced42ac8cb5b00d695d40d1",
      "old_mode": 33188,
      "old_path": "crypto/x509/x_pubkey.c",
      "new_id": "c3fb1e390f4b7c425b02792216b0835215bd4597",
      "new_mode": 33188,
      "new_path": "crypto/x509/x_pubkey.c"
    },
    {
      "type": "modify",
      "old_id": "216e7aea37d0f53435c805b8419f7c788e85853b",
      "old_mode": 33188,
      "old_path": "crypto/x509v3/v3_cpols.c",
      "new_id": "a2ed01c791f66f84f3933e115efcc971782d186d",
      "new_mode": 33188,
      "new_path": "crypto/x509v3/v3_cpols.c"
    },
    {
      "type": "modify",
      "old_id": "9269553e46df80fe582f43cc5d9caabc7992e728",
      "old_mode": 33188,
      "old_path": "include/openssl/asn1.h",
      "new_id": "3c75ee884196de616122a1b8e672ca0a4bdd42d8",
      "new_mode": 33188,
      "new_path": "include/openssl/asn1.h"
    },
    {
      "type": "modify",
      "old_id": "764188f482798e70e14e67e500ee34af0ee392e8",
      "old_mode": 33188,
      "old_path": "include/openssl/obj.h",
      "new_id": "49b7adc5c6e58ff9f474d63001c2a42edaed0f51",
      "new_mode": 33188,
      "new_path": "include/openssl/obj.h"
    },
    {
      "type": "modify",
      "old_id": "86896af15d34e92360c5cfb426c4bd14e2367da5",
      "old_mode": 33188,
      "old_path": "include/openssl/x509.h",
      "new_id": "5263d31101c4d1e9cdf95e33d7dd1532e5dbd48b",
      "new_mode": 33188,
      "new_path": "include/openssl/x509.h"
    }
  ]
}
