Repository navigation
Include the filename in the zip data map key - #6317
Merged
Merged
Conversation
.NET has a bunch of cases where symbol packages and non-symbol packages are identical. This occurs when there are either no symbols in a symbol package (e.g. a sources package), and cases where an original package also contains symbols. SignTool does not like this. The primary issue is that the zip data map (for each container) only uses the content hash as the key. This means that zip files with different file names will have the same content hash and map to the same zip data. This is problematic because signing information can be **different** based on filename. For example, we may choose to sign .nupkgs but not the corresponding .symbol.nupkg. If the content hash is the key for the zip data map, then the .symbol.nupkg and .nupkg are de-duplicated and the file signing information we choose to use is arbitrary. To fix this, use the file name in the zip map key, like we do file the map of files to their signed data.
chcosta
reviewed
Oct 2, 2020
| if (fileSignInfo.IsContainer()) | ||
| { | ||
| if (_zipDataMap.ContainsKey(contentHash)) | ||
| /*if (_zipDataMap.ContainsKey(contentHash)) |
Member
There was a problem hiding this comment.
Did you intend to delete this block post-validation?
Member
Author
There was a problem hiding this comment.
Yeah....I wanted to remind myself of this bit until I'm sure it can go. I'm about 90% sure of this fix though.
chcosta
approved these changes
Oct 2, 2020
… into include-filename-in-zip-map-key
chcosta
approved these changes
Oct 6, 2020
jcagme
approved these changes
Oct 6, 2020
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.
.NET has a bunch of cases where symbol packages and non-symbol packages are identical.
This occurs when there are either no symbols in a symbol package (e.g. a sources package), and
cases where an original package also contains symbols. SignTool does not like this.
The primary issue is that the zip data map (for each container) only uses the content
hash as the key. This means that zip files with different file names will have the same content
hash and map to the same zip data. This is problematic because signing information can
be different based on filename. For example, we may choose to sign .nupkgs but not
the corresponding .symbol.nupkg. If the content hash is the key for the zip data map,
then the .symbol.nupkg and .nupkg are de-duplicated and the file signing information we choose to use
is arbitrary.
To fix this, use the file name in the zip map key, like we do file the map of files to their signed data.