From ff2144442972075202baa1e83d59660cfd024e1a Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Thu, 9 Apr 2020 19:39:46 +0200 Subject: [PATCH] build: implement zip64 stripping (#22998) When zip contains files larger than 4GB 4bytes length headers are not sufficient anymore. Zip64 defines an extra header 0x0001 which may contain 8byte lengthed (16 exabytes) lengths [uncompressed and compressed]. Read this value when performing extra data cleaning and override the bogus value if the header is available. Read https://blog.yaakov.online/zip64-go-big-or-go-home/ for more information on Zip64 extra header. This is the first known implementation of zip64 stripping. --- script/release/uploaders/upload.py | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/script/release/uploaders/upload.py b/script/release/uploaders/upload.py index 2261e528bbc6..abf2d3d8ef1e 100755 --- a/script/release/uploaders/upload.py +++ b/script/release/uploaders/upload.py @@ -182,7 +182,7 @@ def zero_zip_date_time(fname): def _zero_zip_date_time(zip_): - def purify_extra_data(mm, offset, length): + def purify_extra_data(mm, offset, length, compressed_size=0): extra_header_struct = Struct("