aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/ZipArchive/3rdparty/minizip/zip.c
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-12-25 12:46:59 +0530
committerRoopesh Chander <roop@roopc.net>2018-12-25 12:48:04 +0530
commitc563a2434898906e459264b2e4941d20b3ebc133 (patch)
treeb406c83917726578a6500cc1082dbe2b0e8bf80c /WireGuard/WireGuard/ZipArchive/3rdparty/minizip/zip.c
parentTunnel edit: Fix crash (diff)
downloadwireguard-apple-c563a2434898906e459264b2e4941d20b3ebc133.tar.xz
wireguard-apple-c563a2434898906e459264b2e4941d20b3ebc133.zip
minizip: Remove zip encryption code
We can now remove -DNOCRYPT cflag while compiling Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/ZipArchive/3rdparty/minizip/zip.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/WireGuard/WireGuard/ZipArchive/3rdparty/minizip/zip.c b/WireGuard/WireGuard/ZipArchive/3rdparty/minizip/zip.c
index 278af01..9002d66 100644
--- a/WireGuard/WireGuard/ZipArchive/3rdparty/minizip/zip.c
+++ b/WireGuard/WireGuard/ZipArchive/3rdparty/minizip/zip.c
@@ -153,11 +153,6 @@ typedef struct
ZPOS64_T pos_zip64extrainfo;
ZPOS64_T totalCompressedData;
ZPOS64_T totalUncompressedData;
-#ifndef NOCRYPT
- unsigned long keys[3]; /* keys defining the pseudo-random sequence */
- const z_crc_t* pcrc_32_tab;
- int crypt_header_size;
-#endif
} curfile64_info;
typedef struct
@@ -178,12 +173,6 @@ typedef struct
} zip64_internal;
-
-#ifndef NOCRYPT
-#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED
-#include "crypt.h"
-#endif
-
local linkedlist_datablock_internal* allocate_new_datablock()
{
linkedlist_datablock_internal* ldi;
@@ -1064,12 +1053,6 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename,
uInt i;
int err = ZIP_OK;
-# ifdef NOCRYPT
- (void)(crcForCrypting);
- if (password != NULL)
- return ZIP_PARAMERROR;
-# endif
-
if (file == NULL)
return ZIP_PARAMERROR;
@@ -1237,24 +1220,6 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename,
}
-# ifndef NOCRYPT
- zi->ci.crypt_header_size = 0;
- if ((err==Z_OK) && (password != NULL))
- {
- unsigned char bufHead[RAND_HEAD_LEN];
- unsigned int sizeHead;
- zi->ci.encrypt = 1;
- zi->ci.pcrc_32_tab = get_crc_table();
- /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/
-
- sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting);
- zi->ci.crypt_header_size = sizeHead;
-
- if (ZWRITE64(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead)
- err = ZIP_ERRNO;
- }
-# endif
-
if (err==Z_OK)
zi->in_opened_file_inzip = 1;
return err;
@@ -1362,16 +1327,6 @@ local int zip64FlushWriteBuffer(zip64_internal* zi)
{
int err=ZIP_OK;
- if (zi->ci.encrypt != 0)
- {
-#ifndef NOCRYPT
- uInt i;
- int t;
- for (i=0;i<zi->ci.pos_in_buffered_data;i++)
- zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, zi->ci.buffered_data[i],t);
-#endif
- }
-
if (ZWRITE64(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) != zi->ci.pos_in_buffered_data)
err = ZIP_ERRNO;
@@ -1602,10 +1557,6 @@ extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_s
}
compressed_size = zi->ci.totalCompressedData;
-# ifndef NOCRYPT
- compressed_size += zi->ci.crypt_header_size;
-# endif
-
// update Current Item crc and sizes,
if(compressed_size >= 0xffffffff || uncompressed_size >= 0xffffffff || zi->ci.pos_local_header >= 0xffffffff)
{