Do not use next if we mean return

pull/1922/head
jsteube 5 years ago
parent 1c7e6d0eaf
commit 89f2ea1bec

@ -64,7 +64,7 @@ sub module_verify_hash
$index2 = index ($hash, '$', $index2 + 1); $index2 = index ($hash, '$', $index2 + 1);
next if $index2 < 1; return if $index2 < 1;
$iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7); $iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7);
@ -74,7 +74,7 @@ sub module_verify_hash
# get salt # get salt
my $index3 = rindex ($hash, '$'); my $index3 = rindex ($hash, '$');
next if $index3 < 1; return if $index3 < 1;
my $salt = substr ($hash, $index2, $index3 - $index2); my $salt = substr ($hash, $index2, $index3 - $index2);

@ -64,7 +64,7 @@ sub module_verify_hash
$index2 = index ($hash, '$', $index2 + 1); $index2 = index ($hash, '$', $index2 + 1);
next if $index2 < 1; return if $index2 < 1;
$iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7); $iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7);
@ -74,7 +74,7 @@ sub module_verify_hash
# get salt # get salt
my $index3 = rindex ($hash, '$'); my $index3 = rindex ($hash, '$');
next if $index3 < 1; return if $index3 < 1;
my $salt = substr ($hash, $index2, $index3 - $index2); my $salt = substr ($hash, $index2, $index3 - $index2);

@ -63,7 +63,7 @@ sub module_verify_hash
$index2 = index ($hash, '$', $index2 + 1); $index2 = index ($hash, '$', $index2 + 1);
next if $index2 < 1; return if $index2 < 1;
$iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7); $iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7);
@ -73,7 +73,7 @@ sub module_verify_hash
# get salt # get salt
my $index3 = rindex ($hash, '$'); my $index3 = rindex ($hash, '$');
next if $index3 < 1; return if $index3 < 1;
my $salt = substr ($hash, $index2, $index3 - $index2); my $salt = substr ($hash, $index2, $index3 - $index2);

@ -145,21 +145,21 @@ sub module_verify_hash
my $index1 = index ($line, "::"); my $index1 = index ($line, "::");
next if $index1 < 1; return if $index1 < 1;
my $index2 = index ($line, ":", $index1 + 2); my $index2 = index ($line, ":", $index1 + 2);
next if $index2 < 1; return if $index2 < 1;
$index2 = index ($line, ":", $index2 + 1); $index2 = index ($line, ":", $index2 + 1);
next if $index2 < 1; return if $index2 < 1;
my $salt = substr ($line, 0, $index2 - 32); my $salt = substr ($line, 0, $index2 - 32);
$index2 = index ($line, ":", $index2 + 1); $index2 = index ($line, ":", $index2 + 1);
next if $index2 < 1; return if $index2 < 1;
$salt .= substr ($line, $index2 + 1, 16); $salt .= substr ($line, $index2 + 1, 16);

@ -33,7 +33,7 @@ sub module_verify_hash
my $line = shift; my $line = shift;
# scrypt # scrypt
next unless (substr ($line, 0, 7) eq 'SCRYPT:'); return unless (substr ($line, 0, 7) eq 'SCRYPT:');
# get hash # get hash
my $index1 = index ($line, ":", 7); my $index1 = index ($line, ":", 7);

@ -57,7 +57,7 @@ sub module_verify_hash
my $line = shift; my $line = shift;
# Cisco $8$ - PBKDF2-HMAC-SHA256 # Cisco $8$ - PBKDF2-HMAC-SHA256
next unless (substr ($line, 0, 3) eq '$8$'); return unless (substr ($line, 0, 3) eq '$8$');
# get hash # get hash
my $index1 = index ($line, "\$", 3); my $index1 = index ($line, "\$", 3);

@ -53,7 +53,7 @@ sub module_verify_hash
my $line = shift; my $line = shift;
# Cisco $9$ - scrypt # Cisco $9$ - scrypt
next unless (substr ($line, 0, 3) eq '$9$'); return unless (substr ($line, 0, 3) eq '$9$');
# get hash # get hash
my $index1 = index ($line, "\$", 3); my $index1 = index ($line, "\$", 3);

@ -92,24 +92,24 @@ sub module_verify_hash
# Office 2013 # Office 2013
my ($hash_in, $word) = split ":", $line; my ($hash_in, $word) = split ":", $line;
next unless defined $hash_in; return unless defined $hash_in;
next unless defined $word; return unless defined $word;
my @data = split /\*/, $hash_in; my @data = split /\*/, $hash_in;
next unless scalar @data == 8; return unless scalar @data == 8;
next unless (shift @data eq '$office$'); return unless (shift @data eq '$office$');
next unless (shift @data eq '2013'); return unless (shift @data eq '2013');
my $iter = shift @data; my $iter = shift @data;
next unless (shift @data eq '256'); return unless (shift @data eq '256');
next unless (shift @data eq '16'); return unless (shift @data eq '16');
next unless (length $data[0] == 32); return unless (length $data[0] == 32);
next unless (length $data[1] == 32); return unless (length $data[1] == 32);
next unless (length $data[2] == 64); return unless (length $data[2] == 64);
my $salt = shift @data; my $salt = shift @data;
my $param = shift @data; my $param = shift @data;

@ -76,20 +76,20 @@ sub module_verify_hash
# Office Old $3 $4 # Office Old $3 $4
my ($hash_in, $word) = split ":", $line; my ($hash_in, $word) = split ":", $line;
next unless defined $hash_in; return unless defined $hash_in;
next unless defined $word; return unless defined $word;
my @data = split /\*/, $hash_in; my @data = split /\*/, $hash_in;
next unless scalar @data == 4; return unless scalar @data == 4;
my $signature = shift @data; my $signature = shift @data;
next unless (($signature eq '$oldoffice$3') || ($signature eq '$oldoffice$4')); return unless (($signature eq '$oldoffice$3') || ($signature eq '$oldoffice$4'));
next unless (length $data[0] == 32); return unless (length $data[0] == 32);
next unless (length $data[1] == 32); return unless (length $data[1] == 32);
next unless (length $data[2] == 40); return unless (length $data[2] == 40);
my $salt = shift @data; my $salt = shift @data;
my $param = shift @data; my $param = shift @data;

@ -37,7 +37,7 @@ sub module_verify_hash
my $line = shift; my $line = shift;
# Django (PBKDF2-SHA256) # Django (PBKDF2-SHA256)
next unless (substr ($line, 0, 14) eq 'pbkdf2_sha256$'); return unless (substr ($line, 0, 14) eq 'pbkdf2_sha256$');
# get hash # get hash
my $index1 = index ($line, "\$", 14); my $index1 = index ($line, "\$", 14);

@ -38,12 +38,12 @@ sub module_verify_hash
my ($hash, undef, undef, $salt, $word) = split ":", $line; my ($hash, undef, undef, $salt, $word) = split ":", $line;
next unless (length $hash == 16); return unless (length $hash == 16);
next unless (length $salt == 32); return unless (length $salt == 32);
next unless defined $hash; return unless defined $hash;
next unless defined $salt; return unless defined $salt;
next unless defined $word; return unless defined $word;
$word = pack_if_HEX_notation ($word); $word = pack_if_HEX_notation ($word);

@ -36,7 +36,7 @@ sub module_verify_hash
my $line = shift; my $line = shift;
# Cram MD5 # Cram MD5
next unless (substr ($line, 0, 10) eq '$cram_md5$'); return unless (substr ($line, 0, 10) eq '$cram_md5$');
# get hash # get hash
my $index1 = index ($line, "\$", 10); my $index1 = index ($line, "\$", 10);

@ -154,12 +154,12 @@ sub module_verify_hash
my ($hash_in, $word) = split ":", $line; my ($hash_in, $word) = split ":", $line;
next unless defined $hash_in; return unless defined $hash_in;
next unless defined $word; return unless defined $word;
my @data = split /\*/, $hash_in; my @data = split /\*/, $hash_in;
next unless scalar @data == 11; return unless scalar @data == 11;
my $V = shift @data; $V = substr ($V, 5, 1); my $V = shift @data; $V = substr ($V, 5, 1);
my $R = shift @data; my $R = shift @data;

@ -41,12 +41,12 @@ sub module_verify_hash
{ {
my $line = shift; my $line = shift;
next unless (substr ($line, 0, 5) eq 'sha1:'); return unless (substr ($line, 0, 5) eq 'sha1:');
# iterations # iterations
my $index1 = index ($line, ":", 5); my $index1 = index ($line, ":", 5);
next if $index1 < 1; return if $index1 < 1;
my $iter = substr ($line, 5, $index1 - 5); my $iter = substr ($line, 5, $index1 - 5);

@ -370,15 +370,15 @@ sub module_verify_hash
my $signature = $tmp_data[1]; my $signature = $tmp_data[1];
next unless ($signature eq 'DPAPImk'); return unless ($signature eq 'DPAPImk');
my @data = split ('\*', $tmp_data[2]); my @data = split ('\*', $tmp_data[2]);
next unless (scalar @data == 9); return unless (scalar @data == 9);
my $version = shift @data; my $version = shift @data;
next unless ($version == 1 || $version == 2); return unless ($version == 1 || $version == 2);
my $context = shift @data; my $context = shift @data;
my $SID = shift @data; my $SID = shift @data;
@ -389,15 +389,15 @@ sub module_verify_hash
my $cipher_len = shift @data; my $cipher_len = shift @data;
my $cipher = shift @data; my $cipher = shift @data;
next unless (length ($cipher) == $cipher_len); return unless (length ($cipher) == $cipher_len);
if ($version == 1) if ($version == 1)
{ {
next unless ($cipher_len == 208); return unless ($cipher_len == 208);
} }
elsif ($version == 2) elsif ($version == 2)
{ {
next unless ($cipher_len == 288); return unless ($cipher_len == 288);
} }
my $dpapimk_salt = substr ($hash, length ('$DPAPImk$')); my $dpapimk_salt = substr ($hash, length ('$DPAPImk$'));

@ -71,7 +71,7 @@ sub module_verify_hash
my @data = split (/\*/, $hash); my @data = split (/\*/, $hash);
next unless scalar @data == 4; return unless scalar @data == 4;
my (undef, $macap, $macsta, $essid) = @data; my (undef, $macap, $macsta, $essid) = @data;

@ -53,8 +53,8 @@ sub module_verify_hash
my ($digest, $word) = split (':', $line); my ($digest, $word) = split (':', $line);
next unless defined $digest; return unless defined $digest;
next unless defined $word; return unless defined $word;
my @data = split ('\*', $digest); my @data = split ('\*', $digest);

@ -59,7 +59,7 @@ sub module_verify_hash
# tokenize # tokenize
my @data = split ('\*', $hash); my @data = split ('\*', $hash);
next unless scalar @data == 12; return unless scalar @data == 12;
my $signature = shift @data; my $signature = shift @data;
my $cipher_type = shift @data; my $cipher_type = shift @data;

@ -73,7 +73,7 @@ sub module_verify_hash
# tokenize # tokenize
my @data = split ('\*', $hash); my @data = split ('\*', $hash);
next unless scalar @data == 12; return unless scalar @data == 12;
my $signature = shift @data; my $signature = shift @data;
my $cipher_type = shift @data; my $cipher_type = shift @data;

Loading…
Cancel
Save