Skip to content

Kerberos PAC: decode and encode client and device claims (PAC_CLIENT_CLAIMS_INFO / PAC_DEVICE_CLAIMS_INFO) - #357

Open
rcbjBlueMars wants to merge 1 commit into
developfrom
feature/pac-claims
Open

rcbjBlueMars wants to merge 1 commit into
developfrom
feature/pac-claims

Conversation

@rcbjBlueMars

Copy link
Copy Markdown
Contributor

Codec half of rcbj/iya-sts#493.

  • common/krb5/krb5_pac.js: NDR encode/decode of CLAIMS_SET_METADATA / CLAIMS_SET (MS-PAC 2.11, MS-ADTS 2.2.18), all source types and the four value types (INT64/UINT64 as BigInt, read back as decimal strings). XPRESS Huffman decompression (MS-XCA); LZNT1 and plain XPRESS are named, not decoded. Nothing is compressed on output. parsePac decodes types 13 and 15. buildPac takes spec.clientClaims. resignPac keeps both buffers and can replace or remove type 13.
  • common/krb5/krb5_describe.js shows the claims; the client/src copies are updated to match.
  • tests/krb5_pac_layout.js covers the round trips. Of 17 mutants, 14 were caught; the other 3 are equivalent.

The file is already synced byte-identically into iya-sts kerberos/ on rcbj/iya-sts feature/493. When the sts/ gitlink is bumped, bump it together with this PR, or krb5_codec_sync.js will see the two copies differ. No new file, so the Kerberos COPY closure owes nothing.

🤖 Generated with Claude Code

…IMS_INFO

For rcbj/iya-sts#493. krb5_pac.js gains an NDR encoder and decoder for
[MS-ADTS] 2.2.18's CLAIMS_SET_METADATA wrapping a CLAIMS_SET: every claims
source type, the four claim types (INT64, UINT64, STRING, BOOLEAN; the 64-bit
values as decimal strings through BigInt), the 16-bit enums, the union's
repeated discriminant and the [string] ids whose counts include the NUL.

A compressed set is decoded: COMPRESSION_FORMAT_XPRESS_HUFF ([MS-XCA] 2.2
LZ77+Huffman), bounded by the declared size and refusing an incomplete code.
LZNT1 and plain XPRESS are reported by name. Nothing is ever compressed.

parsePac() decodes types 13 and 15; buildPac() writes type 13 from
spec.clientClaims; resignPac() carries both buffers byte for byte (it always
did, and its comment said otherwise) and can replace or remove the client
claims (spec.clientClaims). krb5_describe.js shows the claims.

No new file, so the sts/ COPY closure and sync-to-mock-sts.sh's list are
unchanged. client/src's tracked copies follow common/krb5.

tests/krb5_pac_layout.js: hand-derived offsets for both streams, every type
at its extremes, refusals of unencodable values, decompression with a
test-only encoder over two tables, and claims signed, tampered, carried,
replaced and removed through a re-sign.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant