mirror of
https://github.com/hashcat/hashcat.git
synced 2025-08-02 03:48:16 +00:00
Fixed a1 kernel error, Added perl test-unit. All unit tests passed.
This commit is contained in:
parent
47beaf4a6e
commit
64278babc0
@ -97,9 +97,12 @@ KERNEL_FQ void m22800_mxx (KERN_ATTR_BASIC ())
|
||||
|
||||
// Update with salt
|
||||
md5_update (&ctx, s, salt_len);
|
||||
// Update with the password combination
|
||||
md5_update (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
// Update with the password combination using global functions
|
||||
md5_update_global (&ctx, pws[gid].i, pws[gid].pw_len);
|
||||
md5_update_global (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
// Update with the hexadecimal MD5 result
|
||||
u32 w0[4];
|
||||
u32 w1[4];
|
||||
u32 w2[4];
|
||||
@ -226,9 +229,12 @@ KERNEL_FQ void m22800_sxx (KERN_ATTR_BASIC ())
|
||||
|
||||
// Update with salt
|
||||
md5_update (&ctx, s, salt_len);
|
||||
// Update with the password combination
|
||||
md5_update (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
// Update with the password combination
|
||||
md5_update_global (&ctx, pws[gid].i, pws[gid].pw_len);
|
||||
md5_update_global (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
// Update with the hexadecimal MD5 result
|
||||
u32 w0[4];
|
||||
u32 w1[4];
|
||||
u32 w2[4];
|
||||
|
44
tools/test_modules/m22800.pm
Normal file
44
tools/test_modules/m22800.pm
Normal file
@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
##
|
||||
## Author......: See docs/credits.txt
|
||||
## License.....: MIT
|
||||
##
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Digest::MD5 qw (md5_hex);
|
||||
|
||||
sub module_constraints { [[0, 256], [0, 223], [0, 55], [0, 23], [-1, -1]] }
|
||||
|
||||
sub module_generate_hash
|
||||
{
|
||||
my $word = shift;
|
||||
my $salt = shift;
|
||||
|
||||
my $digest = md5_hex ($salt . $word . md5_hex ($word));
|
||||
|
||||
my $hash = sprintf ("%s:%s", $digest, $salt);
|
||||
|
||||
return $hash;
|
||||
}
|
||||
|
||||
sub module_verify_hash
|
||||
{
|
||||
my $line = shift;
|
||||
|
||||
my ($hash, $salt, $word) = split (':', $line);
|
||||
|
||||
return unless defined $hash;
|
||||
return unless defined $salt;
|
||||
return unless defined $word;
|
||||
|
||||
my $word_packed = pack_if_HEX_notation ($word);
|
||||
|
||||
my $new_hash = module_generate_hash ($word_packed, $salt);
|
||||
|
||||
return ($new_hash, $word);
|
||||
}
|
||||
|
||||
1;
|
Loading…
Reference in New Issue
Block a user