| 245 | | |
|---|
| 246 | | die "[*] Cannot run in both --quiet and --verbose modes simultaneously" |
|---|
| 247 | | if $quiet and $verbose; |
|---|
| 248 | | |
|---|
| 249 | | die "[*] Must also specify a GnuPG signing key with --gpg-signing-key or\n", |
|---|
| 250 | | " use --gpg-default-key to use a default key (specified in\n", |
|---|
| 251 | | " ~/.gnupg/options with the default-key variable).\n" |
|---|
| 252 | | if ($gpg_recipient and (not $gpg_default_key and not $gpg_signing_key)); |
|---|
| 253 | | |
|---|
| 254 | | die "[*] Must specify a GnuPG recipient key (on the fwknopd side) with\n", |
|---|
| 255 | | " --gpg-recipient" |
|---|
| 256 | | if (($gpg_default_key or $gpg_signing_key) and not $gpg_recipient); |
|---|
| 257 | | |
|---|
| 258 | | die "[*] Cannot assume a default key when --gpg-no-options is used." |
|---|
| 259 | | if ($gpg_default_key and $gpg_no_options); |
|---|
| 260 | | |
|---|
| 261 | | die "[*] Cannot spoof source address for a real TCP socket." |
|---|
| 262 | | if ($spoof_src and $spa_established_tcp); |
|---|
| 263 | | |
|---|
| 264 | | die "[*] Server auth method not supported in NAT access mode.\n" |
|---|
| 265 | | if $server_auth_method and $NAT_access_str; |
|---|
| | 1892 | } |
|---|
| | 1893 | |
|---|
| | 1894 | sub validate_command_line() { |
|---|
| | 1895 | die "[*] Cannot run in both --quiet and --verbose modes simultaneously" |
|---|
| | 1896 | if $quiet and $verbose; |
|---|
| | 1897 | |
|---|
| | 1898 | die "[*] Must also specify a GnuPG signing key with --gpg-signing-key or\n", |
|---|
| | 1899 | " use --gpg-default-key to use a default key (specified in\n", |
|---|
| | 1900 | " ~/.gnupg/options with the default-key variable).\n" |
|---|
| | 1901 | if ($gpg_recipient and (not $gpg_default_key and not $gpg_signing_key)); |
|---|
| | 1902 | |
|---|
| | 1903 | die "[*] Must specify a GnuPG recipient key (on the fwknopd side) with\n", |
|---|
| | 1904 | " --gpg-recipient" |
|---|
| | 1905 | if (($gpg_default_key or $gpg_signing_key) and not $gpg_recipient); |
|---|
| | 1906 | |
|---|
| | 1907 | die "[*] Cannot assume a default key when --gpg-no-options is used." |
|---|
| | 1908 | if ($gpg_default_key and $gpg_no_options); |
|---|
| | 1909 | |
|---|
| | 1910 | die "[*] Cannot spoof source address for a real TCP socket." |
|---|
| | 1911 | if ($spoof_src and $spa_established_tcp); |
|---|
| | 1912 | |
|---|
| | 1913 | die "[*] Server auth method not supported in NAT access mode.\n" |
|---|
| | 1914 | if $server_auth_method and $NAT_access_str; |
|---|
| | 1915 | |
|---|
| | 1916 | if ($gpg_path) { |
|---|
| | 1917 | die "[*] $gpg_path does not exist." unless -e $gpg_path; |
|---|
| | 1918 | die "[*] $gpg_path not executable." unless -x $gpg_path; |
|---|
| | 1919 | } |
|---|
| | 1920 | return; |
|---|