Blame SOURCES/rh1929465-improve_system_FIPS_detection.patch

c0ba06
diff --git openjdk/make/autoconf/lib-sysconf.m4 openjdk/make/autoconf/lib-sysconf.m4
c0ba06
new file mode 100644
c0ba06
index 00000000000..b2b1c1787da
c0ba06
--- /dev/null
c0ba06
+++ openjdk/make/autoconf/lib-sysconf.m4
c0ba06
@@ -0,0 +1,84 @@
c0ba06
+#
c0ba06
+# Copyright (c) 2021, Red Hat, Inc.
c0ba06
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c0ba06
+#
c0ba06
+# This code is free software; you can redistribute it and/or modify it
c0ba06
+# under the terms of the GNU General Public License version 2 only, as
c0ba06
+# published by the Free Software Foundation.  Oracle designates this
c0ba06
+# particular file as subject to the "Classpath" exception as provided
c0ba06
+# by Oracle in the LICENSE file that accompanied this code.
c0ba06
+#
c0ba06
+# This code is distributed in the hope that it will be useful, but WITHOUT
c0ba06
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c0ba06
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c0ba06
+# version 2 for more details (a copy is included in the LICENSE file that
c0ba06
+# accompanied this code).
c0ba06
+#
c0ba06
+# You should have received a copy of the GNU General Public License version
c0ba06
+# 2 along with this work; if not, write to the Free Software Foundation,
c0ba06
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c0ba06
+#
c0ba06
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c0ba06
+# or visit www.oracle.com if you need additional information or have any
c0ba06
+# questions.
c0ba06
+#
c0ba06
+
c0ba06
+################################################################################
c0ba06
+# Setup system configuration libraries
c0ba06
+################################################################################
c0ba06
+AC_DEFUN_ONCE([LIB_SETUP_SYSCONF_LIBS],
c0ba06
+[
c0ba06
+  ###############################################################################
c0ba06
+  #
c0ba06
+  # Check for the NSS library
c0ba06
+  #
c0ba06
+
c0ba06
+  AC_MSG_CHECKING([whether to use the system NSS library with the System Configurator (libsysconf)])
c0ba06
+
c0ba06
+  # default is not available
c0ba06
+  DEFAULT_SYSCONF_NSS=no
c0ba06
+
c0ba06
+  AC_ARG_ENABLE([sysconf-nss], [AS_HELP_STRING([--enable-sysconf-nss],
c0ba06
+     [build the System Configurator (libsysconf) using the system NSS library if available @<:@disabled@:>@])],
c0ba06
+  [
c0ba06
+    case "${enableval}" in
c0ba06
+      yes)
c0ba06
+        sysconf_nss=yes
c0ba06
+        ;;
c0ba06
+      *)
c0ba06
+        sysconf_nss=no
c0ba06
+        ;;
c0ba06
+    esac
c0ba06
+  ],
c0ba06
+  [
c0ba06
+    sysconf_nss=${DEFAULT_SYSCONF_NSS}
c0ba06
+  ])
c0ba06
+  AC_MSG_RESULT([$sysconf_nss])
c0ba06
+
c0ba06
+  USE_SYSCONF_NSS=false
c0ba06
+  if test "x${sysconf_nss}" = "xyes"; then
c0ba06
+      PKG_CHECK_MODULES(NSS, nss >= 3.53, [NSS_FOUND=yes], [NSS_FOUND=no])
c0ba06
+      if test "x${NSS_FOUND}" = "xyes"; then
c0ba06
+         AC_MSG_CHECKING([for system FIPS support in NSS])
c0ba06
+         saved_libs="${LIBS}"
c0ba06
+         saved_cflags="${CFLAGS}"
c0ba06
+         CFLAGS="${CFLAGS} ${NSS_CFLAGS}"
c0ba06
+         LIBS="${LIBS} ${NSS_LIBS}"
c0ba06
+         AC_LANG_PUSH([C])
c0ba06
+         AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nss3/pk11pub.h>]],
c0ba06
+                                         [[SECMOD_GetSystemFIPSEnabled()]])],
c0ba06
+                        [AC_MSG_RESULT([yes])],
c0ba06
+                        [AC_MSG_RESULT([no])
c0ba06
+                        AC_MSG_ERROR([System NSS FIPS detection unavailable])])
c0ba06
+         AC_LANG_POP([C])
c0ba06
+         CFLAGS="${saved_cflags}"
c0ba06
+         LIBS="${saved_libs}"
c0ba06
+         USE_SYSCONF_NSS=true
c0ba06
+      else
c0ba06
+         dnl NSS 3.53 is the one that introduces the SECMOD_GetSystemFIPSEnabled API
c0ba06
+         dnl in nss3/pk11pub.h.
c0ba06
+         AC_MSG_ERROR([--enable-sysconf-nss specified, but NSS 3.53 or above not found.])
c0ba06
+      fi
c0ba06
+  fi
c0ba06
+  AC_SUBST(USE_SYSCONF_NSS)
c0ba06
+])
c0ba06
diff --git openjdk/make/autoconf/libraries.m4 openjdk/make/autoconf/libraries.m4
c0ba06
index a65d91ee974..a8f054c1397 100644
c0ba06
--- openjdk/make/autoconf/libraries.m4
c0ba06
+++ openjdk/make/autoconf/libraries.m4
c0ba06
@@ -33,6 +33,7 @@ m4_include([lib-std.m4])
c0ba06
 m4_include([lib-x11.m4])
c0ba06
 m4_include([lib-fontconfig.m4])
c0ba06
 m4_include([lib-tests.m4])
c0ba06
+m4_include([lib-sysconf.m4])
c0ba06
 
c0ba06
 ################################################################################
c0ba06
 # Determine which libraries are needed for this configuration
c0ba06
@@ -104,6 +105,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
c0ba06
   LIB_SETUP_BUNDLED_LIBS
c0ba06
   LIB_SETUP_MISC_LIBS
c0ba06
   LIB_TESTS_SETUP_GTEST
c0ba06
+  LIB_SETUP_SYSCONF_LIBS
c0ba06
 
c0ba06
   BASIC_JDKLIB_LIBS=""
c0ba06
   if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then
c0ba06
diff --git openjdk/make/autoconf/spec.gmk.in openjdk/make/autoconf/spec.gmk.in
c0ba06
index 29445c8c24f..9b1b512a34a 100644
c0ba06
--- openjdk/make/autoconf/spec.gmk.in
c0ba06
+++ openjdk/make/autoconf/spec.gmk.in
c0ba06
@@ -834,6 +834,10 @@ INSTALL_SYSCONFDIR=@sysconfdir@
c0ba06
 # Libraries
c0ba06
 #
c0ba06
 
c0ba06
+USE_SYSCONF_NSS:=@USE_SYSCONF_NSS@
c0ba06
+NSS_LIBS:=@NSS_LIBS@
c0ba06
+NSS_CFLAGS:=@NSS_CFLAGS@
c0ba06
+
c0ba06
 USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@
c0ba06
 LCMS_CFLAGS:=@LCMS_CFLAGS@
c0ba06
 LCMS_LIBS:=@LCMS_LIBS@
c0ba06
diff --git openjdk/make/modules/java.base/Lib.gmk openjdk/make/modules/java.base/Lib.gmk
c0ba06
index 5658ff342e5..cb7a56852f7 100644
c0ba06
--- openjdk/make/modules/java.base/Lib.gmk
c0ba06
+++ openjdk/make/modules/java.base/Lib.gmk
c0ba06
@@ -167,6 +167,31 @@ ifeq ($(call isTargetOsType, unix), true)
c0ba06
   endif
c0ba06
 endif
c0ba06
 
c0ba06
+################################################################################
c0ba06
+# Create the systemconf library
c0ba06
+
c0ba06
+LIBSYSTEMCONF_CFLAGS :=
c0ba06
+LIBSYSTEMCONF_CXXFLAGS :=
c0ba06
+
c0ba06
+ifeq ($(USE_SYSCONF_NSS), true)
c0ba06
+  LIBSYSTEMCONF_CFLAGS += $(NSS_CFLAGS) -DSYSCONF_NSS
c0ba06
+  LIBSYSTEMCONF_CXXFLAGS += $(NSS_CFLAGS) -DSYSCONF_NSS
c0ba06
+endif
c0ba06
+
c0ba06
+ifeq ($(OPENJDK_BUILD_OS), linux)
c0ba06
+  $(eval $(call SetupJdkLibrary, BUILD_LIBSYSTEMCONF, \
c0ba06
+      NAME := systemconf, \
c0ba06
+      OPTIMIZATION := LOW, \
c0ba06
+      CFLAGS := $(CFLAGS_JDKLIB) $(LIBSYSTEMCONF_CFLAGS), \
c0ba06
+      CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBSYSTEMCONF_CXXFLAGS), \
c0ba06
+      LDFLAGS := $(LDFLAGS_JDKLIB) \
c0ba06
+          $(call SET_SHARED_LIBRARY_ORIGIN), \
c0ba06
+      LIBS_unix := $(LIBDL) $(NSS_LIBS), \
c0ba06
+  ))
c0ba06
+
c0ba06
+  TARGETS += $(BUILD_LIBSYSTEMCONF)
c0ba06
+endif
c0ba06
+
c0ba06
 ################################################################################
c0ba06
 # Create the symbols file for static builds.
c0ba06
 
c0ba06
diff --git openjdk/src/java.base/linux/native/libsystemconf/systemconf.c openjdk/src/java.base/linux/native/libsystemconf/systemconf.c
c0ba06
new file mode 100644
c0ba06
index 00000000000..6f4656bfcb6
c0ba06
--- /dev/null
c0ba06
+++ openjdk/src/java.base/linux/native/libsystemconf/systemconf.c
c0ba06
@@ -0,0 +1,168 @@
c0ba06
+/*
c0ba06
+ * Copyright (c) 2021, Red Hat, Inc.
c0ba06
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c0ba06
+ *
c0ba06
+ * This code is free software; you can redistribute it and/or modify it
c0ba06
+ * under the terms of the GNU General Public License version 2 only, as
c0ba06
+ * published by the Free Software Foundation.  Oracle designates this
c0ba06
+ * particular file as subject to the "Classpath" exception as provided
c0ba06
+ * by Oracle in the LICENSE file that accompanied this code.
c0ba06
+ *
c0ba06
+ * This code is distributed in the hope that it will be useful, but WITHOUT
c0ba06
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c0ba06
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c0ba06
+ * version 2 for more details (a copy is included in the LICENSE file that
c0ba06
+ * accompanied this code).
c0ba06
+ *
c0ba06
+ * You should have received a copy of the GNU General Public License version
c0ba06
+ * 2 along with this work; if not, write to the Free Software Foundation,
c0ba06
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c0ba06
+ *
c0ba06
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c0ba06
+ * or visit www.oracle.com if you need additional information or have any
c0ba06
+ * questions.
c0ba06
+ */
c0ba06
+
c0ba06
+#include <dlfcn.h>
c0ba06
+#include <jni.h>
c0ba06
+#include <jni_util.h>
c0ba06
+#include <stdio.h>
c0ba06
+
c0ba06
+#ifdef SYSCONF_NSS
c0ba06
+#include <nss3/pk11pub.h>
c0ba06
+#endif //SYSCONF_NSS
c0ba06
+
c0ba06
+#include "java_security_SystemConfigurator.h"
c0ba06
+
c0ba06
+#define FIPS_ENABLED_PATH "/proc/sys/crypto/fips_enabled"
c0ba06
+#define MSG_MAX_SIZE 96
c0ba06
+
c0ba06
+static jmethodID debugPrintlnMethodID = NULL;
c0ba06
+static jobject debugObj = NULL;
c0ba06
+
c0ba06
+static void throwIOException(JNIEnv *env, const char *msg);
c0ba06
+static void dbgPrint(JNIEnv *env, const char* msg);
c0ba06
+
c0ba06
+/*
c0ba06
+ * Class:     java_security_SystemConfigurator
c0ba06
+ * Method:    JNI_OnLoad
c0ba06
+ */
c0ba06
+JNIEXPORT jint JNICALL DEF_JNI_OnLoad(JavaVM *vm, void *reserved)
c0ba06
+{
c0ba06
+    JNIEnv *env;
c0ba06
+    jclass sysConfCls, debugCls;
c0ba06
+    jfieldID sdebugFld;
c0ba06
+
c0ba06
+    if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_2) != JNI_OK) {
c0ba06
+        return JNI_EVERSION; /* JNI version not supported */
c0ba06
+    }
c0ba06
+
c0ba06
+    sysConfCls = (*env)->FindClass(env,"java/security/SystemConfigurator");
c0ba06
+    if (sysConfCls == NULL) {
c0ba06
+        printf("libsystemconf: SystemConfigurator class not found\n");
c0ba06
+        return JNI_ERR;
c0ba06
+    }
c0ba06
+    sdebugFld = (*env)->GetStaticFieldID(env, sysConfCls,
c0ba06
+            "sdebug", "Lsun/security/util/Debug;");
c0ba06
+    if (sdebugFld == NULL) {
c0ba06
+        printf("libsystemconf: SystemConfigurator::sdebug field not found\n");
c0ba06
+        return JNI_ERR;
c0ba06
+    }
c0ba06
+    debugObj = (*env)->GetStaticObjectField(env, sysConfCls, sdebugFld);
c0ba06
+    if (debugObj != NULL) {
c0ba06
+        debugCls = (*env)->FindClass(env,"sun/security/util/Debug");
c0ba06
+        if (debugCls == NULL) {
c0ba06
+            printf("libsystemconf: Debug class not found\n");
c0ba06
+            return JNI_ERR;
c0ba06
+        }
c0ba06
+        debugPrintlnMethodID = (*env)->GetMethodID(env, debugCls,
c0ba06
+                "println", "(Ljava/lang/String;)V");
c0ba06
+        if (debugPrintlnMethodID == NULL) {
c0ba06
+            printf("libsystemconf: Debug::println(String) method not found\n");
c0ba06
+            return JNI_ERR;
c0ba06
+        }
c0ba06
+        debugObj = (*env)->NewGlobalRef(env, debugObj);
c0ba06
+    }
c0ba06
+
c0ba06
+    return (*env)->GetVersion(env);
c0ba06
+}
c0ba06
+
c0ba06
+/*
c0ba06
+ * Class:     java_security_SystemConfigurator
c0ba06
+ * Method:    JNI_OnUnload
c0ba06
+ */
c0ba06
+JNIEXPORT void JNICALL DEF_JNI_OnUnload(JavaVM *vm, void *reserved)
c0ba06
+{
c0ba06
+    JNIEnv *env;
c0ba06
+
c0ba06
+    if (debugObj != NULL) {
c0ba06
+        if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_2) != JNI_OK) {
c0ba06
+            return; /* Should not happen */
c0ba06
+        }
c0ba06
+        (*env)->DeleteGlobalRef(env, debugObj);
c0ba06
+    }
c0ba06
+}
c0ba06
+
c0ba06
+JNIEXPORT jboolean JNICALL Java_java_security_SystemConfigurator_getSystemFIPSEnabled
c0ba06
+  (JNIEnv *env, jclass cls)
c0ba06
+{
c0ba06
+    int fips_enabled;
c0ba06
+    char msg[MSG_MAX_SIZE];
c0ba06
+    int msg_bytes;
c0ba06
+
c0ba06
+#ifdef SYSCONF_NSS
c0ba06
+
c0ba06
+    dbgPrint(env, "getSystemFIPSEnabled: calling SECMOD_GetSystemFIPSEnabled");
c0ba06
+    fips_enabled = SECMOD_GetSystemFIPSEnabled();
c0ba06
+    msg_bytes = snprintf(msg, MSG_MAX_SIZE, "getSystemFIPSEnabled:" \
c0ba06
+            " SECMOD_GetSystemFIPSEnabled returned 0x%x", fips_enabled);
c0ba06
+    if (msg_bytes > 0 && msg_bytes < MSG_MAX_SIZE) {
c0ba06
+        dbgPrint(env, msg);
c0ba06
+    } else {
c0ba06
+        dbgPrint(env, "getSystemFIPSEnabled: cannot render" \
c0ba06
+                " SECMOD_GetSystemFIPSEnabled return value");
c0ba06
+    }
c0ba06
+    return (fips_enabled == 1 ? JNI_TRUE : JNI_FALSE);
c0ba06
+
c0ba06
+#else // SYSCONF_NSS
c0ba06
+
c0ba06
+    FILE *fe;
c0ba06
+
c0ba06
+    dbgPrint(env, "getSystemFIPSEnabled: reading " FIPS_ENABLED_PATH);
c0ba06
+    if ((fe = fopen(FIPS_ENABLED_PATH, "r")) == NULL) {
c0ba06
+        throwIOException(env, "Cannot open " FIPS_ENABLED_PATH);
c0ba06
+    }
c0ba06
+    fips_enabled = fgetc(fe);
c0ba06
+    fclose(fe);
c0ba06
+    if (fips_enabled == EOF) {
c0ba06
+        throwIOException(env, "Cannot read " FIPS_ENABLED_PATH);
c0ba06
+    }
c0ba06
+    msg_bytes = snprintf(msg, MSG_MAX_SIZE, "getSystemFIPSEnabled:" \
c0ba06
+            " read character is '%c'", fips_enabled);
c0ba06
+    if (msg_bytes > 0 && msg_bytes < MSG_MAX_SIZE) {
c0ba06
+        dbgPrint(env, msg);
c0ba06
+    } else {
c0ba06
+        dbgPrint(env, "getSystemFIPSEnabled: cannot render" \
c0ba06
+                " read character");
c0ba06
+    }
c0ba06
+    return (fips_enabled == '1' ? JNI_TRUE : JNI_FALSE);
c0ba06
+
c0ba06
+#endif // SYSCONF_NSS
c0ba06
+}
c0ba06
+
c0ba06
+static void throwIOException(JNIEnv *env, const char *msg)
c0ba06
+{
c0ba06
+    jclass cls = (*env)->FindClass(env, "java/io/IOException");
c0ba06
+    if (cls != 0)
c0ba06
+        (*env)->ThrowNew(env, cls, msg);
c0ba06
+}
c0ba06
+
c0ba06
+static void dbgPrint(JNIEnv *env, const char* msg)
c0ba06
+{
c0ba06
+    jstring jMsg;
c0ba06
+    if (debugObj != NULL) {
c0ba06
+        jMsg = (*env)->NewStringUTF(env, msg);
c0ba06
+        CHECK_NULL(jMsg);
c0ba06
+        (*env)->CallVoidMethod(env, debugObj, debugPrintlnMethodID, jMsg);
c0ba06
+    }
c0ba06
+}
c0ba06
diff --git openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java
c0ba06
index 10b54aa4ce4..6aa1419dfd0 100644
c0ba06
--- openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java
c0ba06
+++ openjdk/src/java.base/share/classes/java/security/SystemConfigurator.java
c0ba06
@@ -1,5 +1,5 @@
c0ba06
 /*
c0ba06
- * Copyright (c) 2019, 2020, Red Hat, Inc.
c0ba06
+ * Copyright (c) 2019, 2021, Red Hat, Inc.
c0ba06
  *
c0ba06
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c0ba06
  *
c0ba06
@@ -30,13 +30,9 @@ import java.io.BufferedInputStream;
c0ba06
 import java.io.FileInputStream;
c0ba06
 import java.io.IOException;
c0ba06
 
c0ba06
-import java.nio.file.Files;
c0ba06
-import java.nio.file.Path;
c0ba06
-
c0ba06
 import java.util.Iterator;
c0ba06
 import java.util.Map.Entry;
c0ba06
 import java.util.Properties;
c0ba06
-import java.util.regex.Pattern;
c0ba06
 
c0ba06
 import sun.security.util.Debug;
c0ba06
 
c0ba06
@@ -58,11 +54,23 @@ final class SystemConfigurator {
c0ba06
     private static final String CRYPTO_POLICIES_JAVA_CONFIG =
c0ba06
             CRYPTO_POLICIES_BASE_DIR + "/back-ends/java.config";
c0ba06
 
c0ba06
-    private static final String CRYPTO_POLICIES_CONFIG =
c0ba06
-            CRYPTO_POLICIES_BASE_DIR + "/config";
c0ba06
-
c0ba06
     private static boolean systemFipsEnabled = false;
c0ba06
 
c0ba06
+    private static final String SYSTEMCONF_NATIVE_LIB = "systemconf";
c0ba06
+
c0ba06
+    private static native boolean getSystemFIPSEnabled()
c0ba06
+            throws IOException;
c0ba06
+
c0ba06
+    static {
c0ba06
+        @SuppressWarnings("removal")
c0ba06
+        var dummy = AccessController.doPrivileged(new PrivilegedAction<Void>() {
c0ba06
+            public Void run() {
c0ba06
+                System.loadLibrary(SYSTEMCONF_NATIVE_LIB);
c0ba06
+                return null;
c0ba06
+            }
c0ba06
+        });
c0ba06
+    }
c0ba06
+
c0ba06
     /*
c0ba06
      * Invoked when java.security.Security class is initialized, if
c0ba06
      * java.security.disableSystemPropertiesFile property is not set and
c0ba06
@@ -170,16 +178,34 @@ final class SystemConfigurator {
c0ba06
     }
c0ba06
 
c0ba06
     /*
c0ba06
-     * FIPS is enabled only if crypto-policies are set to "FIPS"
c0ba06
-     * and the com.redhat.fips property is true.
c0ba06
+     * OpenJDK FIPS mode will be enabled only if the com.redhat.fips
c0ba06
+     * system property is true (default) and the system is in FIPS mode.
c0ba06
+     *
c0ba06
+     * There are 2 possible ways in which OpenJDK detects that the system
c0ba06
+     * is in FIPS mode: 1) if the NSS SECMOD_GetSystemFIPSEnabled API is
c0ba06
+     * available at OpenJDK's built-time, it is called; 2) otherwise, the
c0ba06
+     * /proc/sys/crypto/fips_enabled file is read.
c0ba06
      */
c0ba06
     private static boolean enableFips() throws Exception {
c0ba06
         boolean shouldEnable = Boolean.valueOf(System.getProperty("com.redhat.fips", "true"));
c0ba06
         if (shouldEnable) {
c0ba06
-            String cryptoPoliciesConfig = new String(Files.readAllBytes(Path.of(CRYPTO_POLICIES_CONFIG)));
c0ba06
-            if (sdebug != null) { sdebug.println("Crypto config:\n" + cryptoPoliciesConfig); }
c0ba06
-            Pattern pattern = Pattern.compile("^FIPS$", Pattern.MULTILINE);
c0ba06
-            return pattern.matcher(cryptoPoliciesConfig).find();
c0ba06
+            if (sdebug != null) {
c0ba06
+                sdebug.println("Calling getSystemFIPSEnabled (libsystemconf)...");
c0ba06
+            }
c0ba06
+            try {
c0ba06
+                shouldEnable = getSystemFIPSEnabled();
c0ba06
+                if (sdebug != null) {
c0ba06
+                    sdebug.println("Call to getSystemFIPSEnabled (libsystemconf) returned: "
c0ba06
+                            + shouldEnable);
c0ba06
+                }
c0ba06
+                return shouldEnable;
c0ba06
+            } catch (IOException e) {
c0ba06
+                if (sdebug != null) {
c0ba06
+                    sdebug.println("Call to getSystemFIPSEnabled (libsystemconf) failed:");
c0ba06
+                    sdebug.println(e.getMessage());
c0ba06
+                }
c0ba06
+                throw e;
c0ba06
+            }
c0ba06
         } else {
c0ba06
             return false;
c0ba06
         }