From 30fe29b8a80a465a5649711985f9762d6dc5f4b6 Mon Sep 17 00:00:00 2001 From: Michael Kruger Date: Mon, 2 Aug 2021 12:06:38 +0200 Subject: [PATCH] Allways pack in the tests. --- tools/test_modules/m27000.pm | 5 ++--- tools/test_modules/m27100.pm | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/test_modules/m27000.pm b/tools/test_modules/m27000.pm index e77e471ea..bf279bfb9 100644 --- a/tools/test_modules/m27000.pm +++ b/tools/test_modules/m27000.pm @@ -128,8 +128,7 @@ sub module_generate_hash my $ntresp; - my $nthash = pack_if_HEX_notation ($word); - # my $nthash = pack ("H*", $word); + my $nthash = pack ("H*", $word); my $nthashpadded = $nthash . "\x00" x 5; $ntresp .= Crypt::ECB::encrypt (setup_des_key (substr ($nthashpadded, 0, 7)), "DES", $challenge, "none"); @@ -167,7 +166,7 @@ sub module_verify_hash my $word = substr ($line, $index2 + 1 + 16 + 1); - my $word_packed = pack_if_HEX_notation ($word); + my $word_packed = pack ("H*", $word); my $new_hash = module_generate_hash ($word_packed, undef, $salt); diff --git a/tools/test_modules/m27100.pm b/tools/test_modules/m27100.pm index 851cadc49..fef575c3b 100644 --- a/tools/test_modules/m27100.pm +++ b/tools/test_modules/m27100.pm @@ -29,8 +29,7 @@ sub module_generate_hash my $b_srv_ch = pack ('H*', $srv_ch); my $b_cli_ch = pack ('H*', $cli_ch); - my $nthash = pack_if_HEX_notation ($word); - # my $nthash = pack ("H*", $word); + my $nthash = pack ("H*", $word); my $identity = encode ('UTF-16LE', uc ($user) . $domain); my $digest = hmac_hex ($b_srv_ch . $b_cli_ch, hmac ($identity, $nthash, \&md5, 64), \&md5, 64); @@ -67,7 +66,7 @@ sub module_verify_hash $cli_ch = substr ($line, $index2 + 3 + 16 + 32, $index3 - $index2 - 3 - 16 - 32); $word = substr ($line, $index3 + 1); - my $word_packed = pack_if_HEX_notation ($word); + my $word_packed = pack ("H*", $word); my $new_hash = module_generate_hash ($word_packed, $user, $domain, $srv_ch, $cli_ch);