Update some util files to recognize new FIPS directories.
authorDr. Stephen Henson <steve@openssl.org>
Wed, 17 Sep 2008 16:58:01 +0000 (16:58 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 17 Sep 2008 16:58:01 +0000 (16:58 +0000)
util/copy.pl
util/mkdef.pl
util/mkerr.pl
util/mkfiles.pl
util/mklink.pl

index e20b45530a8f5f645ec2717cff6cf8c1e4d0187f..eba6d5815e9cef6b312e71cdee6f5642b2ac06af 100644 (file)
@@ -8,9 +8,16 @@ use Fcntl;
 # Perl script 'copy' comment. On Windows the built in "copy" command also
 # copies timestamps: this messes up Makefile dependencies.
 
+my $stripcr = 0;
+
 my $arg;
 
 foreach $arg (@ARGV) {
+       if ($arg eq "-stripcr")
+               {
+               $stripcr = 1;
+               next;
+               }
        $arg =~ s|\\|/|g;       # compensate for bug/feature in cygwin glob...
        foreach (glob $arg)
                {
@@ -49,6 +56,10 @@ foreach (@filelist)
                                        || die "Can't Open $dfile";
        while (sysread IN, $buf, 10240)
                {
+               if ($stripcr)
+                       {
+                       $buf =~ tr/\015//d;
+                       }
                syswrite(OUT, $buf, length($buf));
                }
        close(IN);
index 8ecfde1848a7ddd8d63d98df328c37c0cff0b48d..26155b887a4fdae82b1963eb6f03ae7fd5d38a2c 100755 (executable)
@@ -79,7 +79,7 @@ my $OS2=0;
 my $safe_stack_def = 0;
 
 my @known_platforms = ( "__FreeBSD__", "PERL5", "NeXT",
-                       "EXPORT_VAR_AS_FUNCTION", "ZLIB" );
+                       "EXPORT_VAR_AS_FUNCTION", "ZLIB", "OPENSSL_FIPS" );
 my @known_ossl_platforms = ( "VMS", "WIN16", "WIN32", "WINNT", "OS2" );
 my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF",
                         "CAST", "MD2", "MD4", "MD5", "SHA", "SHA0", "SHA1",
@@ -123,6 +123,7 @@ my $no_ec; my $no_ecdsa; my $no_ecdh; my $no_engine; my $no_hw; my $no_camellia;
 my $no_seed;
 my $no_fp_api; my $no_static_engine; my $no_gmp; my $no_deprecated;
 my $no_rfc3779; my $no_tlsext; my $no_cms; my $no_capieng;
+my $fips;
 
 
 foreach (@ARGV, split(/ /, $options))
@@ -144,11 +145,13 @@ foreach (@ARGV, split(/ /, $options))
        }
        $VMS=1 if $_ eq "VMS";
        $OS2=1 if $_ eq "OS2";
+       $fips=1 if /^fips/;
+
        if ($_ eq "zlib" || $_ eq "zlib-dynamic"
-                        || $_ eq "enable-zlib-dynamic") {
-               $zlib = 1;
+                        || $_ eq "enable-zlib-dynamic") {
+               $zlib = 1;
        }
-
 
        $do_ssl=1 if $_ eq "ssleay";
        if ($_ eq "ssl") {
@@ -305,6 +308,7 @@ $crypto.=" crypto/tmdiff.h";
 $crypto.=" crypto/store/store.h";
 $crypto.=" crypto/pqueue/pqueue.h";
 $crypto.=" crypto/cms/cms.h";
+$crypto.=" fips/fips.h fips/rand/fips_rand.h";
 
 my $symhacks="crypto/symhacks.h";
 
@@ -1090,6 +1094,9 @@ sub is_valid
                        if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32 || $W16)) {
                                return 1;
                        }
+                       if ($keyword eq "OPENSSL_FIPS" && $fips) {
+                               return 1;
+                       }
                        if ($keyword eq "ZLIB" && $zlib) { return 1; }
                        return 0;
                } else {
index 53e14ab4df93f661aec1ecd02b21e953a28e253f..554bebb1590126e72d56bb52cade806a2a9e3740 100644 (file)
@@ -44,7 +44,8 @@ while (@ARGV) {
 }
 
 if($recurse) {
-       @source = (<crypto/*.c>, <crypto/*/*.c>, <ssl/*.c>);
+       @source = ( <crypto/*.c>, <crypto/*/*.c>, <ssl/*.c>,
+                       <fips/*.c>, <fips/*/*.c>);
 } else {
        @source = @ARGV;
 }
index 1282392feae3bde0daf1a4f5540442602c5665b9..38d3e87377a25a0713ed861f2cd437940bcf09a9 100755 (executable)
@@ -58,6 +58,15 @@ my @dirs = (
 "crypto/store",
 "crypto/pqueue",
 "crypto/cms",
+"fips",
+"fips/aes",
+"fips/des",
+"fips/dsa",
+"fips/dh",
+"fips/hmac",
+"fips/rand",
+"fips/rsa",
+"fips/sha",
 "ssl",
 "apps",
 "engines",
index d9bc98aab8788cdcca76aecfa3e1a835537df856..eacc32788264f5c3fcbfe7cfa9935ba6df363c02 100755 (executable)
 # Apart from this, this script should be able to handle even the most
 # pathological cases.
 
-use Cwd;
+my $pwd;
+eval 'use Cwd;';
+if ($@)
+       {
+       $pwd = `pwd`;
+       }
+else
+       {
+       $pwd = getcwd();
+       }
 
 my $from = shift;
 my @files = @ARGV;
 
 my @from_path = split(/[\\\/]/, $from);
-my $pwd = getcwd();
 chomp($pwd);
 my @pwd_path = split(/[\\\/]/, $pwd);