summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsteve <steve>2011-09-25 18:11:39 +0000
committersteve <steve>2011-09-25 18:11:39 +0000
commit0508373d94881097346b8c13678e5a7d1dd10808 (patch)
tree2295965a12ab6234f8f7d783c02e528b9a2589d3
parent467a67db0c07fa081347144c4b2ffb0022bf14c2 (diff)
downloadopenssl-OpenSSL-fips-1_2-stable.tar.gz
-rwxr-xr-xConfigure2
-rw-r--r--apps/speed.c4
-rwxr-xr-xconfig6
-rw-r--r--crypto/rand/rand_unix.c41
-rw-r--r--crypto/rand/randfile.c97
-rw-r--r--crypto/ui/ui_openssl.c17
-rw-r--r--fips/fips_canister.c2
-rw-r--r--fips/mkfipsscr.pl180
8 files changed, 146 insertions, 203 deletions
diff --git a/Configure b/Configure
index 0a8a27d82..c857bed33 100755
--- a/Configure
+++ b/Configure
@@ -524,6 +524,8 @@ my %table=(
"OS2-EMX", "gcc::::::::",
##### VxWorks for various targets
+"vxworks-ppc60x","ccppc:-D_REENTRANT -mrtp -mhard-float -mstrict-align -fno-implicit-fp -DPPC32_fp60x -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip:::VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common:::linux_ppc32.o:::::::::::::::ranlibppc:",
+"vxworks-ppcgen","ccppc:-D_REENTRANT -mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip:::VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon:::linux_ppc32.o:::::::::::::::ranlibppc:",
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
"vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::",
"vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::",
diff --git a/apps/speed.c b/apps/speed.c
index 8a1974f5f..bfe9103aa 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -254,7 +254,7 @@
# endif
#endif
-#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE)
+#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_VXWORKS)
# define HAVE_FORK 1
#endif
@@ -577,7 +577,7 @@ int MAIN(int argc, char **argv)
#define MAX_BLOCK_SIZE 64
#endif
unsigned char DES_iv[8];
- unsigned char iv[2*MAX_BLOCK_SIZE/8];
+ unsigned char iv[MAX_BLOCK_SIZE/8];
#ifndef OPENSSL_NO_DES
DES_cblock *buf_as_des_cblock = NULL;
static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0};
diff --git a/config b/config
index 91231f98f..b8d81e4a8 100755
--- a/config
+++ b/config
@@ -362,6 +362,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
NONSTOP_KERNEL*)
echo "nsr-tandem-nsk"; exit 0;
;;
+
+ vxworks*)
+ echo "${MACHINE}-whatever-vxworks"; exit 0;
+ ;;
esac
#
@@ -524,6 +528,8 @@ case "$GUESSOS" in
OUT="linux-ppc64"
;;
ppc-*-linux2) OUT="linux-ppc" ;;
+ ppc60x-*-vxworks*) OUT="vxworks-ppc60x" ;;
+ ppcgen-*-vxworks*) OUT="vxworks-ppcgen" ;;
ia64-*-linux?) OUT="linux-ia64" ;;
sparc64-*-linux2)
OUT="linux64-sparcv9" ;;
diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c
index 71b98ec21..41259f369 100644
--- a/crypto/rand/rand_unix.c
+++ b/crypto/rand/rand_unix.c
@@ -232,7 +232,7 @@ int RAND_poll(void)
t.tv_sec = 0;
t.tv_usec = usec;
- if (FD_SETSIZE > 0 && (unsigned)fd >= FD_SETSIZE)
+ if (FD_SETSIZE > 0 && fd >= FD_SETSIZE)
{
/* can't use select, so just try to read once anyway */
try_read = 1;
@@ -323,8 +323,43 @@ int RAND_poll(void)
#if defined(OPENSSL_SYS_VXWORKS)
+/* Note: the existence of /dev/urandom on VxWorks platforms is uncommon
+* however we check for one and use it if found for those cases where
+* it is present. */
int RAND_poll(void)
- {
+{
+ unsigned long l;
+#ifdef DEVRANDOM
+ unsigned char buf[ENTROPY_NEEDED];
+ int n = 0, r, fd;
+
+ if ((fd = open("/dev/urandom", O_RDONLY, 0)) >= 0)
+ {
+ do
+ {
+ r = read(fd,(unsigned char *)buf+n, ENTROPY_NEEDED-n);
+ if (r > 0)
+ n += r;
+ }
+ while ((r > 0 || errno == EINTR) && n < ENTROPY_NEEDED);
+
+ close(fd);
+ }
+
+ if (n > 0)
+ {
+ RAND_add(buf,sizeof buf,(double)n);
+ OPENSSL_cleanse(buf,n);
+ }
+#endif
+
+ l=time(NULL);
+ RAND_add(&l,sizeof(l),0.0);
+
+#if defined(DEVRANDOM)
+ return 1;
+#else
return 0;
- }
+#endif
+}
#endif
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index 181056847..abe580af4 100644
--- a/crypto/rand/randfile.c
+++ b/crypto/rand/randfile.c
@@ -56,8 +56,6 @@
* [including the GNU Public Licence.]
*/
-/* We need to define this to get macros like S_IFBLK and S_IFCHR */
-#define _XOPEN_SOURCE 500
#include <errno.h>
#include <stdio.h>
@@ -69,6 +67,10 @@
#include <openssl/rand.h>
#include <openssl/buffer.h>
+#if !defined(OPENSSL_SYS_VXWORKS)
+/* We need to define this to get macros like S_IFBLK and S_IFCHR */
+# define _XOPEN_SOURCE 500
+#endif
#ifdef OPENSSL_SYS_VMS
#include <unixio.h>
#endif
@@ -81,25 +83,10 @@
# include <sys/stat.h>
#endif
-#ifdef _WIN32
-#define stat _stat
-#define chmod _chmod
-#define open _open
-#define fdopen _fdopen
-#endif
-
#undef BUFSIZE
#define BUFSIZE 1024
#define RAND_DATA 1024
-#ifdef OPENSSL_SYS_VMS
-/* This declaration is a nasty hack to get around vms' extension to fopen
- * for passing in sharing options being disabled by our /STANDARD=ANSI89 */
-static FILE *(*const vms_fopen)(const char *, const char *, ...) =
- (FILE *(*)(const char *, const char *, ...))fopen;
-#define VMS_OPEN_ATTRS "shr=get,put,upd,del","ctx=bin,stm","rfm=stm","rat=none","mrs=0"
-#endif
-
/* #define RFILE ".rnd" - defined in ../../e_os.h */
/* Note that these functions are intended for seed files only.
@@ -117,27 +104,14 @@ int RAND_load_file(const char *file, long bytes)
if (file == NULL) return(0);
-#ifdef PURIFY
- /* struct stat can have padding and unused fields that may not be
- * initialized in the call to stat(). We need to clear the entire
- * structure before calling RAND_add() to avoid complaints from
- * applications such as Valgrind.
- */
- memset(&sb, 0, sizeof(sb));
-#endif
-
if (stat(file,&sb) < 0) return(0);
RAND_add(&sb,sizeof(sb),0.0);
if (bytes == 0) return(ret);
-#ifdef OPENSSL_SYS_VMS
- in=vms_fopen(file,"rb",VMS_OPEN_ATTRS);
-#else
in=fopen(file,"rb");
-#endif
if (in == NULL) goto err;
-#if defined(S_ISBLK) && defined(S_ISCHR)
- if (S_ISBLK(sb.st_mode) || S_ISCHR(sb.st_mode)) {
+#if defined(S_IFBLK) && defined(S_IFCHR)
+ if (sb.st_mode & (S_IFBLK | S_IFCHR)) {
/* this file is a device. we don't want read an infinite number
* of bytes from a random device, nor do we want to use buffered
* I/O because we will waste system entropy.
@@ -154,12 +128,8 @@ int RAND_load_file(const char *file, long bytes)
n = BUFSIZE;
i=fread(buf,1,n,in);
if (i <= 0) break;
-#ifdef PURIFY
- RAND_add(buf,i,(double)i);
-#else
/* even if n != i, use the full array */
RAND_add(buf,n,(double)i);
-#endif
ret+=i;
if (bytes > 0)
{
@@ -183,8 +153,8 @@ int RAND_write_file(const char *file)
i=stat(file,&sb);
if (i != -1) {
-#if defined(S_ISBLK) && defined(S_ISCHR)
- if (S_ISBLK(sb.st_mode) || S_ISCHR(sb.st_mode)) {
+#if defined(S_IFBLK) && defined(S_IFCHR)
+ if (sb.st_mode & (S_IFBLK | S_IFCHR)) {
/* this file is a device. we don't write back to it.
* we "succeed" on the assumption this is some sort
* of random device. Otherwise attempting to write to
@@ -195,7 +165,7 @@ int RAND_write_file(const char *file)
#endif
}
-#if defined(O_CREAT) && !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_VMS)
+#if defined(O_CREAT) && !defined(OPENSSL_SYS_WIN32)
{
/* For some reason Win32 can't write to files created this way */
@@ -206,34 +176,8 @@ int RAND_write_file(const char *file)
out = fdopen(fd, "wb");
}
#endif
-
-#ifdef OPENSSL_SYS_VMS
- /* VMS NOTE: Prior versions of this routine created a _new_
- * version of the rand file for each call into this routine, then
- * deleted all existing versions named ;-1, and finally renamed
- * the current version as ';1'. Under concurrent usage, this
- * resulted in an RMS race condition in rename() which could
- * orphan files (see vms message help for RMS$_REENT). With the
- * fopen() calls below, openssl/VMS now shares the top-level
- * version of the rand file. Note that there may still be
- * conditions where the top-level rand file is locked. If so, this
- * code will then create a new version of the rand file. Without
- * the delete and rename code, this can result in ascending file
- * versions that stop at version 32767, and this routine will then
- * return an error. The remedy for this is to recode the calling
- * application to avoid concurrent use of the rand file, or
- * synchronize usage at the application level. Also consider
- * whether or not you NEED a persistent rand file in a concurrent
- * use situation.
- */
-
- out = vms_fopen(file,"rb+",VMS_OPEN_ATTRS);
- if (out == NULL)
- out = vms_fopen(file,"wb",VMS_OPEN_ATTRS);
-#else
if (out == NULL)
out = fopen(file,"wb");
-#endif
if (out == NULL) goto err;
#ifndef NO_CHMOD
@@ -255,6 +199,25 @@ int RAND_write_file(const char *file)
ret+=i;
if (n <= 0) break;
}
+#ifdef OPENSSL_SYS_VMS
+ /* Try to delete older versions of the file, until there aren't
+ any */
+ {
+ char *tmpf;
+
+ tmpf = OPENSSL_malloc(strlen(file) + 4); /* to add ";-1" and a nul */
+ if (tmpf)
+ {
+ strcpy(tmpf, file);
+ strcat(tmpf, ";-1");
+ while(delete(tmpf) == 0)
+ ;
+ rename(file,";1"); /* Make sure it's version 1, or we
+ will reach the limit (32767) at
+ some point... */
+ }
+ }
+#endif /* OPENSSL_SYS_VMS */
fclose(out);
OPENSSL_cleanse(buf,BUFSIZE);
@@ -265,8 +228,8 @@ err:
const char *RAND_file_name(char *buf, size_t size)
{
char *s=NULL;
-#ifdef __OpenBSD__
int ok = 0;
+#ifdef __OpenBSD__
struct stat sb;
#endif
@@ -294,9 +257,7 @@ const char *RAND_file_name(char *buf, size_t size)
BUF_strlcat(buf,"/",size);
#endif
BUF_strlcat(buf,RFILE,size);
-#ifdef __OpenBSD__
ok = 1;
-#endif
}
else
buf[0] = '\0'; /* no file name */
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index 06270f09c..10111efbf 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -122,7 +122,9 @@
* sigaction and fileno included. -pedantic would be more appropriate for
* the intended purposes, but we can't prevent users from adding -ansi.
*/
-#define _POSIX_C_SOURCE 1
+#if !defined(OPENSSL_SYS_VXWORKS)
+# define _POSIX_C_SOURCE 1
+#endif
#include <signal.h>
#include <stdio.h>
#include <string.h>
@@ -297,7 +299,7 @@ static int is_a_tty;
/* Declare static functions */
#if !defined(OPENSSL_SYS_WIN16) && !defined(OPENSSL_SYS_WINCE)
-static int read_till_nl(FILE *);
+static void read_till_nl(FILE *);
static void recsig(int);
static void pushsig(void);
static void popsig(void);
@@ -390,16 +392,14 @@ static int read_string(UI *ui, UI_STRING *uis)
#if !defined(OPENSSL_SYS_WIN16) && !defined(OPENSSL_SYS_WINCE)
/* Internal functions to read a string without echoing */
-static int read_till_nl(FILE *in)
+static void read_till_nl(FILE *in)
{
#define SIZE 4
char buf[SIZE+1];
do {
- if (!fgets(buf,SIZE,in))
- return 0;
+ fgets(buf,SIZE,in);
} while (strchr(buf,'\n') == NULL);
- return 1;
}
static volatile sig_atomic_t intr_signal;
@@ -447,8 +447,7 @@ static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl)
*p='\0';
}
else
- if (!read_till_nl(tty_in))
- goto error;
+ read_till_nl(tty_in);
if (UI_set_result(ui, uis, result) >= 0)
ok=1;
@@ -680,8 +679,6 @@ static int noecho_fgets(char *buf, int size, FILE *tty)
size--;
#ifdef WIN16TTY
i=_inchar();
-#elif defined(_WIN32)
- i=_getch();
#else
i=getch();
#endif
diff --git a/fips/fips_canister.c b/fips/fips_canister.c
index 174466189..4b0a9e814 100644
--- a/fips/fips_canister.c
+++ b/fips/fips_canister.c
@@ -174,6 +174,8 @@ void *FIPS_ref_point()
# else
return (void *)FIPS_ref_point;
# endif
+#elif defined(__vxworks)
+ return (void *)FIPS_ref_point;
/*
* In case you wonder why there is no #ifdef __linux. All Linux targets
* are GCC-based and therefore are covered by instruction_pointer above
diff --git a/fips/mkfipsscr.pl b/fips/mkfipsscr.pl
index dc60cdf58..16d4842ae 100644
--- a/fips/mkfipsscr.pl
+++ b/fips/mkfipsscr.pl
@@ -1,11 +1,5 @@
#!/usr/local/bin/perl -w
-# Quick & dirty utility to generate a script for executing the
-# FIPS 140-2 CMVP algorithm tests based on the pathnames of
-# input algorithm test files actually present (the unqualified
-# file names are consistent but the pathnames are not).
-#
-# List of all the unqualified file names we expect.
my %fips_tests = (
# FIPS test definitions
@@ -283,15 +277,8 @@ my %fips_tests = (
"TOFBvartext" => "fips_desmovs -f"
);
-my %salt_names = (
-"SigVerPSS (salt 0)" => "SigVerPSS",
-"SigVerPSS (salt 62)" => "SigVerPSS",
-"SigGenPSS (salt 0)" => "SigGenPSS",
-"SigGenPSS (salt 62)" => "SigGenPSS",
-);
-
-my $win32 = $^O =~ m/mswin/i;
+my $win32 = 0;
my $onedir = 0;
my $filter = "";
my $tvdir;
@@ -300,10 +287,6 @@ my $shwrap_prefix;
my $debug = 0;
my $quiet = 0;
my $rspdir = "rsp";
-my $rspignore = 0;
-my @bogus = (); # list of unmatched *.rsp files
-my $bufout = '';
-my %_programs = (); # list of external programs to check
foreach (@ARGV)
{
@@ -311,6 +294,10 @@ foreach (@ARGV)
{
$win32 = 1;
}
+ if ($_ eq "--vxworks")
+ {
+ $vxworks = 1;
+ }
elsif ($_ eq "--onedir")
{
$onedir = 1;
@@ -331,10 +318,6 @@ foreach (@ARGV)
{
$rspdir = $1;
}
- elsif (/--rspignore$/)
- {
- $rspignore = 1;
- }
elsif (/--tprefix=(.*)$/)
{
$tprefix = $1;
@@ -351,13 +334,13 @@ foreach (@ARGV)
{
$outfile = $1;
}
- else
- {
- &Help();
- exit(1);
- }
}
+if ($win32 && $vxworks) {
+ print STDERR "Can't specify both --win32 and --vxworks\n";
+ exit(1);
+}
+
$tvdir = "." unless defined $tvdir;
if ($win32)
@@ -373,8 +356,10 @@ if ($win32)
$tprefix = "..\\out32dll\\";
}
}
+ $outfile = "fipstests.bat" unless defined $outfile;
+ open(OUT, ">$outfile");
- $bufinit .= <<END;
+ print OUT <<END;
\@echo off
rem Test vector run script
rem Auto generated by mkfipsscr.pl script
@@ -383,6 +368,21 @@ rem Do not edit
END
}
+elsif ($vxworks)
+ {
+ # Always assume onedir.
+ $tprefix = "" unless defined $tprefix;
+ $outfile = "fipstests" unless defined $outfile;
+ open(OUT, ">$outfile");
+
+ print OUT <<END;
+# Test vector run script
+# Auto generated by mkfipsscr.pl script
+# Do not edit
+
+END
+
+ }
else
{
if ($onedir)
@@ -395,8 +395,10 @@ else
$tprefix = "../test/" unless defined $tprefix;
$shwrap_prefix = "../util/" unless defined $shwrap_prefix;
}
+ $outfile = "fipstests.sh" unless defined $outfile;
+ open(OUT, ">$outfile");
- $bufinit .= <<END;
+ print OUT <<END;
#!/bin/sh
# Test vector run script
@@ -411,70 +413,11 @@ foreach (keys %fips_tests)
{
$fips_found{$_} = 0;
}
-my %saltPSS;
-for (keys %salt_names)
- {
- $salt_found{$_} = 0;
- }
recurse_test($win32, $tprefix, $filter, $tvdir);
-while (($key, $value) = each %salt_found)
- {
- &countentry($key, $value);
- delete $fips_found{$salt_names{$key}};
- }
while (($key, $value) = each %fips_found)
{
- &countentry($key, $value);
- }
-
-# If no fatal errors write out the script file
- $outfile = "fipstests.sh" unless defined $outfile;
- open(OUT, ">$outfile") || die "Error opening $outfile: $!";
- print OUT $bufinit;
- if (!$rspignore && @bogus)
- {
- print STDERR "ERROR: please remove bogus *.rsp files\n";
- print OUT <<EOF;
-echo $outfile generation failed due to presence of bogus *.rsp files
-EOF
- }
- else
- {
- print OUT $bufout;
- }
- close OUT;
-
-# Check for external programs
- for (keys %_programs)
- {
- s/ .*$//;
- -x $_ || print STDERR "WARNING: program $_ not found\n";
- }
-
-#--------------------------------
-sub Help {
-(my $cmd) = ($0 =~ m#([^/]+)$#);
- print <<EOF;
-$cmd: generate script for CMVP algorithm tests
- --debug Enable debug output
- --dir=<dirname> Optional root for *.req file search
- --filter=<regexp>
- --onedir <dirname> Assume all components in current directory
- --outfile=<filename> Optional name of output script, default fipstests.{sh|bat}
- --rspdir=<dirname> Name of subdirectories containing *.rsp files, default "resp"
- --rspignore Ignore any bogus *.rsp files
- --shwrap_prefix=<prefix>
- --tprefix=<prefix>
- --quiet Shhh....
- --win32 Generate script for Win32 environment
-EOF
-}
-
-#--------------------------------
-sub countentry {
- my ($key,$value) = @_;
if ($value == 0)
{
print STDERR "WARNING: test file $key not found\n" unless $quiet;
@@ -489,7 +432,7 @@ sub countentry {
}
}
-#--------------------------------
+
sub recurse_test
{
my ($win32, $tprefix, $filter, $dir) = @_;
@@ -501,29 +444,17 @@ sub recurse_test
$_ = "$dir/$_";
if (-f "$_")
{
- if (/\/([^\/]*)\.rsp$/)
- {
- if (exists $fips_tests{$1})
- {
- $debug && print "DEBUG: $1 found, will be overwritten\n";
- }
- else
- {
- print STDERR "ERROR: bogus file $_\n";
- push @bogus, $_;
- }
- }
next unless /$filter.*\.req$/i;
if (/\/([^\/]*)\.req$/ && exists $fips_tests{$1})
{
$fips_found{$1}++;
- test_line($win32, $_, $tprefix, $1);
+ test_line($win32, $_, $tprefix, $fips_tests{$1});
}
elsif (! /SHAmix\.req$/)
{
print STDERR "WARNING: unrecognized filename $_\n";
}
- }
+ }
elsif (-d "$_")
{
if (/$filter.*req$/i)
@@ -536,7 +467,6 @@ sub recurse_test
closedir($dirh);
}
-#--------------------------------
sub test_dir
{
my ($win32, $req) = @_;
@@ -546,16 +476,26 @@ sub test_dir
{
$rsp =~ tr|/|\\|;
$req =~ tr|/|\\|;
- $bufout .= <<END;
+ print OUT <<END;
echo Running tests in $req
if exist "$rsp" rd /s /q "$rsp"
md "$rsp"
END
}
+ elsif ($vxworks)
+ {
+ print OUT <<END;
+
+echo Running tests in "$req"
+rm -r "$rsp"
+mkdir "$rsp"
+
+END
+ }
else
{
- $bufout .= <<END;
+ print OUT <<END;
echo Running tests in "$req"
rm -rf "$rsp"
@@ -565,12 +505,10 @@ END
}
}
-#--------------------------------
sub test_line
{
- my ($win32, $req, $tprefix, $tnam) = @_;
+ my ($win32, $req, $tprefix, $tcmd) = @_;
my $rsp = $req;
- my $tcmd = $fips_tests{$tnam};
$rsp =~ s/req\/([^\/]*).req$/$rspdir\/$1.rsp/;
if ($tcmd =~ /-f$/)
{
@@ -578,17 +516,18 @@ sub test_line
{
$req =~ tr|/|\\|;
$rsp =~ tr|/|\\|;
- $bufout .= "$tprefix$tcmd \"$req\" \"$rsp\"\n";
- $_programs{"$tprefix$tcmd.exe"} = 1;
+ print OUT "$tprefix$tcmd \"$req\" \"$rsp\"\n";
+ }
+ elsif ($vxworks)
+ {
+ print OUT "run $tprefix$tcmd \"$req\" \"$rsp\"\n";
}
else
{
- $bufout .= <<END;
+ print OUT <<END;
${shwrap_prefix}shlib_wrap.sh $tprefix$tcmd "$req" "$rsp" || { echo "$req failure" ; exit 1
}
END
- $_programs{"${shwrap_prefix}shlib_wrap.sh"} = 1;
- $_programs{"$tprefix$tcmd"} = 1;
}
return;
}
@@ -598,12 +537,11 @@ END
my $saltlen;
while (<IN>)
{
- if (/^\s*#\s*salt\s+len:\s+(\d+)\s*$/i)
+ if (/^\s*#\s*salt\s+len:\s+(\d+)\s+$/i)
{
my $sl = $1;
print STDERR "$req salt length $sl\n" if $debug;
$tcmd =~ s/SALT$/$sl/;
- $salt_found{"$tnam (salt $sl)"}++;
last;
}
}
@@ -618,15 +556,17 @@ END
{
$req =~ tr|/|\\|;
$rsp =~ tr|/|\\|;
- $bufout .= "$tprefix$tcmd < \"$req\" > \"$rsp\"\n";
- $_programs{"$tprefix$tcmd.exe"} = 1;
+ print OUT "$tprefix$tcmd < \"$req\" > \"$rsp\"\n";
+ }
+ elsif ($vxworks)
+ {
+ print OUT "run $tprefix$tcmd \"$req\" \"$rsp\"\n";
}
else
{
- $bufout .= <<END;
+ print OUT <<END;
${shwrap_prefix}shlib_wrap.sh $tprefix$tcmd < "$req" > "$rsp" || { echo "$req failure" ; exit 1; }
END
- $_programs{"$tprefix$tcmd"} = 1;
}
}