From df5f2d3ac07d0ed42b7c8989fc7bf653b513b911 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Fri, 3 May 2013 20:55:20 -0400 Subject: [PATCH] [test suite] minor update to not count HMAC OpenSSL tests against non-ascii HMAC keys when the hexkey option is not supported --- test/test-fwknop.pl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/test-fwknop.pl b/test/test-fwknop.pl index a584ca77..afab0db6 100755 --- a/test/test-fwknop.pl +++ b/test/test-fwknop.pl @@ -4372,8 +4372,6 @@ sub openssl_hmac_verification() { my ($encrypted_msg, $encoded_msg, $access_msg, $tmp_key, $b64_decode_key, $hmac_digest, $hmac_mode, $enc_mode) = @_; - $openssl_hmac_ctr++; - my $hmac_key = ''; my $enc_msg_without_hmac = ''; my $openssl_hmac = ''; @@ -4393,14 +4391,15 @@ sub openssl_hmac_verification() { "enc_mode: $enc_mode_str\n", $curr_test_file); - if ($hmac_key =~ /\s/ and not $openssl_hmac_hexkey_supported) { + if ($hmac_key =~ /\W/ and not $openssl_hmac_hexkey_supported) { &write_test_file("[-] openssl hex key not supported and key " . - "contains syntax busting spaces, skipping hmac test.\n", + "contains syntax busting chars, skipping hmac test.\n", $curr_test_file); - $openssl_hmac_failure_ctr++; return 1; } + $openssl_hmac_ctr++; + my $hmac_digest_search = quotemeta $hmac_digest; ### see if OpenSSL produces the same HMAC digest value from the encrypted @@ -4736,7 +4735,7 @@ sub anonymize_results() { unlink $tarfile or die "[*] Could not unlink $tarfile: $!"; } - print "[+] Anonymizing all IP addresses and hostnames ", + print "\n[+] Anonymizing all IP addresses and hostnames ", "from $output_dir files...\n"; ### remove non-loopback IP addresses @@ -4763,7 +4762,10 @@ sub anonymize_results() { ### create tarball print " Creating tar file: $tarfile\n"; system "tar cvfz $tarfile $logfile $output_dir"; - print "[+] Anonymized test results file: $tarfile\n"; + + print "\n[+] Anonymized test results file: '$tarfile', you can send\n", + " this to mbr\@cipherdyne.org for diagnosis.\n\n"; + if (-e $tarfile) { $rv = 1; }