OpenSSL CVS Repository
http://cvs.openssl.org/
____________________________________________________________
________________
Server: cvs.openssl.org Name: Dr.
Stephen Henson
Root: /v/openssl/cvs Email: steve openssl.org
Module: openssl Date:
23-Dec-2007 15:20:50
Branch: OpenSSL-fips-0_9_8-stable Handle:
2007122314205000
Modified files: (Branch:
OpenSSL-fips-0_9_8-stable)
openssl/fips fipsalgtest.pl
Log:
Add more tree sanity checks. Make sure verifies must
produce at least one
successful output. Fix typos.
Summary:
Revision Changes Path
1.1.2.3 +44 -11 openssl/fips/fipsalgtest.pl
____________________________________________________________
________________
patch -p0 <<' .'
Index: openssl/fips/fipsalgtest.pl
============================================================
================
$ cvs diff -u -r1.1.2.2 -r1.1.2.3 fipsalgtest.pl
--- openssl/fips/fipsalgtest.pl 23 Dec 2007 00:53:55
-0000 1.1.2.2
+++ openssl/fips/fipsalgtest.pl 23 Dec 2007 14:20:50
-0000 1.1.2.3
 -321,11 +321,12 
my $shwrap_prefix;
my $debug = 0;
my $quiet = 0;
+my $notest = 0;
my $verify = 1;
my $rspdir = "rsp";
my $ignore_missing = 0;
+my $ignore_bogus = 1;
my $rspignore = 0;
-my bogus = (); # list of unmatched *.rsp
files
my $bufout = '';
foreach ( ARGV) {
 -341,9 +342,15 
elsif ( $_ eq "--ignore-missing" ) {
$ignore_missing = 1;
}
+ elsif ( $_ eq "--ignore-bogus" ) {
+ $ignore_bogus = 1;
+ }
elsif ( $_ eq "--generate" ) {
$verify = 0;
}
+ elsif ( $_ eq "--notest" ) {
+ $notest = 1;
+ }
elsif ( $_ eq "--quiet" ) {
$quiet = 1;
}
 -412,6 +419,8 
my ( $runerr, $cmperr, $cmpok, $scheckrunerr, $scheckerr,
$scheckok, $skipcnt )
= ( 0, 0, 0, 0, 0, 0 );
+exit (0) if $notest;
+
run_tests( $verify, $win32, $tprefix, $filter, $tvdir );
if ($verify) {
 -420,7 +429,7 
print "Algorithm test program execution
failures: $runerrn";
print "Test comparisons successful:
$cmpokn";
print "Test comparisons failed:
$cmperrn";
- print "Test sanity checks succeessul:
$scheckokn";
+ print "Test sanity checks successful:
$scheckokn";
print "Test sanity checks failed:
$scheckerrn";
print "Sanity check program execution failures:
$scheckrunerrn";
 -442,9 +451,9 
--filter=<regexp>
--onedir <dirname> Assume all components
in current directory
--rspdir=<dirname> Name of subdirectories
containing *.rsp files, default "resp"
- --rspignore Ignore any bogus *.rsp
files
--shwrap_prefix=<prefix>
--tprefix=<prefix>
+ --ignore-bogus Ignore duplicate or bogus
files
--ignore-missing Ignore missing test files
--quiet Shhh....
--generate Generate algorithm test
output
 -495,21 +504,35 
if (//([^/]*).rsp$/) {
$testname = fix_pss( $1, $_ );
if ( exists $fips_tests{$testname} ) {
- $fips_files{$testname}->[1] = $_;
+ if ($fips_files{$testname}->[1] eq
"") {
+ $fips_files{$testname}->[1] =
$_;
+ }
+ else {
+ print STDERR "WARNING:
duplicate response file $_ for test $testnamen";
+ $nbogus++;
+ }
}
else {
- print STDERR "ERROR: bogus file
$_n";
- push bogus, $_;
+ print STDERR "WARNING: bogus
file $_n";
+ $nbogus++;
}
}
next unless /$filter.*.req$/i;
if (//([^/]*).req$/) {
$testname = fix_pss( $1, $_ );
if ( exists $fips_tests{$testname} ) {
- $fips_files{$testname}->[0] = $_;
+ if ($fips_files{$testname}->[0] eq
"") {
+ $fips_files{$testname}->[0] =
$_;
+ }
+ else {
+ print STDERR "WARNING:
duplicate request file $_ for test $testnamen";
+ $nbogus++;
+ }
+
}
elsif ( !/SHAmix.req$/ ) {
print STDERR "WARNING:
unrecognized filename $_n";
+ $nbogus++;
}
}
}
 -564,7 +587,11 
print STDERR "ERROR: test vector file set
not completen";
exit(1) unless $ignore_missing;
}
- elsif ($debug) {
+ if ($nbogus) {
+ print STDERR "ERROR: $nbogus bogus or duplicate
request and response filesn";
+ exit(1) unless $ignore_bogus;
+ }
+ if ($debug && !$nbogus && !$bad) {
print STDERR "test vector file set
completen";
}
}
 -639,7 +666,7 
if ( $fcount || $debug ) {
print STDERR "DEBUG: $tname,
Pass=$pcount, Fail=$fcountn";
}
- if ($fcount) {
+ if ($fcount || !$pcount) {
$scheckerr++;
}
else {
 -662,8 +689,14 
my ( $tname, $rsp, $tst ) = _;
my ( $rspf, $tstf );
my ( $rspline, $tstline );
- open $rspf, $rsp;
- open $tstf, $tst;
+ if (!open ($rspf, $rsp)) {
+ print STDERR "ERROR: can't open request file
$rspn";
+ return 0;
+ }
+ if (!open ($tstf, $tst)) {
+ print STDERR "ERROR: can't open output file
$tstn";
+ return 0;
+ }
for ( ; ; ) {
$rspline = next_line($rspf);
$tstline = next_line($tstf);
 .
____________________________________________________________
__________
OpenSSL Project http://www.openssl.org
CVS Repository Commit List
openssl-cvs openssl.org
Automated List Manager
majordomo openssl.org
|