Now the FIPS capable OpenSSL is available simplify the various FIPS test
[openssl.git] / Configure
index a8b3b35e806e7da3106121bae3e666decc424b2c..cdef7f8506d0f6e3b84d1ee415af83774f66fa0d 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -870,6 +870,16 @@ PROCESS_ARGS:
                        $fips = 1;
                        $nofipscanistercheck = 1;
                        }
+               elsif (/^fipscheck$/)
+                       {
+                       if ($fipscanisteronly != 2)
+                               {
+                               print STDERR <<"EOF";
+ERROR: FIPS not autodetected. Not running from restricted tarball??
+EOF
+                               exit(1);
+                               }
+                       }
                elsif (/^fipscanisteronly$/)
                        {
                        $fips = 1;
@@ -884,6 +894,7 @@ PROCESS_ARGS:
                        $nofipscanistercheck = 1;
                        $fipslibdir="";
                        $fipscanisterinternal="y";
+                       $fipscanisteronly = 1;
                        }
                elsif (/^fipsdso$/)
                        {
@@ -1124,11 +1135,6 @@ foreach (sort (keys %disabled))
 
 my $exp_cflags = "";
 
-if ($fipscanisteronly == 2)
-       {
-       $exp_cflags .= " -DOPENSSL_FIPSSYMS";
-       }
-
 foreach (sort @experimental)
        {
        my $ALGO;
@@ -1148,7 +1154,14 @@ if ($openssldir eq "" and $prefix eq "")
        {
        if ($fips)
                {
-               $openssldir="/usr/local/ssl/fips-2.0";
+               if (exists $ENV{FIPSDIR})
+                       {
+                       $openssldir="$ENV{FIPSDIR}";
+                       }
+               else
+                       {
+                       $openssldir="/usr/local/ssl/fips-2.0";
+                       }
                }
        else
                {
@@ -1724,7 +1737,7 @@ while (<IN>)
                s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.\$(SHLIB_MAJOR).dylib .dylib/;
                }
        s/^SHARED_LDFLAGS=.*/SHARED_LDFLAGS=$shared_ldflag/;
-       if ($fipscanisteronly == 2 && exists $disabled{"ec2m"})
+       if ($fipscanisteronly && exists $disabled{"ec2m"})
                {
                next if (/ec2_/ || /bn_gf2m/);
                }
@@ -1975,7 +1988,7 @@ EOF
            &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";',  '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
            &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
        }
-       if ($depflags ne $default_depflags && !$make_depend && $fipscanisteronly != 2) {
+       if ($depflags ne $default_depflags && !$make_depend && !$fipscanisteronly) {
                print <<EOF;
 
 Since you've disabled or enabled at least one algorithm, you need to do