'test-exclude=s' => \$test_exclude,
'exclude=s' => \$test_exclude, ### synonym
'enable-recompile-check' => \$enable_recompilation_warnings_check,
+ 'enable-profile-coverage-check' => \$enable_profile_coverage_check,
+ 'enable-ip-resolve' => \$enable_client_ip_resolve_test,
'List-mode' => \$list_mode,
+ 'test-limit=i' => \$test_limit,
'enable-valgrind' => \$use_valgrind,
'valgrind-path=s' => \$valgrindCmd,
'output-dir=s' => \$output_dir,
my $default_client_args = "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
"$fwknopCmd -A tcp/22 -a $fake_ip -D $loopback_ip --get-key " .
- "$local_key_file --verbose --verbose";
+ "$local_key_file --no-save-args --verbose --verbose";
+
+my $default_client_args_no_get_key = "LD_LIBRARY_PATH=$lib_dir " .
+ "$valgrind_str $fwknopCmd -A tcp/22 -a $fake_ip -D $loopback_ip " .
+ "--no-save-args --verbose --verbose";
+ my $client_ip_resolve_args = "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+ "$fwknopCmd -A tcp/22 -R -D $loopback_ip --get-key " .
+ "$local_key_file --verbose --verbose";
+
my $default_client_gpg_args = "$default_client_args " .
"--gpg-recipient-key $gpg_server_key " .
"--gpg-signer-key $gpg_client_key " .
{
'category' => 'Rijndael SPA',
'subcategory' => 'client+server',
+ 'detail' => 'client IP resolve (tcp/22 ssh)',
+ 'err_msg' => 'could not complete SPA cycle',
+ 'function' => \&spa_cycle,
+ 'cmdline' => $client_ip_resolve_args,
+ 'no_ip_check' => 1,
+ 'fwknopd_cmdline' => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+ "$fwknopdCmd $default_server_conf_args $intf_str",
+ 'fw_rule_created' => $NEW_RULE_REQUIRED,
+ 'fw_rule_removed' => $NEW_RULE_REMOVED,
+ 'fatal' => $NO
+ },
+
+ {
+ 'category' => 'Rijndael SPA',
+ 'subcategory' => 'client+server',
+ 'detail' => 'complete cycle MD5 (tcp/22 ssh)',
+ 'err_msg' => 'could not complete SPA cycle',
+ 'function' => \&spa_cycle,
+ 'cmdline' => "$default_client_args -m md5",
+ 'fwknopd_cmdline' => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+ "$fwknopdCmd $default_server_conf_args $intf_str",
+ 'fw_rule_created' => $NEW_RULE_REQUIRED,
+ 'fw_rule_removed' => $NEW_RULE_REMOVED,
+ 'fatal' => $NO
+ },
++
+ {
+ 'category' => 'Rijndael SPA',
+ 'subcategory' => 'client+server',
+ 'detail' => 'complete cycle SHA1 (tcp/22 ssh)',
+ 'err_msg' => 'could not complete SPA cycle',
+ 'function' => \&spa_cycle,
+ 'cmdline' => "$default_client_args -m sha1",
+ 'fwknopd_cmdline' => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+ "$fwknopdCmd $default_server_conf_args $intf_str",
+ 'fw_rule_created' => $NEW_RULE_REQUIRED,
+ 'fw_rule_removed' => $NEW_RULE_REMOVED,
+ 'fatal' => $NO
+ },
+ {
+ 'category' => 'Rijndael SPA',
+ 'subcategory' => 'client+server',
+ 'detail' => 'complete cycle SHA256 (tcp/22 ssh)',
+ 'err_msg' => 'could not complete SPA cycle',
+ 'function' => \&spa_cycle,
+ 'cmdline' => "$default_client_args -m sha256",
+ 'fwknopd_cmdline' => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+ "$fwknopdCmd $default_server_conf_args $intf_str",
+ 'fw_rule_created' => $NEW_RULE_REQUIRED,
+ 'fw_rule_removed' => $NEW_RULE_REMOVED,
+ 'fatal' => $NO
+ },
+ {
+ 'category' => 'Rijndael SPA',
+ 'subcategory' => 'client+server',
+ 'detail' => 'complete cycle SHA384 (tcp/22 ssh)',
+ 'err_msg' => 'could not complete SPA cycle',
+ 'function' => \&spa_cycle,
+ 'cmdline' => "$default_client_args -m sha384",
+ 'fwknopd_cmdline' => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+ "$fwknopdCmd $default_server_conf_args $intf_str",
+ 'fw_rule_created' => $NEW_RULE_REQUIRED,
+ 'fw_rule_removed' => $NEW_RULE_REMOVED,
+ 'fatal' => $NO
+ },
+ {
+ 'category' => 'Rijndael SPA',
+ 'subcategory' => 'client+server',
+ 'detail' => 'complete cycle SHA512 (tcp/22 ssh)',
+ 'err_msg' => 'could not complete SPA cycle',
+ 'function' => \&spa_cycle,
+ 'cmdline' => "$default_client_args -m sha512",
+ 'fwknopd_cmdline' => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+ "$fwknopdCmd $default_server_conf_args $intf_str",
+ 'fw_rule_created' => $NEW_RULE_REQUIRED,
+ 'fw_rule_removed' => $NEW_RULE_REMOVED,
+ 'fatal' => $NO
+ },
+ {
+ 'category' => 'Rijndael SPA',
+ 'subcategory' => 'client',
+ 'detail' => 'validate digest type arg',
+ 'err_msg' => 'could not complete SPA cycle',
+ 'function' => \&generic_exec,
+ 'cmdline' => "$default_client_args -m invaliddigest",
+ 'positive_output_matches' => [qr/Invalid\sdigest\stype/i],
+ 'fw_rule_created' => $REQUIRE_NO_NEW_RULE,
+ 'fatal' => $NO
+ },
++
+ {
+ 'category' => 'Rijndael SPA',
+ 'subcategory' => 'client+server',
'detail' => 'dual usage access key (tcp/80 http)',
'err_msg' => 'could not complete SPA cycle',
'function' => \&spa_cycle,
'function' => \&replay_detection,
'cmdline' => $default_client_gpg_args,
'fwknopd_cmdline' => $default_server_gpg_args,
+ 'replay_positive_output_matches' => [qr/Replay\sdetected\sfrom\ssource\sIP/],
+ 'fatal' => $NO
+ },
+ {
+ 'category' => 'GnuPG (GPG) SPA',
+ 'subcategory' => 'client+server',
+ 'detail' => 'replay detection (GnuPG prefix)',
+ 'err_msg' => 'could not detect replay attack',
+ 'function' => \&replay_detection,
+ 'pkt_prefix' => 'hQ',
+ 'cmdline' => $default_client_gpg_args,
+ 'fwknopd_cmdline' => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+ "$fwknopdCmd $default_server_conf_args $intf_str",
+ 'replay_positive_output_matches' => [qr/Data\sis\snot\sa\svalid\sSPA\smessage\sformat/],
'fatal' => $NO
},
+ {
+ 'category' => 'GnuPG (GPG) SPA',
+ 'subcategory' => 'client+server',
+ 'detail' => 'replay detection (GnuPG prefix)',
+ 'err_msg' => 'could not detect replay attack',
+ 'function' => \&replay_detection,
+ 'pkt_prefix' => 'hQ',
+ 'cmdline' => $default_client_args,
+ 'fwknopd_cmdline' => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+ "$fwknopdCmd $default_server_conf_args $intf_str",
+ 'fatal' => $NO
+ },
+
{
'category' => 'GnuPG (GPG) SPA',
push @tests_to_exclude, 'recompilation';
}
+ unless ($enable_profile_coverage_check) {
+ push @tests_to_exclude, 'profile coverage';
+ }
+
+ unless ($enable_client_ip_resolve_test) {
+ push @tests_to_exclude, 'IP resolve';
+ }
+
$sudo_path = &find_command('sudo');
unless ((&find_command('cc') or &find_command('gcc')) and &find_command('make')) {
"-d $default_digest_file -p $default_pid_file";
}
- return 1 if &run_cmd("LD_LIBRARY_PATH=$lib_dir $fwknopdCmd " .
- qq{$conf_args --fw-list | grep -v "# DISABLED" |grep $fake_ip |grep _exp_},
- $cmd_out_tmp, $curr_test_file);
+ if ($test_hr->{'no_ip_check'}) {
+ return 1 if &run_cmd("LD_LIBRARY_PATH=$lib_dir $fwknopdCmd " .
+ qq{$conf_args --fw-list | grep -v "# DISABLED" |grep _exp_},
- $cmd_out_tmp, $current_test_file);
++ $cmd_out_tmp, $curr_test_file);
+ } else {
+ return 1 if &run_cmd("LD_LIBRARY_PATH=$lib_dir $fwknopdCmd " .
+ qq{$conf_args --fw-list | grep -v "# DISABLED" |grep $fake_ip |grep _exp_},
- $cmd_out_tmp, $current_test_file);
++ $cmd_out_tmp, $curr_test_file);
+ }
+
return 0;
}