)]}'
{
  "commit": "6ef66d28c64bae5001e860cd103c07a8f5b38e8f",
  "tree": "a1c59d226d49e5d6c7306a0a9dd90e12bff9bfc5",
  "parents": [
    "37cf1efe79d91a62c4ccc73b87865b27ca5a7bdf"
  ],
  "author": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Thu Jun 18 10:18:49 2026 -0400"
  },
  "committer": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Thu Jun 18 10:18:49 2026 -0400"
  },
  "message": "jwe: add AES-GCM Key Wrap (A128/192/256GCMKW, RFC 7518 4.7)\n\nAdd the GCM-based key-management algorithms A128GCMKW/A192GCMKW/A256GCMKW: the\nCEK is wrapped by AES-GCM under the oct KEK with a fresh 96-bit IV and an empty\nAAD, and the resulting IV and authentication tag travel as the per-recipient\n\"iv\"/\"tag\" header parameters.\n\nNo new backend code: the wrap/unwrap reuse the existing content-encryption GCM\nops (A128GCMKW -\u003e A128GCM, etc., chosen by KEK size). jwe_gcmkw_wrap/unwrap\n(jwe.c) generate the IV and write/read \"iv\"/\"tag\" through the key-management\nheader, which jwe-common.c already routes to the protected header (Compact) or\nthe per-recipient header (JSON) -- exactly as it threads the ECDH-ES \"epk\". A\nfresh CSPRNG IV per wrap is generated internally and is never caller-supplied\n(RFC 7518 8.7: nonce reuse under one KEK is a catastrophic GCM break). On\ndecrypt a bad key-unwrap tag funnels to a random CEK so the content AEAD fails\nuniformly (RFC 7516 11.5). \"iv\"/\"tag\" join the reserved header names so an\napplication cannot override them.\n\nAlso fix a pre-existing leak so the JWE builder is reusable: wrap_recipient now\nfrees any Encrypted Key left from a previous jwe_builder_generate() before\nwrapping a recipient again (affected every wrapping alg, not just GCM-KW).\n\ntests/jwe_gcmkw.c (both JSON backends, all crypto backends): round-trip all\nthree sizes (Compact + Flattened + General JSON), GCM-KW wrapping a CBC-HMAC\nCEK, fresh-IV-on-reuse (reuses one builder), tamper -\u003e reject, wrong KEK length\n-\u003e reject. 33/33 suites pass locally (MbedTLS 4.1) and in the CI image\n(MbedTLS 3.6.6); valgrind-clean. @since 3.6.0 on the new enum values; README\nJWE key-management matrix updated.\n\nCloses #309\n\nCo-Authored-By: Claude Opus 4.8 (1M context) \u003cnoreply@anthropic.com\u003e\nSigned-off-by: Ben Collins \u003cbcollins@libjwt.io\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8539e0eefa7db8e143a220ce89d81a00d11e49dd",
      "old_mode": 33188,
      "old_path": "CMakeLists.txt",
      "new_id": "4a361ec789a257fa2bd859d9d25f68e62a5514dc",
      "new_mode": 33188,
      "new_path": "CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "509063a3bc9af12dcd4bc472a34703dd2353a70c",
      "old_mode": 33188,
      "old_path": "README.md",
      "new_id": "abbee9d79fd03855e0054ae5a0e1d069b7ff7195",
      "new_mode": 33188,
      "new_path": "README.md"
    },
    {
      "type": "modify",
      "old_id": "52aab010c346995e120926098ca44191732aa107",
      "old_mode": 33188,
      "old_path": "include/jwt.h",
      "new_id": "5b0aef602d30b397c4609ee3a825064101319225",
      "new_mode": 33188,
      "new_path": "include/jwt.h"
    },
    {
      "type": "modify",
      "old_id": "9ddd458948d4fb3b8dbef71af728913400855245",
      "old_mode": 33188,
      "old_path": "libjwt/jwe-common.c",
      "new_id": "c47033783116b1c2b83c290dbbfae71725236962",
      "new_mode": 33188,
      "new_path": "libjwt/jwe-common.c"
    },
    {
      "type": "modify",
      "old_id": "ab1c4512d002bd6794b8e30fe6b740e0dbc5c12a",
      "old_mode": 33188,
      "old_path": "libjwt/jwe-setget.c",
      "new_id": "2808ec621b119d20dbddf9f0aa7c26e060b128dd",
      "new_mode": 33188,
      "new_path": "libjwt/jwe-setget.c"
    },
    {
      "type": "modify",
      "old_id": "2f1b50957fcd4faa9647e9975e62009c42efbb7f",
      "old_mode": 33188,
      "old_path": "libjwt/jwe.c",
      "new_id": "6a8a28d7121ed30f7adc3dfb541df27f8c36b5de",
      "new_mode": 33188,
      "new_path": "libjwt/jwe.c"
    },
    {
      "type": "modify",
      "old_id": "aa3dd5a87b75d60c97697208980de2aafb5a4f1f",
      "old_mode": 33188,
      "old_path": "libjwt/jwt-private.h",
      "new_id": "726c3a3308b5f6f2a2d1e873311dbdc647ab9059",
      "new_mode": 33188,
      "new_path": "libjwt/jwt-private.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "ad34500dcabbd65c348200367ac52a129beb63ed",
      "new_mode": 33188,
      "new_path": "tests/jwe_gcmkw.c"
    }
  ]
}
