Experiment with using ITaggedData for AES extra data handling #470
+125
−31
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.
This is an experiment to use the ITaggedData machinery for handling the AES extra data, too see how it might effect things, and to think if it might be useful for #443 (to have the extra data handling in a central place).
Notes:
It changes the TagID property on ITaggedData from
short
toushort
to accomodate the 0x9901 value for the AES extra data. Some of the other apis use int rather than short so that might be more consistent, not sure if other places could be changed to keep it working withshort
though.Not sure if using ZipHelperStream to unpack the data instead of reading array values is more extra overhead than would be ideal, though i think the read functions in
ZipExtraData
might already do more size checks than they really need to, so perhaps it could be tuned in general?Similar on the
GetData()
side - building the fixed 7 byte array with a temporary stream and 7 calls to write byte is perhaps not the optimal approach there.I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.