Allways pack in the tests.

pull/2607/head
Michael Kruger 3 years ago
parent 3ba02f11ea
commit 30fe29b8a8

@ -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);

@ -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);

Loading…
Cancel
Save