From 166e1a9aa11ab30e5b418230b8c32486242f3df8 Mon Sep 17 00:00:00 2001 From: yeka Date: Sun, 16 Oct 2016 22:02:49 +0700 Subject: [PATCH] Write CRC for Standard Zip Encryption --- writer.go | 2 +- zipcrypto.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/writer.go b/writer.go index 37fa662..497f407 100644 --- a/writer.go +++ b/writer.go @@ -332,7 +332,7 @@ func (w *fileWriter) close() error { // update FileHeader fh := w.header.FileHeader // ae-2 we don't write out CRC - if !fh.IsEncrypted() { + if !fh.IsEncrypted() || fh.encryption == ZipStandardEncryption { fh.CRC32 = w.crc32.Sum32() } fh.CompressedSize64 = uint64(w.compCount.count) diff --git a/zipcrypto.go b/zipcrypto.go index e1e7745..309bc32 100644 --- a/zipcrypto.go +++ b/zipcrypto.go @@ -99,7 +99,6 @@ func (z *zipCryptoWriter) Write(p []byte) (n int, err error) { n += 12 } z.w.Write(z.z.Encrypt(p)) - //z.fw.FileHeader.CompressedSize += uint32(n) return }