Skip to content

Zis aes - Fix HMAC Calculation #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 162 commits into
base: rw/zis_aes
Choose a base branch
from

Conversation

remogloor
Copy link

Hi

I took a look at your draft for ZipInputStream AES support. The problem with the HMAC calculation is that your implementation always decrypted and calculated HMAC for the entire input buffer. But actually it should only decrypt and calculate the HMAC up to the compressed size of the current entry. This pull request fixes that problem and all the Unit Tests pass.

You might want to look into that implementation again as I don't know from your changes if there is anything else that needs to be changed.

Best regards
Remo


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.

Numpsy and others added 30 commits April 13, 2020 15:19
Change the BZip2 Compress/Decompress functions to throw ArgumentNullxception rather than Exception when null stream parameters are provided
…archives

* Store ZipEntry.DateTime in dedicated backing field  
This allows reading values with a higher resolution than DOS time (2 second accuracy).

* Fix getting unix modification time in ZIP files
InfoZIP actually does respect a file's modification time, even if the access time and/or creation time are not set.

* Remove backing field for ZipEntry.DosTime, convert to and from ZipEntry.DateTime instead
This prevents the two values from becoming potentially inconsistent.
copyCount was being computed but not passed to Array.Copy(), which caused an
exception to be thrown when enough bytes were read from an encrypted stream.
* fix doc comment in ZipInputStream.BodyRead
* fix doc comment in ZipOutputStream.SetComment
* add encoding parameter to creating tar entry

default is same as current master behavior(omit upper byte)

* add encoding tests(cp932) and add doc comment(icsharpcode#364)

* add header bytes test and mark obsolete methods without encodings(icsharpcode#364)

but IEntryFactory does not considering name encoding.

* forget to mark as obsoleting(icsharpcode#364)

* add doc comment for name encoding parameter (icsharpcode#364)
…sswords when decrypting AES entries

* Add unit test for reading an AES encrypted entry with an empty password
* Allow ZipFile to accept empty strings as passwords when decrypting AES entries
…e written before flush

* Add unit tests to repro icsharpcode#382
* Add an override of Flush() to GZipOutputStream to ensure the headers is writen before flushing
…g with FastZip

* When extracting folders with FastZip, reset the last modified time if the RestoreDateTimeOnExtract option is enabled
* Add unit test for restoring directory timestamps when extracing with fastzip and RestoreDateTimeOnExtract is true
Co-authored-by: nils måsén <nils@piksel.se>
* Add a variant of FastZip.CreateZip with a leaveOpen parameter to control output stream disposal
* Add unit test for FastZip.CreateZip leaving the stream open or disposed as required
dependabot bot and others added 24 commits February 2, 2022 10:36
…csharpcode#711)

Bumps [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) from 1.3.1 to 1.3.3.
- [Release notes](https://github.com/icsharpcode/SharpZipLib/releases)
- [Changelog](https://github.com/icsharpcode/SharpZipLib/blob/master/docs/Changes.txt)
- [Commits](icsharpcode/SharpZipLib@v1.3.1...v1.3.3)

---
updated-dependencies:
- dependency-name: SharpZipLib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix(tar): read full extended headers

* Update src/ICSharpCode.SharpZipLib/Tar/TarExtendedHeaderReader.cs
…arpcode#766)

Replace insecure obsolete method (new RNGCryptoServiceProvider()) with RandomNumberGenerator.Create() in PkzipClassic, ZipFile and ZipOutputStream.

See docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.rngcryptoserviceprovider?view=net-6.0 and dotnet/runtime#40169
Co-authored-by: nils måsén <nils@piksel.se>
Co-authored-by: Simon Ensslen <simon.ensslen@griesser.ch>
changes needed for the upcoming release, mainly related to .NET 6 compatibility
@remogloor remogloor force-pushed the zis_aes branch 2 times, most recently from 769b6b3 to 5972bae Compare October 18, 2022 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.