Blame SOURCES/rh1929465-improve_system_FIPS_detection-root.patch

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