)]}'
{
  "commit": "16a94930ac6edb19bc647a626f58a7b3fdc9dddf",
  "tree": "62263fb3bb6eac2192ffaa0a102ed77375d007f8",
  "parents": [
    "27a67557405dcf18567f4528aa537da25f0a34e2"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Wed Nov 17 14:01:11 2021 -0500"
  },
  "committer": {
    "name": "Adam Langley",
    "email": "agl@google.com",
    "time": "Thu Nov 18 20:48:43 2021 +0000"
  },
  "message": "Add various OpenSSL compatibility functions.\n\nThe non-_ex EVP_CIPHER_CTX Final functions are a bit interesting. Unlike\nEVP_DigestFinal(_ex), where the non-_ex version calls EVP_MD_CTX_cleanup\nfor you, the EVP_CIPHER_CTX ones do not automatically cleanup.\nEVP_CipherFinal and EVP_CipherFinal_ex are identical in all releases\nwhere they exist.\n\nThis appears to date to OpenSSL 0.9.7:\n\nPrior to OpenSSL 0.9.7, EVP_MD_CTX and EVP_CIPHER_CTX did not use void*\ndata fields. Instead, they just had a union of context structures for\nevery algorithm OpenSSL implemented.\n\nEVP_MD_CTX was truly cleanup-less. There were no EVP_MD_CTX_init or\nEVP_MD_CTX_cleanup functions at all. EVP_DigestInit filled things in\nwithout reference to the previous state. EVP_DigestFinal didn\u0027t cleanup\nbecause there was nothing to cleanup.\n\nEVP_CIPHER_CTX was also a union, but for some reason did include\nEVP_CIPHER_CTX_init and EVP_CIPHER_CTX_cleanup. EVP_CIPHER_CTX_init\nseemed to be optional: EVP_CipherInit with non-NULL EVP_CIPHER similarly\ndidn\u0027t reference the previous state. EVP_CipherFinal did not call\nEVP_CIPHER_CTX_cleanup, but EVP_CIPHER_CTX_cleanup didn\u0027t do anything.\nIt called an optional cleanup hook on the EVP_CIPHER, but as far as I\ncan tell, no EVP_CIPHER implemented it.\n\nThen OpenSSL 0.9.7 introduced ENGINE. The union didn\u0027t work anymore, so\nEVP_MD_CTX and EVP_CIPHER_CTX contained void* with allocated\ntype-specific data. The introduced EVP_MD_CTX_init and\nEVP_MD_CTX_cleanup. For (imperfect!) backwards compatibility,\nEVP_DigestInit and EVP_DigestFinal transparently called init/cleanup for\nyou. EVP_DigestInit_ex and EVP_DigestFinal_ex became the more flexible\nversions that left init/cleanup to the caller.\n\nEVP_CIPHER_CTX got the same treatment with\nEVP_CipherInit/EVP_CipherInit_ex, but *not*\nEVP_CipherFinal/EVP_CipherFinal_ex. The latter did the same thing. The\nhistory seems to be that 581f1c84940d77451c2592e9fa470893f6c3c3eb\nintroduced the Final/Final_ex split, with the former doing an\nauto-cleanup, then 544a2aea4ba1fad76f0802fb70d92a5a8e6ad85a undid it.\nLooks like the motivation is that EVP_CIPHER_CTX objects are often\nreused to do multiple operations with a single key. But they missed that\nthe split functions are now unnecessary.\n\nAmusingly, OpenSSL\u0027s documentation incorrectly said that EVP_CipherFinal\ncleaned up after the call until it was fixed in\n538860a3ce0b9fd142a7f1a62e597cccb74475d3. The fix says that some\nreleases cleaned up, but there were, as far as I can tell, no actual\nreleases with that behavior.\n\nI\u0027ve put the new Final functions in the deprecated section, purely\nbecause there is no sense in recommending two different versions of the\nsame function to users, and Final_ex seems to be more popular. But there\nisn\u0027t actually anything wrong with plain Final.\n\nChange-Id: Ic2bfda48fdcf30f292141add8c5f745348036852\nReviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/50485\nReviewed-by: Adam Langley \u003cagl@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3d920598c475855e8611bb5bfbf6582219da8cff",
      "old_mode": 33188,
      "old_path": "crypto/base64/base64.c",
      "new_id": "6ce6007f6899d71e7c1cb7bbfce06ebec787cd53",
      "new_mode": 33188,
      "new_path": "crypto/base64/base64.c"
    },
    {
      "type": "modify",
      "old_id": "c8695687cf1ac7706af0c20d78f493aeef6efa19",
      "old_mode": 33188,
      "old_path": "crypto/dsa/dsa.c",
      "new_id": "8e77ea392b802216a0736a1da47ac391cc4dd124",
      "new_mode": 33188,
      "new_path": "crypto/dsa/dsa.c"
    },
    {
      "type": "modify",
      "old_id": "51c96b4594cbd5940a4a11503ad876d65767b2a5",
      "old_mode": 33188,
      "old_path": "crypto/fipsmodule/cipher/cipher.c",
      "new_id": "64ee544a3902ac5d0abfe87e87fd5470871a03c6",
      "new_mode": 33188,
      "new_path": "crypto/fipsmodule/cipher/cipher.c"
    },
    {
      "type": "modify",
      "old_id": "c88546d7bf6968d98882cbb1f802c57617fa60de",
      "old_mode": 33188,
      "old_path": "include/openssl/base64.h",
      "new_id": "369ba9c3d0a79d91d9f0be94a6de70ed7298c883",
      "new_mode": 33188,
      "new_path": "include/openssl/base64.h"
    },
    {
      "type": "modify",
      "old_id": "09d72ec2c343f23409d35eca804a02e3290c86f1",
      "old_mode": 33188,
      "old_path": "include/openssl/cipher.h",
      "new_id": "2458847e5640fe955a9971aa77c27251e5091db5",
      "new_mode": 33188,
      "new_path": "include/openssl/cipher.h"
    },
    {
      "type": "modify",
      "old_id": "166525119f6fd1b90526d58250b045cd51a0fc96",
      "old_mode": 33188,
      "old_path": "include/openssl/dsa.h",
      "new_id": "e6ddce672c1bfd9a34bb6e5c7633750d2c50a7bd",
      "new_mode": 33188,
      "new_path": "include/openssl/dsa.h"
    }
  ]
}
