summaryrefslogtreecommitdiff
path: root/zip/ZipArchive/ZipCrc32Cryptograph.h
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2023-12-17 21:23:58 +0100
committerTomas Bzatek <tbzatek@redhat.com>2023-12-17 21:23:58 +0100
commit02d6107c97b48888362e7c6a70dcac323c89d741 (patch)
tree5069a77adaf73f7249ac79b6c49a47168a647ef8 /zip/ZipArchive/ZipCrc32Cryptograph.h
parent4e17c2527b106f1b493a3ac77c89858d14f834e2 (diff)
downloadtuxcmd-modules-02d6107c97b48888362e7c6a70dcac323c89d741.tar.xz
ZipArchive: Update to the 4.6.9 release
Diffstat (limited to 'zip/ZipArchive/ZipCrc32Cryptograph.h')
-rw-r--r--zip/ZipArchive/ZipCrc32Cryptograph.h19
1 files changed, 11 insertions, 8 deletions
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)
{