elsif (/--tprefix=(.*)$/) {
$tprefix = $1;
}
+ elsif (/^--disable-all$/) {
+ foreach (keys %fips_enabled) {
+ $fips_enabled{$_} = 0;
+ }
+ }
elsif (/^--(enable|disable)-(.*)$/) {
if ( !exists $fips_enabled{$2} ) {
print STDERR "Unknown test $2\n";
}
push @fips_test_list, @fips_dsa_test_list if $fips_enabled{"dsa"};
-push @fips_test_list, @fips_dsa2_test_list if $fips_enabled{"dsa2"};
push @fips_test_list, @fips_dsa_pqgver_test_list if $fips_enabled{"dsa-pqgver"};
+push @fips_test_list, @fips_dsa2_test_list if $fips_enabled{"dsa2"};
push @fips_test_list, @fips_ecdsa_test_list if $fips_enabled{"ecdsa"};
push @fips_test_list, @fips_rsa_test_list if $fips_enabled{"rsa"};
push @fips_test_list, @fips_rsa_pss0_test_list if $fips_enabled{"rsa-pss0"};
my ( $tname, $rsp, $tst ) = @_;
my ( $rspf, $tstf );
my ( $rspline, $tstline );
+ my $monte = 0;
if ( !open( $rspf, $rsp ) ) {
print STDERR "ERROR: can't open request file $rsp\n";
return 0;
print STDERR "ERROR: can't open output file $tst\n";
return 0;
}
+ $monte = 1 if ($rsp =~ /Monte[123]/);
for ( ; ; ) {
$rspline = next_line($rspf);
$tstline = next_line($tstf);
print STDERR "DEBUG: $tname file comparison OK\n" if $debug;
return 1;
}
+ # Workaround for old broken DES3 MCT format which added bogus
+ # extra lines: after [ENCRYPT] or [DECRYPT] skip until first
+ # COUNT line.
+ if ($monte) {
+ if ($rspline =~ /CRYPT/) {
+ do {
+ $rspline = next_line($rspf);
+ } while (defined($rspline) && $rspline !~ /COUNT/);
+ }
+ if ($tstline =~ /CRYPT/) {
+ do {
+ $tstline = next_line($tstf);
+ } while (defined($tstline) && $tstline !~ /COUNT/);
+ }
+ }
if ( !defined($rspline) ) {
print STDERR "ERROR: $tname EOF on $rsp\n";
return 0;