)]}'
{
  "commit": "ccd7c6bcd7add4d07c7831225cbba1cec8b2d8c1",
  "tree": "90d1166223dc96a3d8b9e45f555eff6c5624a852",
  "parents": [
    "0081a8dbac62663087b5b9979c23f4b04175721c"
  ],
  "author": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Tue Nov 17 12:11:40 2026 -0500"
  },
  "committer": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Tue Nov 17 12:11:40 2026 -0500"
  },
  "message": "jwks: reject an EC private key whose d does not match (x, y)\n\nAn EC private JWK loaded even when its \"d\" was not the private key for\nthe JWK\u0027s public point (x, y). Each backend imported the private scalar\nand the public coordinates independently and never checked that d is in\nrange and d*G \u003d\u003d (x, y) (RFC 7518 6.2.2.1), so a token could be built\nwith a key the JWK does not actually describe. The OKP path already\nmakes the analogous check; EC now matches it.\n\nOne check per backend, before the item is populated, failing with\n\"EC private key does not match its public key\":\n\n- OpenSSL: pctx_to_pem() grows a \"check\" flag that openssl_process_ec()\n  sets for a private key; it runs EVP_PKEY_pairwise_check() on the made\n  key. RSA/OKP/ML-DSA pass check\u003d0 and are unchanged.\n- GnuTLS: gnutls_process_ec() calls gnutls_privkey_verify_params() after\n  importing d with the claimed (x, y). The import already rejects d \u003d 0;\n  verify_params rejects an in-range or oversized d whose d*G is not the\n  public point.\n- MbedTLS: mbedtls_process_ec() exports the public key PSA derives from\n  the imported scalar and compares it to the JWK\u0027s 0x04 || X || Y. The\n  scalar import already rejects d \u003d 0 and d \u003e\u003d n.\n\nThe GnuTLS and MbedTLS import-failure branches are now reached by a\nzero / out-of-range d, so their LCOV_EXCL markers are dropped. No\npublic API, exported symbol, or ABI change: the three process_ec\nfunctions and the new OpenSSL helper are internal. Scope is EC only;\nRSA/OKP private-member disagreement is a separate follow-up.\n\nFour SET_OPS() loop tests in tests/jwt_security.c load P-256 (and one\nP-521) keys that reuse a real public point with a tampered d (0, the\ngroup order n, and 1), asserting the error flag on every backend.\n\nSigned-off-by: Ben Collins \u003cbcollins@libjwt.io\u003e\nCo-Authored-By: Claude Opus 4.8 \u003cnoreply@anthropic.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c34367f0f8f43cee58f0a0baa0e8db2dcd843fa0",
      "old_mode": 33188,
      "old_path": "libjwt/gnutls/jwk-parse.c",
      "new_id": "259b8c3fe8dc6cde3b0f3a755c220f90ba92b9a5",
      "new_mode": 33188,
      "new_path": "libjwt/gnutls/jwk-parse.c"
    },
    {
      "type": "modify",
      "old_id": "c00e83150e01983005b95dc27722e2da4dbfec10",
      "old_mode": 33188,
      "old_path": "libjwt/mbedtls/jwk-parse.c",
      "new_id": "4c22c7b90e8e5b507308e663288a3826e2397456",
      "new_mode": 33188,
      "new_path": "libjwt/mbedtls/jwk-parse.c"
    },
    {
      "type": "modify",
      "old_id": "147bd929643db35d351d7ecc0de79695ebdf7e41",
      "old_mode": 33188,
      "old_path": "libjwt/openssl/jwk-parse.c",
      "new_id": "b3f337b48e941cc175116fad2ebfb8b8ac5ccfcd",
      "new_mode": 33188,
      "new_path": "libjwt/openssl/jwk-parse.c"
    },
    {
      "type": "modify",
      "old_id": "3435380f411ffdbfb2196372afe3baec408e169b",
      "old_mode": 33188,
      "old_path": "tests/jwt_security.c",
      "new_id": "b12f552379e880aa4cadac99b5e36782db578010",
      "new_mode": 33188,
      "new_path": "tests/jwt_security.c"
    }
  ]
}
