- [client+server] Added --disable-gpg to the autoconf ./configure script
via configure.ac. This makes it easy to not have fwknop/fwknopd
link against libgpgme even if it is installed on the local system.
+ - [test suite] For GnuPG tests that require a passphrase associated with
+ a gpg key, added a pinentry check to see if the local gpg engine
+ requires it. If so, the gpg test that require a key are excluded since.
fwknop-2.0.3 (09/03/2012):
- [server] Fernando Arnaboldi from IOActive found several DoS/code
my $enable_perl_module_checks = 0;
my $enable_perl_module_fuzzing_spa_pkt_generation = 0;
my $sudo_path = '';
+my $killall_path = '';
+my $pinentry_fail = 0;
my $platform = '';
my $help = 0;
my $YES = 1;
'fatal' => $NO
},
+
+ ### GPG testing (with passwords associated with keys) - first check to
+ ### see if pinentry is required and disable remaining GPG tests if so
+ {
+ 'category' => 'GnuPG (GPG) SPA',
+ 'subcategory' => 'client+server',
+ 'detail' => 'pinentry not required',
+ 'err_msg' => 'could not complete SPA cycle',
+ 'function' => \&gpg_pinentry_check,
+ 'cmdline' => $default_client_gpg_args,
+ 'fatal' => $NO
+ },
{
'category' => 'GnuPG (GPG) SPA',
'subcategory' => 'client+server',
copy $logfile, "$output_dir/$logfile" or die $!;
+if ($pinentry_fail) {
+ if ($killall_path) {
+ ### kill all gpg processes in the fwknop client
+ ### process group (this will kill the test suite
+ ### too, but we're already done)
+ system "$killall_path -g fwknop";
+ }
+}
+
exit 0;
#===================== end main =======================
return $rv;
}
+sub gpg_pinentry_check() {
+ my $test_hr = shift;
+
+ my $rv = 1;
+
+ my $pid;
+ if ($pid = fork()) {
+ local $SIG{'ALRM'} = sub {die "[*] External script timeout.\n"};
+ alarm 5; ### running the client should be fast
+ eval {
+ waitpid($pid, 0);
+ };
+ alarm 0;
+ if ($@) {
+ $rv = 0;
+ push @tests_to_exclude, qr/GPG/;
+ $pinentry_fail = 1;
+ }
+ } else {
+ die "[*] Could not run the fwknop client: $!" unless defined $pid;
+ exec qq{$test_hr->{'cmdline'} > /dev/null 2>&1 };
+ }
+
+ return $rv;
+}
+
sub perl_fko_module_compile_install() {
my $test_hr = shift;
push @tests_to_exclude, qr/perl FKO module.*FUZZING/;
}
- $sudo_path = &find_command('sudo');
+ $sudo_path = &find_command('sudo');
+ $killall_path = &find_command('killall');
unless ((&find_command('cc') or &find_command('gcc')) and &find_command('make')) {
### disable compilation checks