Repository navigation
[release/11.0] Read the cab signature from the correct reserved fields - #17367
Merged
Merged
Conversation
The per-cabinet reserved area of a signed cabinet starts with a 4 byte header, and the signature offset and size follow it. CabSecurityInfoProvider read the offset and the size from the first two fields, so it took the header as the offset and the real offset as the size. The bounds check then failed and every signed cab was reported as unsigned. Fix #17362 Co-authored-by: Copilot App <[email protected]>
BinaryWriter always writes little-endian but BitConverter.GetBytes uses the machine endianness, so the test mixed the two. Cabinet fields are little-endian, write them with BinaryPrimitives so the fixture is the same on every machine. Also note why cbCabinet is the signature offset, it is the size of the cabinet proper and signtool appends the signature after it. Both sample files agree. Co-authored-by: Copilot App <[email protected]>
akoeplinger
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #17363 to release/11.0
/cc @akoeplinger @nohwnd