XNetworking: read CERT_CHAIN_CONTEXT at its real offsets #47
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!47
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/47/head"
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?
@gefydev on GitHub · 2026-11-22 21:32 UTC · original
gefydev:xnetworking-chain-offsets→main· +73 −27 · 1 files · 1 commits · merged 2026-11-22 21:41 UTCextract_chain_certsreadcChain/rgpChainat +16 / +24 andcElement/rgpElementat +20 / +24. Both structs start withcbSizeand an 8-byteCERT_TRUST_STATUS, so inwincrypt.hthe counts are at +12 and the arrays at +16. The walk found no chain, andXNetworkingVerifyServerCertificatefailed every thumbprint pin withCERT_E_UNTRUSTEDROOT. This only affects titles that pass pins; without pins the chain's certificates are not compared.The chain is now read through small
repr(C)structs, like the other CryptoAPI structs in the file, so no newwindows-sysfeature is needed. #37 fixed the same thing and was closed by its author. This is a smaller version of that fix.Validation
chain_certs_read_at_the_sdk_offsetsbuilds a chain byte by byte at the documented offsets. It fails onmain(no certificates come back) and passes with the fix.cargo test -p xcl --lib: 330 passed, 0 failed, on Windows GNU under Wine. I did not run the e2e or GPU tests.@ivall on GitHub · 2026-11-22 21:42 UTC · original
Thanks, merged! The offsets match
wincrypt.hon x64:cChain/cElement@ +12 aftercbSizeand the 8-byteCERT_TRUST_STATUS, the arrays @ +16,pCertContext@ +8. I checked it with the MSVC toolchain on Windows: all tests pass, 337 lib tests with your new one, the e2e test title, and the GPU tests.