Blame SOURCES/pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch

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

Additional default values of security properties are read from a

5b7429
+ * system-specific location, if available.

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