Blame SOURCES/pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch

ecab97
ecab97
# HG changeset patch
ecab97
# User andrew
ecab97
# Date 1478057514 0
ecab97
# Node ID 1c4d5cb2096ae55106111da200b0bcad304f650c
ecab97
# Parent  3d53f19b48384e5252f4ec8891f7a3a82d77af2a
ecab97
PR3183: Support Fedora/RHEL system crypto policy
ecab97
ecab97
diff -r 3d53f19b4838 -r 1c4d5cb2096a src/share/classes/java/security/Security.java
ecab97
--- openjdk/jdk/src/share/classes/java/security/Security.java	Wed Oct 26 03:51:39 2016 +0100
ecab97
+++ openjdk/jdk/src/share/classes/java/security/Security.java	Wed Nov 02 03:31:54 2016 +0000
ecab97
@@ -43,6 +43,9 @@
ecab97
  * implementation-specific location, which is typically the properties file
ecab97
  * {@code lib/security/java.security} in the Java installation directory.
ecab97
  *
ecab97
+ * 

Additional default values of security properties are read from a

ecab97
+ * system-specific location, if available.

ecab97
+ *
ecab97
  * @author Benjamin Renaud
ecab97
  */
ecab97
 
ecab97
@@ -52,6 +55,10 @@
ecab97
     private static final Debug sdebug =
ecab97
                         Debug.getInstance("properties");
ecab97
 
ecab97
+    /* System property file*/
ecab97
+    private static final String SYSTEM_PROPERTIES =
ecab97
+        "/etc/crypto-policies/back-ends/java.config";
ecab97
+
ecab97
     /* The java.security properties */
ecab97
     private static Properties props;
ecab97
 
ecab97
@@ -93,6 +100,7 @@
ecab97
                 if (sdebug != null) {
ecab97
                     sdebug.println("reading security properties file: " +
ecab97
                                 propFile);
ecab97
+                    sdebug.println(props.toString());
ecab97
                 }
ecab97
             } catch (IOException e) {
ecab97
                 if (sdebug != null) {
ecab97
@@ -114,6 +122,31 @@
ecab97
         }
ecab97
 
ecab97
         if ("true".equalsIgnoreCase(props.getProperty
ecab97
+                ("security.useSystemPropertiesFile"))) {
ecab97
+
ecab97
+            // now load the system file, if it exists, so its values
ecab97
+            // will win if they conflict with the earlier values
ecab97
+            try (BufferedInputStream bis =
ecab97
+                 new BufferedInputStream(new FileInputStream(SYSTEM_PROPERTIES))) {
ecab97
+                props.load(bis);
ecab97
+                loadedProps = true;
ecab97
+
ecab97
+                if (sdebug != null) {
ecab97
+                    sdebug.println("reading system security properties file " +
ecab97
+                                   SYSTEM_PROPERTIES);
ecab97
+                    sdebug.println(props.toString());
ecab97
+                }
ecab97
+            } catch (IOException e) {
ecab97
+                if (sdebug != null) {
ecab97
+                    sdebug.println
ecab97
+                        ("unable to load security properties from " +
ecab97
+                         SYSTEM_PROPERTIES);
ecab97
+                    e.printStackTrace();
ecab97
+                }
ecab97
+            }
ecab97
+        }
ecab97
+
ecab97
+        if ("true".equalsIgnoreCase(props.getProperty
ecab97
                 ("security.overridePropertiesFile"))) {
ecab97
 
ecab97
             String extraPropFile = System.getProperty
ecab97
diff -r 3d53f19b4838 -r 1c4d5cb2096a src/share/lib/security/java.security-aix
ecab97
--- openjdk/jdk/src/share/lib/security/java.security-aix	Wed Oct 26 03:51:39 2016 +0100
ecab97
+++ openjdk/jdk/src/share/lib/security/java.security-aix	Wed Nov 02 03:31:54 2016 +0000
ecab97
@@ -276,6 +276,13 @@
ecab97
 security.overridePropertiesFile=true
ecab97
 
ecab97
 #
ecab97
+# Determines whether this properties file will be appended to
ecab97
+# using the system properties file stored at
ecab97
+# /etc/crypto-policies/back-ends/java.config
ecab97
+#
ecab97
+security.useSystemPropertiesFile=false
ecab97
+
ecab97
+#
ecab97
 # Determines the default key and trust manager factory algorithms for
ecab97
 # the javax.net.ssl package.
ecab97
 #
ecab97
diff -r 3d53f19b4838 -r 1c4d5cb2096a src/share/lib/security/java.security-linux
ecab97
--- openjdk/jdk/src/share/lib/security/java.security-linux	Wed Oct 26 03:51:39 2016 +0100
ecab97
+++ openjdk/jdk/src/share/lib/security/java.security-linux	Wed Nov 02 03:31:54 2016 +0000
ecab97
@@ -276,6 +276,13 @@
ecab97
 security.overridePropertiesFile=true
ecab97
 
ecab97
 #
ecab97
+# Determines whether this properties file will be appended to
ecab97
+# using the system properties file stored at
ecab97
+# /etc/crypto-policies/back-ends/java.config
ecab97
+#
ecab97
+security.useSystemPropertiesFile=true
ecab97
+
ecab97
+#
ecab97
 # Determines the default key and trust manager factory algorithms for
ecab97
 # the javax.net.ssl package.
ecab97
 #
ecab97
diff -r 3d53f19b4838 -r 1c4d5cb2096a src/share/lib/security/java.security-macosx
ecab97
--- openjdk/jdk/src/share/lib/security/java.security-macosx	Wed Oct 26 03:51:39 2016 +0100
ecab97
+++ openjdk/jdk/src/share/lib/security/java.security-macosx	Wed Nov 02 03:31:54 2016 +0000
ecab97
@@ -279,6 +279,13 @@
ecab97
 security.overridePropertiesFile=true
ecab97
 
ecab97
 #
ecab97
+# Determines whether this properties file will be appended to
ecab97
+# using the system properties file stored at
ecab97
+# /etc/crypto-policies/back-ends/java.config
ecab97
+#
ecab97
+security.useSystemPropertiesFile=false
ecab97
+
ecab97
+#
ecab97
 # Determines the default key and trust manager factory algorithms for
ecab97
 # the javax.net.ssl package.
ecab97
 #
ecab97
diff -r 3d53f19b4838 -r 1c4d5cb2096a src/share/lib/security/java.security-solaris
ecab97
--- openjdk/jdk/src/share/lib/security/java.security-solaris	Wed Oct 26 03:51:39 2016 +0100
ecab97
+++ openjdk/jdk/src/share/lib/security/java.security-solaris	Wed Nov 02 03:31:54 2016 +0000
ecab97
@@ -278,6 +278,13 @@
ecab97
 security.overridePropertiesFile=true
ecab97
 
ecab97
 #
ecab97
+# Determines whether this properties file will be appended to
ecab97
+# using the system properties file stored at
ecab97
+# /etc/crypto-policies/back-ends/java.config
ecab97
+#
ecab97
+security.useSystemPropertiesFile=false
ecab97
+
ecab97
+#
ecab97
 # Determines the default key and trust manager factory algorithms for
ecab97
 # the javax.net.ssl package.
ecab97
 #
ecab97
diff -r 3d53f19b4838 -r 1c4d5cb2096a src/share/lib/security/java.security-windows
ecab97
--- openjdk/jdk/src/share/lib/security/java.security-windows	Wed Oct 26 03:51:39 2016 +0100
ecab97
+++ openjdk/jdk/src/share/lib/security/java.security-windows	Wed Nov 02 03:31:54 2016 +0000
ecab97
@@ -279,6 +279,13 @@
ecab97
 security.overridePropertiesFile=true
ecab97
 
ecab97
 #
ecab97
+# Determines whether this properties file will be appended to
ecab97
+# using the system properties file stored at
ecab97
+# /etc/crypto-policies/back-ends/java.config
ecab97
+#
ecab97
+security.useSystemPropertiesFile=false
ecab97
+
ecab97
+#
ecab97
 # Determines the default key and trust manager factory algorithms for
ecab97
 # the javax.net.ssl package.
ecab97
 #
ecab97