|
|
|
@ -130,11 +130,11 @@ sub module_generate_hash
|
|
|
|
|
|
|
|
|
|
if ($context == 1)
|
|
|
|
|
{
|
|
|
|
|
$user_hash = sha1 (encode ("UTF-16LE", $word_buf));
|
|
|
|
|
$user_hash = sha1 (encode ("UTF-16LE", $word_buf));
|
|
|
|
|
}
|
|
|
|
|
elsif ($context == 2)
|
|
|
|
|
{
|
|
|
|
|
$user_hash = md4 (encode ("UTF-16LE", $word_buf));
|
|
|
|
|
$user_hash = md4 (encode ("UTF-16LE", $word_buf));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$user_derivationKey = hmac_sha1 (encode ("UTF-16LE", $SID . "\x00"), $user_hash);
|
|
|
|
@ -375,15 +375,15 @@ sub module_verify_hash
|
|
|
|
|
|
|
|
|
|
my $signature = $tmp_data[1];
|
|
|
|
|
|
|
|
|
|
next unless ($signature eq 'DPAPImk');
|
|
|
|
|
return unless ($signature eq 'DPAPImk');
|
|
|
|
|
|
|
|
|
|
my @data = split ('\*', $tmp_data[2]);
|
|
|
|
|
|
|
|
|
|
next unless (scalar @data == 9);
|
|
|
|
|
return unless (scalar @data == 9);
|
|
|
|
|
|
|
|
|
|
my $version = shift @data;
|
|
|
|
|
|
|
|
|
|
next unless ($version == 1 || $version == 2);
|
|
|
|
|
return unless ($version == 1 || $version == 2);
|
|
|
|
|
|
|
|
|
|
my $context = shift @data;
|
|
|
|
|
my $SID = shift @data;
|
|
|
|
@ -394,7 +394,8 @@ sub module_verify_hash
|
|
|
|
|
my $cipher_len = shift @data;
|
|
|
|
|
my $cipher = shift @data;
|
|
|
|
|
|
|
|
|
|
next unless (length ($cipher) == $cipher_len);
|
|
|
|
|
return unless ($context == 1 || $context == 2);
|
|
|
|
|
return unless (length ($cipher) == $cipher_len);
|
|
|
|
|
|
|
|
|
|
if ($version == 1)
|
|
|
|
|
{
|
|
|
|
|