Blame SOURCES/pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch

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

Additional default values of security properties are read from a

cdbd41
+ * system-specific location, if available.

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