Write CRC for Standard Zip Encryption
This commit is contained in:
1 parent
673b7b98d0
commit
f2052480f0
2 files changed
+1
-2
No files matched your search
@@ -332,7 +332,7 @@ func (w *fileWriter) close() error {
|
|||||||
// update FileHeader
|
// update FileHeader
|
||||||
fh := w.header.FileHeader
|
fh := w.header.FileHeader
|
||||||
// ae-2 we don't write out CRC
|
// ae-2 we don't write out CRC
|
||||||
if !fh.IsEncrypted() {
|
if !fh.IsEncrypted() || fh.encryption == ZipStandardEncryption {
|
||||||
fh.CRC32 = w.crc32.Sum32()
|
fh.CRC32 = w.crc32.Sum32()
|
||||||
}
|
}
|
||||||
fh.CompressedSize64 = uint64(w.compCount.count)
|
fh.CompressedSize64 = uint64(w.compCount.count)
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ func (z *zipCryptoWriter) Write(p []byte) (n int, err error) {
|
|||||||
n += 12
|
n += 12
|
||||||
}
|
}
|
||||||
z.w.Write(z.z.Encrypt(p))
|
z.w.Write(z.z.Encrypt(p))
|
||||||
//z.fw.FileHeader.CompressedSize += uint32(n)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user