From 02d6107c97b48888362e7c6a70dcac323c89d741 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 17 Dec 2023 21:23:58 +0100 Subject: ZipArchive: Update to the 4.6.9 release --- zip/ZipArchive/ZipCrc32Cryptograph.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'zip/ZipArchive/ZipCrc32Cryptograph.h') diff --git a/zip/ZipArchive/ZipCrc32Cryptograph.h b/zip/ZipArchive/ZipCrc32Cryptograph.h index a25edd0..756e727 100644 --- a/zip/ZipArchive/ZipCrc32Cryptograph.h +++ b/zip/ZipArchive/ZipCrc32Cryptograph.h @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// -// This source file is part of the ZipArchive library source distribution and -// is Copyrighted 2000 - 2007 by Artpol Software - Tadeusz Dracz +// This source file is part of the ZipArchive Library Open Source distribution +// and is Copyrighted 2000 - 2022 by Artpol Software - Tadeusz Dracz // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -9,7 +9,7 @@ // // For the licensing details refer to the License.txt file. // -// Web Site: http://www.artpol-software.com +// Web Site: https://www.artpol-software.com //////////////////////////////////////////////////////////////////////////////// /** @@ -43,9 +43,12 @@ class ZIP_API CZipCrc32Cryptograph : public CZipCryptograph { public: - CZipCrc32Cryptograph(){} + CZipCrc32Cryptograph() + { + memset(m_keys, 0, 3 * sizeof(DWORD)); + } - bool InitDecode(CZipAutoBuffer& password, CZipFileHeader& currentFile, CZipStorage& storage); + bool InitDecode(CZipAutoBuffer& password, CZipFileHeader& currentFile, CZipStorage& storage, bool ignoreCheck); void InitEncode(CZipAutoBuffer& password, CZipFileHeader& currentFile, CZipStorage& storage); void Decode(char* pBuffer, DWORD uSize) { @@ -82,7 +85,7 @@ public: /** Returns the CRC table. */ - static const DWORD* GetCRCTable() + static const z_crc_t* GetCRCTable() { return zarch_get_crc_table(); } @@ -103,8 +106,8 @@ private: void CryptUpdateKeys(char c); DWORD CryptCRC32(DWORD l, char c) { - const DWORD *CRC_TABLE = zarch_get_crc_table(); - return CRC_TABLE[(l ^ c) & 0xff] ^ (l >> 8); + const z_crc_t* CRC_TABLE = zarch_get_crc_table(); + return (DWORD)CRC_TABLE[(l ^ c) & 0xff] ^ (l >> 8); } void CryptEncode(char &c) { -- cgit v1.2.3