[test suite] added tests for setting gpg recipient, signer, and homedir via the clien...
authorMichael Rash <mbr@cipherdyne.org>
Sun, 9 Jun 2013 19:27:19 +0000 (15:27 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Sun, 9 Jun 2013 19:27:19 +0000 (15:27 -0400)
test/conf/fwknoprc_gpg_args_hmac_key [new file with mode: 0644]
test/conf/fwknoprc_gpg_args_no_pw_hmac_key [new file with mode: 0644]
test/test-fwknop.pl
test/tests/gpg_hmac.pl
test/tests/gpg_no_pw_hmac.pl

diff --git a/test/conf/fwknoprc_gpg_args_hmac_key b/test/conf/fwknoprc_gpg_args_hmac_key
new file mode 100644 (file)
index 0000000..eb5ddd0
--- /dev/null
@@ -0,0 +1,7 @@
+[default]
+HMAC_DIGEST_TYPE    sha256
+HMAC_KEY_BASE64     Yh+xizBnl6FotC5ec7FanVGClRMlsOAPh2u6eovnerfBVKwaVKzjGoblFMHMc593TNyi0dWn4opLoTIV9q/ttg==
+GPG_HOMEDIR         conf/client-gpg
+GPG_SIGNER          6A3FAD56
+GPG_RECIPIENT       361BBAD4
+USE_GPG             Y
diff --git a/test/conf/fwknoprc_gpg_args_no_pw_hmac_key b/test/conf/fwknoprc_gpg_args_no_pw_hmac_key
new file mode 100644 (file)
index 0000000..73adfff
--- /dev/null
@@ -0,0 +1,7 @@
+[default]
+HMAC_DIGEST_TYPE    sha256
+HMAC_KEY_BASE64     Yh+xizBnl6FotC5ec7FanVGClRMlsOAPh2u6eovnerfBVKwaVKzjGoblFMHMc593TNyi0dWn4opLoTIV9q/ttg==
+GPG_HOMEDIR         conf/client-gpg-no-pw
+GPG_SIGNER          6A3FAD56
+GPG_RECIPIENT       361BBAD4
+USE_GPG             Y
index 424dcf7..001bf83 100755 (executable)
@@ -116,6 +116,8 @@ our %cf = (
     'rc_hmac_b64_key'              => "$conf_dir/fwknoprc_default_hmac_base64_key",
     'rc_hmac_b64_key2'             => "$conf_dir/fwknoprc_hmac_key2",
     'rc_gpg_hmac_b64_key'          => "$conf_dir/fwknoprc_gpg_hmac_key",
+    'rc_gpg_args_hmac_b64_key'     => "$conf_dir/fwknoprc_gpg_args_hmac_key",
+    'rc_gpg_args_no_pw_hmac_b64_key' => "$conf_dir/fwknoprc_gpg_args_no_pw_hmac_key",
     'rc_hmac_simple_key'           => "$conf_dir/fwknoprc_hmac_simple_keys",
     'rc_hmac_invalid_type'         => "$conf_dir/fwknoprc_hmac_invalid_type",
     'rc_hmac_invalid_type'         => "$conf_dir/fwknoprc_hmac_invalid_type",
index a786e6f..a673b28 100644 (file)
         'fatal'    => $NO
     },
 
-    ### no password GPG testing
     {
         'category' => 'GPG+HMAC',
         'subcategory' => 'client+server',
         'detail'   => 'complete cycle (tcp/22 ssh)',
         'function' => \&spa_cycle,
-        'cmdline'  => "$default_client_gpg_args "
-            . "--rc-file $cf{'rc_gpg_hmac_b64_key'}",
-        'fwknopd_cmdline'  => $default_server_gpg_args_hmac,
+        'cmdline'  => $default_client_gpg_args
+            . " --rc-file $cf{'rc_gpg_hmac_b64_key'}",
+        'fwknopd_cmdline' => $default_server_gpg_args_hmac,
         'fw_rule_created' => $NEW_RULE_REQUIRED,
         'fw_rule_removed' => $NEW_RULE_REMOVED,
         'key_file' => $cf{'rc_gpg_hmac_b64_key'},
     {
         'category' => 'GPG+HMAC',
         'subcategory' => 'client+server',
+        'detail'   => 'gpg args from rc file',
+        'function' => \&spa_cycle,
+        'cmdline'  => $default_client_args
+            . " --rc-file $cf{'rc_gpg_args_hmac_b64_key'}",
+        'fwknopd_cmdline' => $default_server_gpg_args_hmac,
+        'fw_rule_created' => $NEW_RULE_REQUIRED,
+        'fw_rule_removed' => $NEW_RULE_REMOVED,
+        'key_file' => $cf{'rc_gpg_args_hmac_b64_key'},
+        'fatal'    => $NO
+    },
+
+    {
+        'category' => 'GPG+HMAC',
+        'subcategory' => 'client+server',
         'detail'   => 'complete cycle (tcp/23 telnet)',
         'function' => \&spa_cycle,
         'cmdline'  => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
index eb4d521..8587ebb 100644 (file)
     {
         'category' => 'GPG (no pw) HMAC',
         'subcategory' => 'client+server',
+        'detail'   => 'gpg args from rc file',
+        'function' => \&spa_cycle,
+        'cmdline'  => "$default_client_gpg_args_no_homedir "
+            . " --rc-file $cf{'rc_gpg_args_no_pw_hmac_b64_key'}",
+        'fwknopd_cmdline'  => $default_server_gpg_args_no_pw_hmac,
+        'fw_rule_created' => $NEW_RULE_REQUIRED,
+        'fw_rule_removed' => $NEW_RULE_REMOVED,
+        'key_file' => $cf{'rc_gpg_args_no_pw_hmac_b64_key'},
+        'fatal'    => $NO
+    },
+
+    {
+        'category' => 'GPG (no pw) HMAC',
+        'subcategory' => 'client+server',
         'detail'   => 'complete cycle (tcp/23 telnet)',
         'function' => \&spa_cycle,
         'cmdline'  => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .