XNetworking: read CERT_CHAIN_CONTEXT at its real offsets #46
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/47"
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?
Imported from ivall/xcl. Originally posted by gefydev on 2026-11-22T21:32:36Z.
extract_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.Imported from ivall/xcl. Originally posted by ivall on 2026-11-22T21:42:01Z.
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.