Blame SOURCES/pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch

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

Additional default values of security properties are read from a

2d54fe
+ * system-specific location, if available.

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