From 89f2ea1bece762ca6d0c0a2410c4d127c5f57e2a Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 19 Feb 2019 12:50:57 +0100 Subject: [PATCH] Do not use next if we mean return --- tools/test_modules/m00500.pm | 4 ++-- tools/test_modules/m01600.pm | 4 ++-- tools/test_modules/m01800.pm | 4 ++-- tools/test_modules/m05500.pm | 8 ++++---- tools/test_modules/m08900.pm | 2 +- tools/test_modules/m09200.pm | 2 +- tools/test_modules/m09300.pm | 2 +- tools/test_modules/m09600.pm | 20 ++++++++++---------- tools/test_modules/m09800.pm | 14 +++++++------- tools/test_modules/m10000.pm | 2 +- tools/test_modules/m10100.pm | 10 +++++----- tools/test_modules/m10200.pm | 2 +- tools/test_modules/m10500.pm | 6 +++--- tools/test_modules/m12000.pm | 4 ++-- tools/test_modules/m15900.pm | 12 ++++++------ tools/test_modules/m16800.pm | 2 +- tools/test_modules/m16900.pm | 4 ++-- tools/test_modules/m18400.pm | 2 +- tools/test_modules/m18600.pm | 2 +- 19 files changed, 53 insertions(+), 53 deletions(-) diff --git a/tools/test_modules/m00500.pm b/tools/test_modules/m00500.pm index 86ad05ff2..0fbf5eb55 100644 --- a/tools/test_modules/m00500.pm +++ b/tools/test_modules/m00500.pm @@ -64,7 +64,7 @@ sub module_verify_hash $index2 = index ($hash, '$', $index2 + 1); - next if $index2 < 1; + return if $index2 < 1; $iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7); @@ -74,7 +74,7 @@ sub module_verify_hash # get salt my $index3 = rindex ($hash, '$'); - next if $index3 < 1; + return if $index3 < 1; my $salt = substr ($hash, $index2, $index3 - $index2); diff --git a/tools/test_modules/m01600.pm b/tools/test_modules/m01600.pm index deb50cfa2..72ff6929f 100644 --- a/tools/test_modules/m01600.pm +++ b/tools/test_modules/m01600.pm @@ -64,7 +64,7 @@ sub module_verify_hash $index2 = index ($hash, '$', $index2 + 1); - next if $index2 < 1; + return if $index2 < 1; $iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7); @@ -74,7 +74,7 @@ sub module_verify_hash # get salt my $index3 = rindex ($hash, '$'); - next if $index3 < 1; + return if $index3 < 1; my $salt = substr ($hash, $index2, $index3 - $index2); diff --git a/tools/test_modules/m01800.pm b/tools/test_modules/m01800.pm index 3f3756616..6df3d915d 100644 --- a/tools/test_modules/m01800.pm +++ b/tools/test_modules/m01800.pm @@ -63,7 +63,7 @@ sub module_verify_hash $index2 = index ($hash, '$', $index2 + 1); - next if $index2 < 1; + return if $index2 < 1; $iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7); @@ -73,7 +73,7 @@ sub module_verify_hash # get salt my $index3 = rindex ($hash, '$'); - next if $index3 < 1; + return if $index3 < 1; my $salt = substr ($hash, $index2, $index3 - $index2); diff --git a/tools/test_modules/m05500.pm b/tools/test_modules/m05500.pm index 178f9478f..c0dd67bdf 100644 --- a/tools/test_modules/m05500.pm +++ b/tools/test_modules/m05500.pm @@ -145,21 +145,21 @@ sub module_verify_hash my $index1 = index ($line, "::"); - next if $index1 < 1; + return if $index1 < 1; my $index2 = index ($line, ":", $index1 + 2); - next if $index2 < 1; + return if $index2 < 1; $index2 = index ($line, ":", $index2 + 1); - next if $index2 < 1; + return if $index2 < 1; my $salt = substr ($line, 0, $index2 - 32); $index2 = index ($line, ":", $index2 + 1); - next if $index2 < 1; + return if $index2 < 1; $salt .= substr ($line, $index2 + 1, 16); diff --git a/tools/test_modules/m08900.pm b/tools/test_modules/m08900.pm index 4357a5dc7..a536755fa 100644 --- a/tools/test_modules/m08900.pm +++ b/tools/test_modules/m08900.pm @@ -33,7 +33,7 @@ sub module_verify_hash my $line = shift; # scrypt - next unless (substr ($line, 0, 7) eq 'SCRYPT:'); + return unless (substr ($line, 0, 7) eq 'SCRYPT:'); # get hash my $index1 = index ($line, ":", 7); diff --git a/tools/test_modules/m09200.pm b/tools/test_modules/m09200.pm index 82faee15b..5e43b43c6 100644 --- a/tools/test_modules/m09200.pm +++ b/tools/test_modules/m09200.pm @@ -57,7 +57,7 @@ sub module_verify_hash my $line = shift; # Cisco $8$ - PBKDF2-HMAC-SHA256 - next unless (substr ($line, 0, 3) eq '$8$'); + return unless (substr ($line, 0, 3) eq '$8$'); # get hash my $index1 = index ($line, "\$", 3); diff --git a/tools/test_modules/m09300.pm b/tools/test_modules/m09300.pm index c67424d34..ec0bcfe25 100644 --- a/tools/test_modules/m09300.pm +++ b/tools/test_modules/m09300.pm @@ -53,7 +53,7 @@ sub module_verify_hash my $line = shift; # Cisco $9$ - scrypt - next unless (substr ($line, 0, 3) eq '$9$'); + return unless (substr ($line, 0, 3) eq '$9$'); # get hash my $index1 = index ($line, "\$", 3); diff --git a/tools/test_modules/m09600.pm b/tools/test_modules/m09600.pm index 175e430b7..fe21369bf 100644 --- a/tools/test_modules/m09600.pm +++ b/tools/test_modules/m09600.pm @@ -92,24 +92,24 @@ sub module_verify_hash # Office 2013 my ($hash_in, $word) = split ":", $line; - next unless defined $hash_in; - next unless defined $word; + return unless defined $hash_in; + return unless defined $word; my @data = split /\*/, $hash_in; - next unless scalar @data == 8; + return unless scalar @data == 8; - next unless (shift @data eq '$office$'); - next unless (shift @data eq '2013'); + return unless (shift @data eq '$office$'); + return unless (shift @data eq '2013'); my $iter = shift @data; - next unless (shift @data eq '256'); - next unless (shift @data eq '16'); + return unless (shift @data eq '256'); + return unless (shift @data eq '16'); - next unless (length $data[0] == 32); - next unless (length $data[1] == 32); - next unless (length $data[2] == 64); + return unless (length $data[0] == 32); + return unless (length $data[1] == 32); + return unless (length $data[2] == 64); my $salt = shift @data; my $param = shift @data; diff --git a/tools/test_modules/m09800.pm b/tools/test_modules/m09800.pm index a8fb69f49..5e4c7a39d 100644 --- a/tools/test_modules/m09800.pm +++ b/tools/test_modules/m09800.pm @@ -76,20 +76,20 @@ sub module_verify_hash # Office Old $3 $4 my ($hash_in, $word) = split ":", $line; - next unless defined $hash_in; - next unless defined $word; + return unless defined $hash_in; + return unless defined $word; my @data = split /\*/, $hash_in; - next unless scalar @data == 4; + return unless scalar @data == 4; 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); - next unless (length $data[1] == 32); - next unless (length $data[2] == 40); + return unless (length $data[0] == 32); + return unless (length $data[1] == 32); + return unless (length $data[2] == 40); my $salt = shift @data; my $param = shift @data; diff --git a/tools/test_modules/m10000.pm b/tools/test_modules/m10000.pm index 6f78a221f..04cecaee5 100644 --- a/tools/test_modules/m10000.pm +++ b/tools/test_modules/m10000.pm @@ -37,7 +37,7 @@ sub module_verify_hash my $line = shift; # Django (PBKDF2-SHA256) - next unless (substr ($line, 0, 14) eq 'pbkdf2_sha256$'); + return unless (substr ($line, 0, 14) eq 'pbkdf2_sha256$'); # get hash my $index1 = index ($line, "\$", 14); diff --git a/tools/test_modules/m10100.pm b/tools/test_modules/m10100.pm index 10cce0906..8c29310ad 100644 --- a/tools/test_modules/m10100.pm +++ b/tools/test_modules/m10100.pm @@ -38,12 +38,12 @@ sub module_verify_hash my ($hash, undef, undef, $salt, $word) = split ":", $line; - next unless (length $hash == 16); - next unless (length $salt == 32); + return unless (length $hash == 16); + return unless (length $salt == 32); - next unless defined $hash; - next unless defined $salt; - next unless defined $word; + return unless defined $hash; + return unless defined $salt; + return unless defined $word; $word = pack_if_HEX_notation ($word); diff --git a/tools/test_modules/m10200.pm b/tools/test_modules/m10200.pm index de0cd3a32..fe587498a 100644 --- a/tools/test_modules/m10200.pm +++ b/tools/test_modules/m10200.pm @@ -36,7 +36,7 @@ sub module_verify_hash my $line = shift; # Cram MD5 - next unless (substr ($line, 0, 10) eq '$cram_md5$'); + return unless (substr ($line, 0, 10) eq '$cram_md5$'); # get hash my $index1 = index ($line, "\$", 10); diff --git a/tools/test_modules/m10500.pm b/tools/test_modules/m10500.pm index 52e3ae381..1daa032ca 100644 --- a/tools/test_modules/m10500.pm +++ b/tools/test_modules/m10500.pm @@ -154,12 +154,12 @@ sub module_verify_hash my ($hash_in, $word) = split ":", $line; - next unless defined $hash_in; - next unless defined $word; + return unless defined $hash_in; + return unless defined $word; 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 $R = shift @data; diff --git a/tools/test_modules/m12000.pm b/tools/test_modules/m12000.pm index 85047a557..92589f71f 100644 --- a/tools/test_modules/m12000.pm +++ b/tools/test_modules/m12000.pm @@ -41,12 +41,12 @@ sub module_verify_hash { my $line = shift; - next unless (substr ($line, 0, 5) eq 'sha1:'); + return unless (substr ($line, 0, 5) eq 'sha1:'); # iterations my $index1 = index ($line, ":", 5); - next if $index1 < 1; + return if $index1 < 1; my $iter = substr ($line, 5, $index1 - 5); diff --git a/tools/test_modules/m15900.pm b/tools/test_modules/m15900.pm index ed66a2de4..1a6d98336 100644 --- a/tools/test_modules/m15900.pm +++ b/tools/test_modules/m15900.pm @@ -370,15 +370,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; @@ -389,15 +389,15 @@ sub module_verify_hash my $cipher_len = shift @data; my $cipher = shift @data; - next unless (length ($cipher) == $cipher_len); + return unless (length ($cipher) == $cipher_len); if ($version == 1) { - next unless ($cipher_len == 208); + return unless ($cipher_len == 208); } elsif ($version == 2) { - next unless ($cipher_len == 288); + return unless ($cipher_len == 288); } my $dpapimk_salt = substr ($hash, length ('$DPAPImk$')); diff --git a/tools/test_modules/m16800.pm b/tools/test_modules/m16800.pm index cfcd93974..1602f8544 100644 --- a/tools/test_modules/m16800.pm +++ b/tools/test_modules/m16800.pm @@ -71,7 +71,7 @@ sub module_verify_hash my @data = split (/\*/, $hash); - next unless scalar @data == 4; + return unless scalar @data == 4; my (undef, $macap, $macsta, $essid) = @data; diff --git a/tools/test_modules/m16900.pm b/tools/test_modules/m16900.pm index b5c49d147..61bf1485e 100644 --- a/tools/test_modules/m16900.pm +++ b/tools/test_modules/m16900.pm @@ -53,8 +53,8 @@ sub module_verify_hash my ($digest, $word) = split (':', $line); - next unless defined $digest; - next unless defined $word; + return unless defined $digest; + return unless defined $word; my @data = split ('\*', $digest); diff --git a/tools/test_modules/m18400.pm b/tools/test_modules/m18400.pm index 6eadf24bb..54a8f5f54 100644 --- a/tools/test_modules/m18400.pm +++ b/tools/test_modules/m18400.pm @@ -59,7 +59,7 @@ sub module_verify_hash # tokenize my @data = split ('\*', $hash); - next unless scalar @data == 12; + return unless scalar @data == 12; my $signature = shift @data; my $cipher_type = shift @data; diff --git a/tools/test_modules/m18600.pm b/tools/test_modules/m18600.pm index be9b30e34..bf995bbb1 100644 --- a/tools/test_modules/m18600.pm +++ b/tools/test_modules/m18600.pm @@ -73,7 +73,7 @@ sub module_verify_hash # tokenize my @data = split ('\*', $hash); - next unless scalar @data == 12; + return unless scalar @data == 12; my $signature = shift @data; my $cipher_type = shift @data;