Blame SOURCES/pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch

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

Additional default values of security properties are read from a

53c576
+ * system-specific location, if available.

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