fix(oidc): use SHA-512 left-32 at_hash for EdDSA id_tokens #359
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-352-at-hash-sha512-eddsa"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bunyip signs ID tokens with EdDSA (Ed25519) but computed the at_hash claim as base64url of the left 16 bytes of SHA-256, which is the RS256/ES256 construction. A conformant EdDSA relying party derives at_hash from the algorithm's internal hash (SHA-512 for Ed25519) and would reject the ID token on both the different digest and the different length. Switch to base64url(left 32 bytes of SHA-512(access_token)) so the OP is forward-compatible with a strict EdDSA RP. Kept identical to menkent's OP (MKT-60).
Extract the computation into an at_hash_eddsa helper and add a unit test asserting the value equals an independently computed SHA-512-left-32, that it is 43 unpadded base64url chars, and that it differs from the former SHA-256-left-16 value.
#BUNYIP-352