From e08fc096cdc400be2b035e60501b56336e15faf2 Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Mon, 20 May 2019 19:54:16 +0200 Subject: [PATCH] adding support to 17230 kernel to allow compression types 0 and 8 --- OpenCL/m17230_a0-pure.cl | 4 ++-- OpenCL/m17230_a1-pure.cl | 4 ++-- OpenCL/m17230_a3-pure.cl | 4 ++-- src/modules/module_17230.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenCL/m17230_a0-pure.cl b/OpenCL/m17230_a0-pure.cl index df4f6bb26..bec98b9a2 100644 --- a/OpenCL/m17230_a0-pure.cl +++ b/OpenCL/m17230_a0-pure.cl @@ -363,7 +363,7 @@ KERNEL_FQ void m17230_sxx (KERN_ATTR_RULES_ESALT (pkzip_t)) update_key3 (key2, key3); plain = unpack_v8a_from_v32_S (next) ^ key3; - if ((plain & 6) == 0 || (plain & 6) == 6) break; + if (esalt_bufs[digests_offset].hashes[idx].compression_type == 8 && ((plain & 6) == 0 || (plain & 6) == 6)) break; if (idx + 1 == esalt_bufs[digests_offset].hash_count) { @@ -533,7 +533,7 @@ KERNEL_FQ void m17230_mxx (KERN_ATTR_RULES_ESALT (pkzip_t)) update_key3 (key2, key3); plain = unpack_v8a_from_v32_S (next) ^ key3; - if ((plain & 6) == 0 || (plain & 6) == 6) break; + if (esalt_bufs[digests_offset].hashes[idx].compression_type == 8 && ((plain & 6) == 0 || (plain & 6) == 6)) break; if (idx + 1 == esalt_bufs[digests_offset].hash_count) { diff --git a/OpenCL/m17230_a1-pure.cl b/OpenCL/m17230_a1-pure.cl index 0a880847f..37820e532 100644 --- a/OpenCL/m17230_a1-pure.cl +++ b/OpenCL/m17230_a1-pure.cl @@ -363,7 +363,7 @@ KERNEL_FQ void m17230_sxx (KERN_ATTR_ESALT (pkzip_t)) update_key3 (key2, key3); plain = unpack_v8a_from_v32_S (next) ^ key3; - if ((plain & 6) == 0 || (plain & 6) == 6) break; + if (esalt_bufs[digests_offset].hashes[idx].compression_type == 8 && ((plain & 6) == 0 || (plain & 6) == 6)) break; if (idx + 1 == esalt_bufs[digests_offset].hash_count) { @@ -535,7 +535,7 @@ KERNEL_FQ void m17230_mxx (KERN_ATTR_ESALT (pkzip_t)) update_key3 (key2, key3); plain = unpack_v8a_from_v32_S (next) ^ key3; - if ((plain & 6) == 0 || (plain & 6) == 6) break; + if (esalt_bufs[digests_offset].hashes[idx].compression_type == 8 && ((plain & 6) == 0 || (plain & 6) == 6)) break; if (idx + 1 == esalt_bufs[digests_offset].hash_count) { diff --git a/OpenCL/m17230_a3-pure.cl b/OpenCL/m17230_a3-pure.cl index c4ac6c864..2e34dd3e9 100644 --- a/OpenCL/m17230_a3-pure.cl +++ b/OpenCL/m17230_a3-pure.cl @@ -377,7 +377,7 @@ KERNEL_FQ void m17230_sxx (KERN_ATTR_VECTOR_ESALT (pkzip_t)) update_key3 (key2, key3); plain = unpack_v8a_from_v32_S (next) ^ key3; - if ((plain & 6) == 0 || (plain & 6) == 6) break; + if (esalt_bufs[digests_offset].hashes[idx].compression_type == 8 && ((plain & 6) == 0 || (plain & 6) == 6)) break; if (idx + 1 == hash_count) { @@ -563,7 +563,7 @@ KERNEL_FQ void m17230_mxx (KERN_ATTR_VECTOR_ESALT (pkzip_t)) update_key3 (key2, key3); plain = unpack_v8a_from_v32_S (next) ^ key3; - if ((plain & 6) == 0 || (plain & 6) == 6) break; + if (esalt_bufs[digests_offset].hashes[idx].compression_type == 8 && ((plain & 6) == 0 || (plain & 6) == 6)) break; if (idx + 1 == esalt_bufs[digests_offset].hash_count) { diff --git a/src/modules/module_17230.c b/src/modules/module_17230.c index 649996f45..6bef2bf24 100644 --- a/src/modules/module_17230.c +++ b/src/modules/module_17230.c @@ -251,7 +251,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE p = strtok(NULL, "*"); if (p == NULL) return PARSER_HASH_LENGTH; pkzip->hashes[i].compression_type = atoi(p); - if (pkzip->hashes[i].compression_type != 8) return PARSER_PKZIP_CT_UNMATCHED; + if (pkzip->hashes[i].compression_type != 8 && pkzip->hashes[i].compression_type != 0) return PARSER_PKZIP_CT_UNMATCHED; p = strtok(NULL, "*"); if (p == NULL) return PARSER_HASH_LENGTH;