diff --git a/test/conf/fwknoprc_gpg_signing_pw b/test/conf/fwknoprc_gpg_signing_pw new file mode 100644 index 00000000..e1230fd6 --- /dev/null +++ b/test/conf/fwknoprc_gpg_signing_pw @@ -0,0 +1,2 @@ +[default] +GPG_SIGNING_PW fwknoptest diff --git a/test/conf/fwknoprc_named_gpg_signing_pw b/test/conf/fwknoprc_named_gpg_signing_pw new file mode 100644 index 00000000..eaf75747 --- /dev/null +++ b/test/conf/fwknoprc_named_gpg_signing_pw @@ -0,0 +1,7 @@ +[default] + +[testssh] +GPG_SIGNING_PW fwknoptest + +[testssh2] +GPG_SIGNING_PW_BASE64 Zndrbm9wdGVzdA== diff --git a/test/test-fwknop.pl b/test/test-fwknop.pl index aac2af89..23cd5e25 100755 --- a/test/test-fwknop.pl +++ b/test/test-fwknop.pl @@ -116,6 +116,8 @@ our %cf = ( 'rc_invalid_b64_key' => "$conf_dir/fwknoprc_invalid_base64_key", 'rc_hmac_b64_key' => "$conf_dir/fwknoprc_default_hmac_base64_key", 'rc_hmac_b64_key2' => "$conf_dir/fwknoprc_hmac_key2", + 'rc_gpg_signing_pw' => "$conf_dir/fwknoprc_gpg_signing_pw", + 'rc_gpg_named_signing_pw' => "$conf_dir/fwknoprc_named_gpg_signing_pw", '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", diff --git a/test/tests/basic_operations.pl b/test/tests/basic_operations.pl index e7b9535e..d00d7fcd 100644 --- a/test/tests/basic_operations.pl +++ b/test/tests/basic_operations.pl @@ -757,9 +757,9 @@ 'detail' => 'encryption mode Asymmetric', 'function' => \&generic_exec, 'cmdline' => $default_client_args . " --test --encryption-mode \"Asymmetric\"", - 'positive_output_matches' => [qr/Encryption\sMode\:\s.*Asymmetric/], + 'positive_output_matches' => [qr/Must\sspecify\sGPG\srecipient/], 'fatal' => $NO - }, + }, { 'category' => 'basic operations', 'subcategory' => 'client', diff --git a/test/tests/gpg.pl b/test/tests/gpg.pl index d9763168..84afb776 100644 --- a/test/tests/gpg.pl +++ b/test/tests/gpg.pl @@ -33,6 +33,19 @@ 'key_file' => $cf{'rc_def_key'}, 'fatal' => $NO }, + { + 'category' => 'GPG', + 'subcategory' => 'client+server', + 'detail' => 'rc file default key ..._PW synonym', + 'function' => \&spa_cycle, + 'cmdline' => "$default_client_gpg_args_no_get_key " . + "--rc-file $cf{'rc_gpg_signing_pw'}", + 'fwknopd_cmdline' => $default_server_gpg_args, + 'fw_rule_created' => $NEW_RULE_REQUIRED, + 'fw_rule_removed' => $NEW_RULE_REMOVED, + 'key_file' => $cf{'rc_gpg_signing_pw'}, + 'fatal' => $NO + }, { 'category' => 'GPG', 'subcategory' => 'client+server', @@ -46,6 +59,33 @@ 'key_file' => $cf{'rc_named_key'}, 'fatal' => $NO }, + { + 'category' => 'GPG', + 'subcategory' => 'client+server', + 'detail' => 'rc file named key ..._PW synonym', + 'function' => \&spa_cycle, + 'cmdline' => "$default_client_gpg_args_no_get_key " . + "--rc-file $cf{'rc_gpg_named_signing_pw'} -n testssh", + 'fwknopd_cmdline' => $default_server_gpg_args, + 'fw_rule_created' => $NEW_RULE_REQUIRED, + 'fw_rule_removed' => $NEW_RULE_REMOVED, + 'key_file' => $cf{'rc_gpg_named_signing_pw'}, + 'fatal' => $NO + }, + { + 'category' => 'GPG', + 'subcategory' => 'client+server', + 'detail' => 'rc file b64 named key ..._PW synonym', + 'function' => \&spa_cycle, + 'cmdline' => "$default_client_gpg_args_no_get_key " . + "--rc-file $cf{'rc_gpg_named_signing_pw'} -n testssh2", + 'fwknopd_cmdline' => $default_server_gpg_args, + 'fw_rule_created' => $NEW_RULE_REQUIRED, + 'fw_rule_removed' => $NEW_RULE_REMOVED, + 'key_file' => $cf{'rc_gpg_named_signing_pw'}, + 'fatal' => $NO + }, + { 'category' => 'GPG', 'subcategory' => 'client+server', diff --git a/test/tests/gpg_no_pw.pl b/test/tests/gpg_no_pw.pl index 3b30f666..c25f07c1 100644 --- a/test/tests/gpg_no_pw.pl +++ b/test/tests/gpg_no_pw.pl @@ -108,7 +108,7 @@ 'function' => \&spa_cycle, 'cmdline' => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " . "$fwknopCmd -A tcp/60001 -a $fake_ip -D $loopback_ip " . - "--gpg-no-singing-pw --verbose --verbose " . + "--gpg-no-signing-pw --verbose --verbose " . "--gpg-recipient-key $gpg_server_key " . "--gpg-signer-key $gpg_client_key " . "--gpg-home-dir $gpg_client_home_dir_no_pw",