Blame SOURCES/rh1929465-improve_system_FIPS_detection.patch

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