diff --git a/fips.patch b/fips.patch index 4ec8c23..ef10bb9 100644 --- a/fips.patch +++ b/fips.patch @@ -221,7 +221,7 @@ + *; +}; --- openjdk/jdk/src/share/classes/java/security/Security.java 2021-12-04 07:42:43.693823344 +0100 -+++ openjdk/jdk/src/share/classes/java/security/Security.java 2021-12-04 07:43:01.281927857 +0100 ++++ openjdk/jdk/src/share/classes/java/security/Security.java 2021-12-04 10:17:29.503072332 +0100 @@ -30,6 +30,8 @@ import java.util.concurrent.ConcurrentHashMap; import java.io.*; @@ -247,17 +247,23 @@ // doPrivileged here because there are multiple // things in initialize that might require privs. // (the FileInputStream call and the File.exists call, -@@ -191,27 +202,7 @@ - if (disableSystemProps == null && - "true".equalsIgnoreCase(props.getProperty - ("security.useSystemPropertiesFile"))) { +@@ -188,29 +199,10 @@ + } + + String disableSystemProps = System.getProperty("java.security.disableSystemPropertiesFile"); +- if (disableSystemProps == null && +- "true".equalsIgnoreCase(props.getProperty +- ("security.useSystemPropertiesFile"))) { - - // now load the system file, if it exists, so its values - // will win if they conflict with the earlier values - try (BufferedInputStream bis = - new BufferedInputStream(new FileInputStream(SYSTEM_PROPERTIES))) { - props.load(bis); -- loadedProps = true; ++ if ((disableSystemProps == null || "false".equalsIgnoreCase(disableSystemProps)) && ++ "true".equalsIgnoreCase(props.getProperty("security.useSystemPropertiesFile"))) { ++ if (SystemConfigurator.configure(props)) { + loadedProps = true; - - if (sdebug != null) { - sdebug.println("reading system security properties file " + @@ -271,14 +277,12 @@ - SYSTEM_PROPERTIES); - e.printStackTrace(); - } -- } -+ loadedProps = loadedProps && SystemConfigurator.configure(props); + } } - if (!loadedProps) { --- openjdk/jdk/src/share/classes/java/security/SystemConfigurator.java 1970-01-01 01:00:00.000000000 +0100 -+++ openjdk/jdk/src/share/classes/java/security/SystemConfigurator.java 2021-12-04 07:51:03.584923406 +0100 -@@ -0,0 +1,223 @@ ++++ openjdk/jdk/src/share/classes/java/security/SystemConfigurator.java 2021-12-04 10:17:58.159258084 +0100 +@@ -0,0 +1,212 @@ +/* + * Copyright (c) 2019, 2021, Red Hat, Inc. + * @@ -309,7 +313,6 @@ + +import java.io.BufferedInputStream; +import java.io.FileInputStream; -+import java.io.FileNotFoundException; +import java.io.IOException; + +import java.util.Iterator; @@ -370,16 +373,6 @@ + CRYPTO_POLICIES_JAVA_CONFIG); + sdebug.println(props.toString()); + } -+ } catch (FileNotFoundException exc) { -+ if (sdebug != null) { -+ sdebug.println("unable to find security properties file " + -+ CRYPTO_POLICIES_JAVA_CONFIG); -+ exc.printStackTrace(); -+ } -+ /* We should already have the props from our java.security file -+ loaded. When not finding system file, we use them instead of -+ loading static defaults. */ -+ loadedProps = true; + } catch (IOException e) { + if (sdebug != null) { + sdebug.println("unable to load security properties from " +