From 4cf4891d1bf9f76a523c3394aea02441ca3bb9af Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Mon, 20 May 2019 19:43:01 +0200 Subject: [PATCH] fixed length check for code1/2 as data length also contains iv length of 12 --- OpenCL/m17200_a0-pure.cl | 8 ++++---- OpenCL/m17200_a1-pure.cl | 8 ++++---- OpenCL/m17200_a3-pure.cl | 8 ++++---- OpenCL/m17220_a0-pure.cl | 4 ++-- OpenCL/m17220_a1-pure.cl | 8 ++++---- OpenCL/m17220_a3-pure.cl | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/OpenCL/m17200_a0-pure.cl b/OpenCL/m17200_a0-pure.cl index 002e95686..fe5c5c65c 100644 --- a/OpenCL/m17200_a0-pure.cl +++ b/OpenCL/m17200_a0-pure.cl @@ -725,8 +725,8 @@ KERNEL_FQ void m17200_sxx (KERN_ATTR_RULES_ESALT (pkzip_t)) update_key012 (key0, key1, key2, plain, l_crc32tab); } - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; mz_stream infstream; @@ -951,8 +951,8 @@ KERNEL_FQ void m17200_mxx (KERN_ATTR_RULES_ESALT (pkzip_t)) update_key012 (key0, key1, key2, plain, l_crc32tab); } - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; mz_stream infstream; diff --git a/OpenCL/m17200_a1-pure.cl b/OpenCL/m17200_a1-pure.cl index 11dfaf5cc..17d38756a 100644 --- a/OpenCL/m17200_a1-pure.cl +++ b/OpenCL/m17200_a1-pure.cl @@ -727,8 +727,8 @@ KERNEL_FQ void m17200_sxx (KERN_ATTR_ESALT (pkzip_t)) update_key012 (key0, key1, key2, plain, l_crc32tab); } - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; mz_stream infstream; @@ -957,8 +957,8 @@ KERNEL_FQ void m17200_mxx (KERN_ATTR_ESALT (pkzip_t)) update_key012 (key0, key1, key2, plain, l_crc32tab); } - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; mz_stream infstream; diff --git a/OpenCL/m17200_a3-pure.cl b/OpenCL/m17200_a3-pure.cl index 398a0490d..9da3ed1bf 100644 --- a/OpenCL/m17200_a3-pure.cl +++ b/OpenCL/m17200_a3-pure.cl @@ -740,8 +740,8 @@ KERNEL_FQ void m17200_sxx (KERN_ATTR_VECTOR_ESALT (pkzip_t)) update_key012 (key0, key1, key2, plain, l_crc32tab); } - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; mz_stream infstream; @@ -982,8 +982,8 @@ KERNEL_FQ void m17200_mxx (KERN_ATTR_VECTOR_ESALT (pkzip_t)) update_key012 (key0, key1, key2, plain, l_crc32tab); } - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; - if (esalt_bufs[digests_offset].hash.data_length >= 24 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) continue; + if (esalt_bufs[digests_offset].hash.data_length >= 36 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) continue; mz_stream infstream; diff --git a/OpenCL/m17220_a0-pure.cl b/OpenCL/m17220_a0-pure.cl index fd8dc57bd..c02b66c7d 100644 --- a/OpenCL/m17220_a0-pure.cl +++ b/OpenCL/m17220_a0-pure.cl @@ -721,8 +721,8 @@ KERNEL_FQ void m17220_sxx (KERN_ATTR_RULES_ESALT (pkzip_t)) update_key012 (key0, key1, key2, plain, l_crc32tab); } - if (esalt_bufs[digests_offset].hashes[idx].data_length >= 24 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) break; - if (esalt_bufs[digests_offset].hashes[idx].data_length >= 24 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) break; + if (esalt_bufs[digests_offset].hashes[idx].data_length >= 36 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) break; + if (esalt_bufs[digests_offset].hashes[idx].data_length >= 36 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) break; if (esalt_bufs[digests_offset].hashes[idx].data_type_enum == 1) { diff --git a/OpenCL/m17220_a1-pure.cl b/OpenCL/m17220_a1-pure.cl index 18990b951..ee7df3834 100644 --- a/OpenCL/m17220_a1-pure.cl +++ b/OpenCL/m17220_a1-pure.cl @@ -721,8 +721,8 @@ KERNEL_FQ void m17220_sxx (KERN_ATTR_ESALT (pkzip_t)) update_key012 (key0, key1, key2, plain, l_crc32tab); } - if (esalt_bufs[digests_offset].hashes[idx].data_length >= 24 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) break; - if (esalt_bufs[digests_offset].hashes[idx].data_length >= 24 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) break; + if (esalt_bufs[digests_offset].hashes[idx].data_length >= 36 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) break; + if (esalt_bufs[digests_offset].hashes[idx].data_length >= 36 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) break; if (esalt_bufs[digests_offset].hashes[idx].data_type_enum == 1) { @@ -988,8 +988,8 @@ KERNEL_FQ void m17220_mxx (KERN_ATTR_ESALT (pkzip_t)) update_key012 (key0, key1, key2, plain, l_crc32tab); } - if (esalt_bufs[digests_offset].hashes[idx].data_length >= 24 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) break; - if (esalt_bufs[digests_offset].hashes[idx].data_length >= 24 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) break; + if (esalt_bufs[digests_offset].hashes[idx].data_length >= 36 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) break; + if (esalt_bufs[digests_offset].hashes[idx].data_length >= 36 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) break; if (esalt_bufs[digests_offset].hashes[idx].data_type_enum == 1) { diff --git a/OpenCL/m17220_a3-pure.cl b/OpenCL/m17220_a3-pure.cl index 2140860eb..fd5985aa4 100644 --- a/OpenCL/m17220_a3-pure.cl +++ b/OpenCL/m17220_a3-pure.cl @@ -733,8 +733,8 @@ KERNEL_FQ void m17220_sxx (KERN_ATTR_VECTOR_ESALT (pkzip_t)) update_key012 (key0, key1, key2, plain, l_crc32tab); } - if (esalt_bufs[digests_offset].hashes[idx].data_length >= 24 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) break; - if (esalt_bufs[digests_offset].hashes[idx].data_length >= 24 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) break; + if (esalt_bufs[digests_offset].hashes[idx].data_length >= 36 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) break; + if (esalt_bufs[digests_offset].hashes[idx].data_length >= 36 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) break; if (esalt_bufs[digests_offset].hashes[idx].data_type_enum == 1) { @@ -1012,8 +1012,8 @@ KERNEL_FQ void m17220_mxx (KERN_ATTR_VECTOR_ESALT (pkzip_t)) update_key012 (key0, key1, key2, plain, l_crc32tab); } - if (esalt_bufs[digests_offset].hashes[idx].data_length >= 24 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) break; - if (esalt_bufs[digests_offset].hashes[idx].data_length >= 24 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) break; + if (esalt_bufs[digests_offset].hashes[idx].data_length >= 36 && ((tmp[0]) & 6) == 2 && !check_inflate_code1 (tmp, 24)) break; + if (esalt_bufs[digests_offset].hashes[idx].data_length >= 36 && ((tmp[0]) & 6) == 4 && !check_inflate_code2 (tmp)) break; if (esalt_bufs[digests_offset].hashes[idx].data_type_enum == 1) {