From 06e42a3cfa8d54efc3a164449b118bb8883b219f Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Sun, 21 Feb 2016 11:50:41 -0800 Subject: [PATCH] [test suite] first test for include_keys functionality --- Makefile.am | 1 + test/conf/include_keys1_hmac_access.conf | 12 ++++++++++++ test/test-fwknop.pl | 1 + test/tests/rijndael_hmac.pl | 13 +++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 test/conf/include_keys1_hmac_access.conf diff --git a/Makefile.am b/Makefile.am index c3065ff3..3a4afeaa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -160,6 +160,7 @@ EXTRA_DIST = \ test/conf/include2_hmac_access.conf \ test/conf/include3_hmac_access.conf \ test/conf/include_def_hmac_access.conf \ + test/conf/include_keys1_hmac_access.conf \ test/conf/include_m1_hmac_access.conf \ test/conf/include_r1_hmac_access.conf \ test/conf/include_r2_hmac_access.conf \ diff --git a/test/conf/include_keys1_hmac_access.conf b/test/conf/include_keys1_hmac_access.conf new file mode 100644 index 00000000..d027847b --- /dev/null +++ b/test/conf/include_keys1_hmac_access.conf @@ -0,0 +1,12 @@ + +SOURCE ANY +KEY_BASE64 5t82JJQNrt+n81BXWiHHQOEFBIBCxwCoT4yI6JN0OIw= +HMAC_KEY_BASE64 QEAGDvwXknovZmuhbXGVx43bNuE3lAhQdTpM/Awd9ipJWJC92e/4hep3pyYoZjHO+GNvAe4KXaFlz6eLedITqg== +FW_ACCESS_TIMEOUT 3 + +%include_keys conf/hmac_access.conf + +SOURCE 99.9.9.9 +KEY_BASE64 bqWYxkCWO6DrHpitRURWBXSQalI1+5A+2HK3rqc7Q64= +HMAC_KEY_BASE64 y+qZ8LPfYrq9wD2lJ9tkx42fWPmKVDiiQuJgoFskMv0g1+edpDiwK5PFbyvDK4gmLfjJrIIyZhCjciR+2ALYcA== +FW_ACCESS_TIMEOUT 3 diff --git a/test/test-fwknop.pl b/test/test-fwknop.pl index afd8f7b1..ddf5f18c 100755 --- a/test/test-fwknop.pl +++ b/test/test-fwknop.pl @@ -422,6 +422,7 @@ our %cf = ( 'include_r2_hmac_access' => "$conf_dir/include_r2_hmac_access.conf", 'include_m1_hmac_access' => "$conf_dir/include_m1_hmac_access.conf", 'include_def_hmac_access' => "$conf_dir/include_def_hmac_access.conf", + 'include_keys1_hmac_access' => "$conf_dir/include_keys1_hmac_access.conf", 'hmac_cmd_access' => "$conf_dir/hmac_cmd_access.conf", 'hmac_cmd_setuid_access' => "$conf_dir/hmac_cmd_setuid_access.conf", 'hmac_cmd_giduid_access' => "$conf_dir/hmac_cmd_giduid_access.conf", diff --git a/test/tests/rijndael_hmac.pl b/test/tests/rijndael_hmac.pl index beb42d02..34bdd147 100644 --- a/test/tests/rijndael_hmac.pl +++ b/test/tests/rijndael_hmac.pl @@ -179,6 +179,19 @@ 'fw_rule_removed' => $NEW_RULE_REMOVED, 'key_file' => $cf{'rc_hmac_b64_key'}, }, + { + 'category' => 'Rijndael+HMAC', + 'subcategory' => 'client+server', + 'detail' => 'complete cycle, include keys (1)', + 'function' => \&spa_cycle, + 'cmdline' => $default_client_hmac_args, + 'fwknopd_cmdline' => "$fwknopdCmd -c $cf{'def'} -a $cf{'include_keys1_hmac_access'} " . + "-d $default_digest_file -p $default_pid_file $intf_str", + 'server_receive_re' => qr/stanza\s\#\d+.*\sSPA Packet from IP/, + 'fw_rule_created' => $NEW_RULE_REQUIRED, + 'fw_rule_removed' => $NEW_RULE_REMOVED, + 'key_file' => $cf{'rc_hmac_b64_key'}, + }, { 'category' => 'Rijndael+HMAC',