This commit is contained in:
Chris Hennick 2023-05-10 13:01:01 -07:00
parent 82cd28af3c
commit 7c39dbd4c2
No known key found for this signature in database
GPG key ID: 25653935CC8B6C74
2 changed files with 9 additions and 1 deletions

View file

@ -114,7 +114,7 @@
## [0.7.4] ## [0.7.4]
### Changed ### Merged from upstream
- Added experimental [`zip_next::unstable::write::FileOptions::with_deprecated_encryption`] API to enable encrypting - Added experimental [`zip_next::unstable::write::FileOptions::with_deprecated_encryption`] API to enable encrypting
files with PKWARE encryption. files with PKWARE encryption.

View file

@ -513,6 +513,14 @@ impl<W: Write + Seek> ZipWriter<W> {
.inner .inner
.prepare_next_writer(CompressionMethod::Stored, None)?; .prepare_next_writer(CompressionMethod::Stored, None)?;
self.inner.switch_to(make_plain_writer)?; self.inner.switch_to(make_plain_writer)?;
match mem::replace(&mut self.inner, Closed) {
Storer(MaybeEncrypted::Encrypted(writer)) => {
let crc32 = self.stats.hasher.clone().finalize();
self.inner = Storer(MaybeEncrypted::Unencrypted(writer.finish(crc32)?))
}
Storer(w) => self.inner = Storer(w),
_ => unreachable!()
}
let writer = self.inner.get_plain(); let writer = self.inner.get_plain();
if !self.writing_raw { if !self.writing_raw {