changeset 7165:5dbdcd0de09e

Merge
author asaha
date Tue, 18 Mar 2014 13:02:08 -0700
parents f7340a27b42c 88f1bf248cc5
children 579a5ce5a5c9 f0f5f7e38090
files .hgtags
diffstat 2 files changed, 31 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Mar 12 14:50:21 2014 -0700
+++ b/.hgtags	Tue Mar 18 13:02:08 2014 -0700
@@ -384,6 +384,8 @@
 d19a89fdfb9b959b8638441d9d396685d6c7ab7b jdk7u51-b13
 ef58b2b9a9a1e1a42b0139b57816a160c4681371 jdk7u51-b30
 5bca0d0969b13b1d9b8caba3cce8293a98d68318 jdk7u51-b31
+e9143dc3dc2a8f4b896e74f70d6c503d73c40533 jdk7u51-b33
+c1eaf405fb8d7beddd75c6f81671970f6baa70d8 jdk7u51-b34
 f5eee4f1d5b4a1e19febc9c26c863ae853ed6d2e jdk7u55-b00
 5010db5b9b5ab07a9409a5c557d3f43ab32dc428 jdk7u55-b01
 2ca3e1fa4455ad564228ad6e654498167af2f20d jdk7u55-b02
@@ -398,6 +400,7 @@
 b231536550067c3b00c77d0e035afe8faaa15581 jdk7u55-b10
 2d80b7cd7aae76f0909a210414317dcf846ad651 jdk7u55-b11
 07be5d5508733ed37c11fcd21a13ae3c8288313b jdk7u55-b12
+92fd166252c2701092a510002f4cf9285a20473d jdk7u55-b13
 db5a29c812ee25c34ce9cd97de6e0dae284a4e34 jdk7u60-b00
 def34c4a798678c424786a8f0d0508e90185958d jdk7u60-b01
 ff67c89658525e8903fb870861ed3645befd6bc5 jdk7u60-b02
--- a/src/share/classes/sun/security/provider/SeedGenerator.java	Wed Mar 12 14:50:21 2014 -0700
+++ b/src/share/classes/sun/security/provider/SeedGenerator.java	Tue Mar 18 13:02:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -173,8 +173,8 @@
                             md.update(p.getProperty(s).getBytes());
                         }
 
-                        md.update
-                            (InetAddress.getLocalHost().toString().getBytes());
+                        // Include network adapter names (and a Mac address)
+                        addNetworkAdapterInfo(md);
 
                         // The temporary dir
                         File f = new File(p.getProperty("java.io.tmpdir"));
@@ -212,6 +212,31 @@
         return md.digest();
     }
 
+    /*
+     * Include network adapter names and, if available, a Mac address
+     *
+     * See also java.util.concurrent.ThreadLocalRandom.initialSeed()
+     */
+    private static void addNetworkAdapterInfo(MessageDigest md) {
+
+        try {
+            Enumeration<NetworkInterface> ifcs =
+                NetworkInterface.getNetworkInterfaces();
+            while (ifcs.hasMoreElements()) {
+                NetworkInterface ifc = ifcs.nextElement();
+                md.update(ifc.toString().getBytes());
+                if (!ifc.isVirtual()) { // skip fake addresses
+                    byte[] bs = ifc.getHardwareAddress();
+                    if (bs != null) {
+                        md.update(bs);
+                        break;
+                    }
+                }
+            }
+        } catch (Exception ignore) {
+        }
+    }
+
     /**
      * Helper function to convert a long into a byte array (least significant
      * byte first).