[Python-ideas] hook zipfile.ZipExtFile to check secure hash sums

Daniel Holth dholth at gmail.com
Fri Aug 31 03:14:30 CEST 2012

On Thu, Aug 30, 2012 at 1:05 PM, Serhiy Storchaka <storchaka at gmail.com> wrote:
> On 29.08.12 19:08, Daniel Holth wrote:
>> I am checking the sha256 sums of all the files in a zip archive as it
>> is being extracted by overriding ZipExtFile._update_crc, but it is
>> inconvenient.
>> It would be nice to have a hook, for example the ZipExtFile
>> constructor could be a property of ZipFile and conveniently replaced
>> with a ZipExtFile subclass.
> Where do you get the checksums for control? ZIP file format specifies the
> checksum algorithm, file with another saved checksums is not ZIP file (or is
> invalid ZIP file).

The secure checksums are just listed in a different digitally signed
file. It is nice to verify them during extraction instead of having to
re-read the file.

More information about the Python-ideas mailing list