Blame SOURCES/rh1929465-improve_system_FIPS_detection-root.patch

53c576
diff --git openjdk.orig/common/autoconf/configure.ac openjdk/common/autoconf/configure.ac
53c576
--- openjdk.orig/common/autoconf/configure.ac
53c576
+++ openjdk/common/autoconf/configure.ac
53c576
@@ -212,6 +212,7 @@
53c576
 LIB_SETUP_ALSA
53c576
 LIB_SETUP_FONTCONFIG
53c576
 LIB_SETUP_MISC_LIBS
53c576
+LIB_SETUP_SYSCONF_LIBS
53c576
 LIB_SETUP_STATIC_LINK_LIBSTDCPP
53c576
 LIB_SETUP_ON_WINDOWS
53c576
 
53c576
diff --git openjdk.orig/common/autoconf/libraries.m4 openjdk/common/autoconf/libraries.m4
53c576
--- openjdk.orig/common/autoconf/libraries.m4
53c576
+++ openjdk/common/autoconf/libraries.m4
53c576
@@ -1067,3 +1067,63 @@
53c576
     BASIC_DEPRECATED_ARG_WITH([dxsdk-include])
53c576
   fi
53c576
 ])
53c576
+
53c576
+################################################################################
53c576
+# Setup system configuration libraries
53c576
+################################################################################
53c576
+AC_DEFUN_ONCE([LIB_SETUP_SYSCONF_LIBS],
53c576
+[
53c576
+  ###############################################################################
53c576
+  #
53c576
+  # Check for the NSS library
53c576
+  #
53c576
+
53c576
+  AC_MSG_CHECKING([whether to use the system NSS library with the System Configurator (libsysconf)])
53c576
+
53c576
+  # default is not available
53c576
+  DEFAULT_SYSCONF_NSS=no
53c576
+
53c576
+  AC_ARG_ENABLE([sysconf-nss], [AS_HELP_STRING([--enable-sysconf-nss],
53c576
+     [build the System Configurator (libsysconf) using the system NSS library if available @<:@disabled@:>@])],
53c576
+  [
53c576
+    case "${enableval}" in
53c576
+      yes)
53c576
+        sysconf_nss=yes
53c576
+        ;;
53c576
+      *)
53c576
+        sysconf_nss=no
53c576
+        ;;
53c576
+    esac
53c576
+  ],
53c576
+  [
53c576
+    sysconf_nss=${DEFAULT_SYSCONF_NSS}
53c576
+  ])
53c576
+  AC_MSG_RESULT([$sysconf_nss])
53c576
+
53c576
+  USE_SYSCONF_NSS=false
53c576
+  if test "x${sysconf_nss}" = "xyes"; then
53c576
+      PKG_CHECK_MODULES(NSS, nss >= 3.53, [NSS_FOUND=yes], [NSS_FOUND=no])
53c576
+      if test "x${NSS_FOUND}" = "xyes"; then
53c576
+         AC_MSG_CHECKING([for system FIPS support in NSS])
53c576
+         saved_libs="${LIBS}"
53c576
+         saved_cflags="${CFLAGS}"
53c576
+         CFLAGS="${CFLAGS} ${NSS_CFLAGS}"
53c576
+         LIBS="${LIBS} ${NSS_LIBS}"
53c576
+         AC_LANG_PUSH([C])
53c576
+         AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nss3/pk11pub.h>]],
53c576
+                                         [[SECMOD_GetSystemFIPSEnabled()]])],
53c576
+                        [AC_MSG_RESULT([yes])],
53c576
+                        [AC_MSG_RESULT([no])
53c576
+                        AC_MSG_ERROR([System NSS FIPS detection unavailable])])
53c576
+         AC_LANG_POP([C])
53c576
+         CFLAGS="${saved_cflags}"
53c576
+         LIBS="${saved_libs}"
53c576
+         USE_SYSCONF_NSS=true
53c576
+      else
53c576
+         dnl NSS 3.53 is the one that introduces the SECMOD_GetSystemFIPSEnabled API
53c576
+         dnl in nss3/pk11pub.h.
53c576
+         AC_MSG_ERROR([--enable-sysconf-nss specified, but NSS 3.53 or above not found.])
53c576
+      fi
53c576
+  fi
53c576
+  AC_SUBST(USE_SYSCONF_NSS)
53c576
+])
53c576
diff --git openjdk.orig/common/autoconf/spec.gmk.in openjdk/common/autoconf/spec.gmk.in
53c576
--- openjdk.orig/common/autoconf/spec.gmk.in
53c576
+++ openjdk/common/autoconf/spec.gmk.in
53c576
@@ -312,6 +312,10 @@
53c576
 ALSA_LIBS:=@ALSA_LIBS@
53c576
 ALSA_CFLAGS:=@ALSA_CFLAGS@
53c576
 
53c576
+USE_SYSCONF_NSS:=@USE_SYSCONF_NSS@
53c576
+NSS_LIBS:=@NSS_LIBS@
53c576
+NSS_CFLAGS:=@NSS_CFLAGS@
53c576
+
53c576
 PACKAGE_PATH=@PACKAGE_PATH@
53c576
 
53c576
 # Source file for cacerts
53c576
diff --git openjdk.orig/common/bin/compare_exceptions.sh.incl openjdk/common/bin/compare_exceptions.sh.incl
53c576
--- openjdk.orig/common/bin/compare_exceptions.sh.incl
53c576
+++ openjdk/common/bin/compare_exceptions.sh.incl
53c576
@@ -280,6 +280,7 @@
53c576
 ./jre/lib/i386/libsplashscreen.so
53c576
 ./jre/lib/i386/libsunec.so
53c576
 ./jre/lib/i386/libsunwjdga.so
53c576
+./jre/lib/i386/libsystemconf.so
53c576
 ./jre/lib/i386/libt2k.so
53c576
 ./jre/lib/i386/libunpack.so
53c576
 ./jre/lib/i386/libverify.so
53c576
@@ -433,6 +434,7 @@
53c576
 ./jre/lib/amd64/libsplashscreen.so
53c576
 ./jre/lib/amd64/libsunec.so
53c576
 ./jre/lib/amd64/libsunwjdga.so
53c576
+//jre/lib/amd64/libsystemconf.so
53c576
 ./jre/lib/amd64/libt2k.so
53c576
 ./jre/lib/amd64/libunpack.so
53c576
 ./jre/lib/amd64/libverify.so
53c576
@@ -587,6 +589,7 @@
53c576
 ./jre/lib/sparc/libsplashscreen.so
53c576
 ./jre/lib/sparc/libsunec.so
53c576
 ./jre/lib/sparc/libsunwjdga.so
53c576
+./jre/lib/sparc/libsystemconf.so
53c576
 ./jre/lib/sparc/libt2k.so
53c576
 ./jre/lib/sparc/libunpack.so
53c576
 ./jre/lib/sparc/libverify.so
53c576
@@ -741,6 +744,7 @@
53c576
 ./jre/lib/sparcv9/libsplashscreen.so
53c576
 ./jre/lib/sparcv9/libsunec.so
53c576
 ./jre/lib/sparcv9/libsunwjdga.so
53c576
+./jre/lib/sparcv9/libsystemconf.so
53c576
 ./jre/lib/sparcv9/libt2k.so
53c576
 ./jre/lib/sparcv9/libunpack.so
53c576
 ./jre/lib/sparcv9/libverify.so
53c576
diff --git openjdk.orig/common/nb_native/nbproject/configurations.xml openjdk/common/nb_native/nbproject/configurations.xml
53c576
--- openjdk.orig/common/nb_native/nbproject/configurations.xml
53c576
+++ openjdk/common/nb_native/nbproject/configurations.xml
53c576
@@ -53,6 +53,9 @@
53c576
                   <in>jvmtiEnterTrace.cpp</in>
53c576
                 </df>
53c576
               </df>
53c576
+              <df name="libsystemconf">
53c576
+                <in>systemconf.c</in>
53c576
+              </df>
53c576
             </df>
53c576
           </df>
53c576
           <df name="jdk">
53c576
@@ -12772,6 +12775,11 @@
53c576
             tool="0"
53c576
             flavor2="0">
53c576
       </item>
53c576
+      
53c576
+            ex="false"
53c576
+            tool="0"
53c576
+            flavor2="0">
53c576
+      </item>
53c576
       
53c576
             ex="false"
53c576
             tool="0"