1
Index: libzip-0.10.1/lib/zip_source_pkware.c
2
===================================================================
3
--- libzip-0.10.1.orig/lib/zip_source_pkware.c 2012-03-15 09:27:50.000000000 +0000
4
+++ libzip-0.10.1/lib/zip_source_pkware.c 2012-07-07 02:03:29.000000000 +0000
9
-static const uLongf *crc = NULL;
11
-#define CRC32(c, b) (crc[((c) ^ (b)) & 0xff] ^ ((c) >> 8))
15
static void decrypt(struct trad_pkware *, zip_uint8_t *,
21
- crc = get_crc_table();
23
if ((ctx=(struct trad_pkware *)malloc(sizeof(*ctx))) == NULL) {
24
_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
30
- ctx->key[0] = CRC32(ctx->key[0], b);
31
+ ctx->key[0] = crc32(ctx->key[0] ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL;
32
ctx->key[1] = (ctx->key[1] + (ctx->key[0] & 0xff)) * 134775813 + 1;
33
b = ctx->key[1] >> 24;
34
- ctx->key[2] = CRC32(ctx->key[2], b);
35
+ ctx->key[2] = crc32(ctx->key[2] ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL;