diff --git a/ChangeLog b/ChangeLog index 64d4c512..3009d83c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ fwknop-2.6.1 (//2014): specific language in this header was created by the Debian legal team at the request of Franck Joncourt. - [test suite] Added Rijndael+HMAC command execution test. + - [test suite] Added Rijndael+HMAC NAT rand port via client rc file test. fwknop-2.6.0 (01/12/2014): - (Radostan Riedel) Added an AppArmor policy for fwknopd that is known to diff --git a/Makefile.am b/Makefile.am index 24ebb3df..17d9b5f7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -195,6 +195,7 @@ EXTRA_DIST = \ test/conf/hmac_no_b64_cygwin_access.conf \ test/conf/multi_pkts.pcap \ test/conf/fwknoprc_default_hmac_base64_key \ + test/conf/fwknoprc_hmac_nat_rand_base64_key \ test/conf/fwknoprc_hmac_key2 \ test/conf/fwknoprc_gpg_hmac_key \ test/conf/fwknoprc_hmac_equal_keys \ diff --git a/test/conf/fwknoprc_hmac_nat_rand_base64_key b/test/conf/fwknoprc_hmac_nat_rand_base64_key new file mode 100644 index 00000000..cdd51ea5 --- /dev/null +++ b/test/conf/fwknoprc_hmac_nat_rand_base64_key @@ -0,0 +1,5 @@ +[default] +HMAC_DIGEST_TYPE sha256 +KEY_BASE64 wzNP62oPPgEc+kXDPQLHPOayQBuNbYUTPP+QrErNDmg= +HMAC_KEY_BASE64 Yh+xizBnl6FotC5ec7FanVGClRMlsOAPh2u6eovnerfBVKwaVKzjGoblFMHMc593TNyi0dWn4opLoTIV9q/ttg== +NAT_RAND_PORT Y diff --git a/test/test-fwknop.pl b/test/test-fwknop.pl index c0c4920d..20fa66fd 100755 --- a/test/test-fwknop.pl +++ b/test/test-fwknop.pl @@ -135,6 +135,7 @@ our %cf = ( 'rc_hmac_equal_keys' => "$conf_dir/fwknoprc_hmac_equal_keys", 'rc_invalid_b64_key' => "$conf_dir/fwknoprc_invalid_base64_key", 'rc_hmac_b64_key' => "$conf_dir/fwknoprc_default_hmac_base64_key", + 'rc_hmac_nat_rand_b64_key' => "$conf_dir/fwknoprc_hmac_nat_rand_base64_key", 'rc_hmac_sha512_b64_key' => "$conf_dir/fwknoprc_hmac_sha512_base64_key", 'rc_hmac_b64_key2' => "$conf_dir/fwknoprc_hmac_key2", 'rc_rand_port_hmac_b64_key' => "$conf_dir/fwknoprc_rand_port_hmac_base64_key", diff --git a/test/tests/rijndael_hmac.pl b/test/tests/rijndael_hmac.pl index df2919c8..5b3bd434 100644 --- a/test/tests/rijndael_hmac.pl +++ b/test/tests/rijndael_hmac.pl @@ -1097,6 +1097,23 @@ 'fw_rule_removed' => $NEW_RULE_REMOVED, 'server_conf' => $cf{'nat'}, }, + { + 'category' => 'Rijndael+HMAC', + 'subcategory' => 'client+server', + 'detail' => "rc NAT rand port to tcp/22", + 'function' => \&spa_cycle, + 'cmdline' => "$fwknopCmd -A tcp/22 -a $fake_ip -D $loopback_ip --rc-file " . + "$cf{'rc_hmac_nat_rand_b64_key'} $verbose_str -N $internal_nat_host", + 'fwknopd_cmdline' => "$fwknopdCmd -c $cf{'nat'} -a $cf{'hmac_access'} " . + "-d $default_digest_file -p $default_pid_file $intf_str", + 'server_positive_output_matches' => [ + qr/FWKNOP_FORWARD.*dport\s22\s.*\sACCEPT/, + qr/FWKNOP_PREROUTING.*\sDNAT\s.*to\-destination\s$internal_nat_host\:22/, + ], + 'fw_rule_created' => $NEW_RULE_REQUIRED, + 'fw_rule_removed' => $NEW_RULE_REMOVED, + 'server_conf' => $cf{'nat'}, + }, { 'category' => 'Rijndael+HMAC', 'subcategory' => 'client+server',