changeset 3952:85ccd221280b

6994263: Untrusted code can replace JRE's XML DSig Transform or C14N algorithm implementations Reviewed-by: xuelei
author mullan
date Mon, 01 Nov 2010 11:32:50 -0400
parents 3dabb2f78e73
children cc989209cbf1
files src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java	Sat Oct 30 00:24:45 2010 +0400
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java	Mon Nov 01 11:32:50 2010 -0400
@@ -210,6 +210,8 @@
     public static void init() {
         if (!alreadyInitialized) {
             transformClassHash = new HashMap(10);
+            // make sure builtin algorithms are all registered first
+            com.sun.org.apache.xml.internal.security.Init.init();
             alreadyInitialized = true;
         }
     }
@@ -236,12 +238,7 @@
                "algorithm.alreadyRegistered", exArgs);
         }
 
-        ClassLoader cl = (ClassLoader) AccessController.doPrivileged(
-            new PrivilegedAction() {
-                public Object run() {
-                    return Thread.currentThread().getContextClassLoader();
-                }
-            });
+        ClassLoader cl = Thread.currentThread().getContextClassLoader();
 
         try {
             transformClassHash.put