Fix types in contrib/minizip to match result of get_crc_table().

pull/40/head
takacsd 12 years ago committed by Mark Adler
parent 00dfee0b2e
commit 63ba7582b8
  1. 8
      contrib/minizip/crypt.h
  2. 2
      contrib/minizip/unzip.c
  3. 2
      contrib/minizip/zip.c

@ -32,7 +32,7 @@
/*********************************************************************** /***********************************************************************
* Return the next byte in the pseudo-random sequence * Return the next byte in the pseudo-random sequence
*/ */
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)
{ {
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
* unpredictable manner on 16-bit systems; not a problem * unpredictable manner on 16-bit systems; not a problem
@ -45,7 +45,7 @@ static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
/*********************************************************************** /***********************************************************************
* Update the encryption keys with the next byte of plain text * Update the encryption keys with the next byte of plain text
*/ */
static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) static int update_keys(unsigned long* pkeys,const z_crc_t* pcrc_32_tab,int c)
{ {
(*(pkeys+0)) = CRC32((*(pkeys+0)), c); (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
(*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
@ -62,7 +62,7 @@ static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int
* Initialize the encryption keys and the random header according to * Initialize the encryption keys and the random header according to
* the given password. * the given password.
*/ */
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t* pcrc_32_tab)
{ {
*(pkeys+0) = 305419896L; *(pkeys+0) = 305419896L;
*(pkeys+1) = 591751049L; *(pkeys+1) = 591751049L;
@ -91,7 +91,7 @@ static int crypthead(const char* passwd, /* password string */
unsigned char* buf, /* where to write header */ unsigned char* buf, /* where to write header */
int bufSize, int bufSize,
unsigned long* pkeys, unsigned long* pkeys,
const unsigned long* pcrc_32_tab, const z_crc_t* pcrc_32_tab,
unsigned long crcForCrypting) unsigned long crcForCrypting)
{ {
int n; /* index in random header */ int n; /* index in random header */

@ -188,7 +188,7 @@ typedef struct
# ifndef NOUNCRYPT # ifndef NOUNCRYPT
unsigned long keys[3]; /* keys defining the pseudo-random sequence */ unsigned long keys[3]; /* keys defining the pseudo-random sequence */
const unsigned long* pcrc_32_tab; const z_crc_t* pcrc_32_tab;
# endif # endif
} unz64_s; } unz64_s;

@ -157,7 +157,7 @@ typedef struct
ZPOS64_T totalUncompressedData; ZPOS64_T totalUncompressedData;
#ifndef NOCRYPT #ifndef NOCRYPT
unsigned long keys[3]; /* keys defining the pseudo-random sequence */ unsigned long keys[3]; /* keys defining the pseudo-random sequence */
const unsigned long* pcrc_32_tab; const z_crc_t* pcrc_32_tab;
int crypt_header_size; int crypt_header_size;
#endif #endif
} curfile64_info; } curfile64_info;

Loading…
Cancel
Save