Blame SOURCES/rh1929465-improve_system_FIPS_detection-root.patch

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