From a43e239db81045ab50fd91ad05664ce71ad292a5 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Tue, 10 Aug 2021 16:35:15 +0200 Subject: [PATCH] move to 27400, fix unit test --- OpenCL/{m26700-pure.cl => m27400-pure.cl} | 6 +++--- src/modules/{module_26700.c => module_27400.c} | 2 +- tools/test_modules/{m26700.pm => m27400.pm} | 11 +++++------ 3 files changed, 9 insertions(+), 10 deletions(-) rename OpenCL/{m26700-pure.cl => m27400-pure.cl} (97%) rename src/modules/{module_26700.c => module_27400.c} (99%) rename tools/test_modules/{m26700.pm => m27400.pm} (90%) diff --git a/OpenCL/m26700-pure.cl b/OpenCL/m27400-pure.cl similarity index 97% rename from OpenCL/m26700-pure.cl rename to OpenCL/m27400-pure.cl index 9983cb3d2..9373d2b68 100644 --- a/OpenCL/m26700-pure.cl +++ b/OpenCL/m27400-pure.cl @@ -72,7 +72,7 @@ DECLSPEC void hmac_sha1_run_V (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *ipa sha1_transform_vector (w0, w1, w2, w3, digest); } -KERNEL_FQ void m26700_init (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, vmware_vmx_t)) +KERNEL_FQ void m27400_init (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, vmware_vmx_t)) { /** * base @@ -144,7 +144,7 @@ KERNEL_FQ void m26700_init (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, vmware_vmx_ } } -KERNEL_FQ void m26700_loop (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, vmware_vmx_t)) +KERNEL_FQ void m27400_loop (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, vmware_vmx_t)) { const u64 gid = get_global_id (0); @@ -229,7 +229,7 @@ KERNEL_FQ void m26700_loop (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, vmware_vmx_ } } -KERNEL_FQ void m26700_comp (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, vmware_vmx_t)) +KERNEL_FQ void m27400_comp (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, vmware_vmx_t)) { /** * base diff --git a/src/modules/module_26700.c b/src/modules/module_27400.c similarity index 99% rename from src/modules/module_26700.c rename to src/modules/module_27400.c index 86779625f..9eff16f22 100644 --- a/src/modules/module_26700.c +++ b/src/modules/module_27400.c @@ -18,7 +18,7 @@ static const u32 DGST_POS3 = 3; static const u32 DGST_SIZE = DGST_SIZE_4_4; static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE; static const char *HASH_NAME = "VMware VMX (PBKDF2-HMAC-SHA1 + AES-256-CBC)"; -static const u64 KERN_TYPE = 26700; +static const u64 KERN_TYPE = 27400; static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE | OPTI_TYPE_SLOW_HASH_SIMD_LOOP; static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE diff --git a/tools/test_modules/m26700.pm b/tools/test_modules/m27400.pm similarity index 90% rename from tools/test_modules/m26700.pm rename to tools/test_modules/m27400.pm index 50f26576e..ad5941104 100644 --- a/tools/test_modules/m26700.pm +++ b/tools/test_modules/m27400.pm @@ -57,20 +57,19 @@ sub module_generate_hash my $hash = ""; + my $data = 'type=key:cipher='; + + my $encrypted = unpack ("H*", $cipher->encrypt ($data)); + if (defined $ct_str) { my $ct_bin = pack ("H*", $ct_str); my $iv_bin = substr ($ct_bin, 0, 16); - my $encrypted = substr ($ct_bin, 16); - $hash = sprintf ("\$vmx\$0\$%s\$%s\$%s%s", $iterations, unpack ("H*", $salt), unpack ("H*", $iv_bin), unpack ("H*", $encrypted)); + $hash = sprintf ("\$vmx\$0\$%s\$%s\$%s%s", $iterations, unpack ("H*", $salt), unpack ("H*", $iv_bin), substr ($encrypted, 0, 32)); } else { - my $data = 'type=key:cipher='; - - my $encrypted = unpack ("H*", $cipher->encrypt ($data)); - $hash = sprintf ("\$vmx\$0\$%s\$%s\$%s%s", $iterations, unpack ("H*", $salt), unpack ("H*", $iv), substr ($encrypted, 0, 32)); }