Skip to content

Commit 46bf149

Browse files
committed
Code signing: fix corrupted ZIP files
When copying a ZIP entry unmodified, we were storing the uncompressed data as if it was compressed. This causes extraction of the .vsix to fail. Fix the corrupted ZIP file by storing compressed data instead of uncompressed data.
1 parent ce4eb42 commit 46bf149

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dist/sign-release.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,16 @@ func TransformZipGeneric(
374374
return err
375375
}
376376
if transformResult.newFile == nil {
377+
rawZIPEntryFile, err := zipEntry.OpenRaw()
378+
if err != nil {
379+
return err
380+
}
381+
377382
destinationZipEntryFile, err := destinationZipFile.CreateRaw(&zipEntry.FileHeader)
378383
if err != nil {
379384
return err
380385
}
381-
_, err = io.Copy(destinationZipEntryFile, zipEntryFile)
386+
_, err = io.Copy(destinationZipEntryFile, rawZIPEntryFile)
382387
if err != nil {
383388
return err
384389
}

0 commit comments

Comments
 (0)