/hg/release/icedtea6-1.10: PR881: Sign tests (wsse.policy.basic)...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Tue Apr 17 08:57:29 PDT 2012


changeset 182bdaba43ea in /hg/release/icedtea6-1.10
details: http://icedtea.classpath.org/hg/release/icedtea6-1.10?cmd=changeset;node=182bdaba43ea
author: ptisnovs
date: Tue Apr 17 18:57:20 2012 +0200

	PR881: Sign tests (wsse.policy.basic) failures with OpenJDK6


diffstat:

 ChangeLog                    |    7 +
 Makefile.am                  |    3 +-
 NEWS                         |    1 +
 patches/idresolver_fix.patch |  193 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 203 insertions(+), 1 deletions(-)

diffs (236 lines):

diff -r 7b2da3e832e1 -r 182bdaba43ea ChangeLog
--- a/ChangeLog	Fri Mar 09 13:48:15 2012 -0500
+++ b/ChangeLog	Tue Apr 17 18:57:20 2012 +0200
@@ -1,3 +1,10 @@
+2012-04-17  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	PR881: Sign tests (wsse.policy.basic) failures with OpenJDK6
+	* Makefile.am: Updated
+	* patches/idresolver_fix.patch: added patch for a class
+	IdResolver.
+
 2012-03-09  Danesh Dadachanji  <ddadacha at redhat.com>
 
 	* Makefile.am:
diff -r 7b2da3e832e1 -r 182bdaba43ea Makefile.am
--- a/Makefile.am	Fri Mar 09 13:48:15 2012 -0500
+++ b/Makefile.am	Tue Apr 17 18:57:20 2012 +0200
@@ -379,7 +379,8 @@
 	patches/openjdk/7102369-7094468-rmiregistry.patch \
 	patches/openjdk/7103725-ssl_beast_regression.patch \
 	patches/openjdk/6851973-kerberos.patch \
-	patches/openjdk/7091528-javadoc_class_files.patch
+	patches/openjdk/7091528-javadoc_class_files.patch \
+	patches/idresolver_fix.patch
 
 if WITH_ALT_HSBUILD
 ICEDTEA_PATCHES += \
diff -r 7b2da3e832e1 -r 182bdaba43ea NEWS
--- a/NEWS	Fri Mar 09 13:48:15 2012 -0500
+++ b/NEWS	Tue Apr 17 18:57:20 2012 +0200
@@ -12,6 +12,7 @@
 New in release 1.10.7 (2012-XX-XX):
 * Bug fixes
   - PR732: Use xsltproc for bootstrap xslt in place of Xerces/Xalan
+  - PR881: Sign tests (wsse.policy.basic) failures with OpenJDK6
 
 New in release 1.10.6 (2012-02-14):
 
diff -r 7b2da3e832e1 -r 182bdaba43ea patches/idresolver_fix.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/idresolver_fix.patch	Tue Apr 17 18:57:20 2012 +0200
@@ -0,0 +1,194 @@
+--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/IdResolver.java	2012-03-20 20:29:30.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/IdResolver.java	2012-03-20 22:18:41.094309861 +0100
+@@ -26,6 +26,7 @@
+ import org.w3c.dom.Attr;
+ import org.w3c.dom.Document;
+ import org.w3c.dom.Element;
++import org.w3c.dom.NamedNodeMap;
+ import org.w3c.dom.Node;
+ 
+ import java.util.Arrays;
+@@ -175,69 +176,124 @@
+        return null;
+    }
+ 
++    private static java.util.List names;
++    private static int namesLength;
++    static {
++        String namespaces[]={
++            Constants.SignatureSpecNS,
++            EncryptionConstants.EncryptionSpecNS,
++            "http://schemas.xmlsoap.org/soap/security/2000-12",
++            "http://www.w3.org/2002/03/xkms#",
++            "urn:oasis:names:tc:SAML:1.0:assertion",
++            "urn:oasis:names:tc:SAML:1.0:protocol"
++        };
++        names = Arrays.asList(namespaces);
++        namesLength = names.size();
++    }
+ 
+-   static java.util.List names;
+-   static {
+-           String namespaces[]={ Constants.SignatureSpecNS,
+-                           EncryptionConstants.EncryptionSpecNS,
+-                           "http://schemas.xmlsoap.org/soap/security/2000-12",
+-                           "http://www.w3.org/2002/03/xkms#"
+-                   };
+-           names=Arrays.asList(namespaces);
+-   }
+ 
++    private static Element getElementBySearching(Node root,String id) {
++            Element []els=new Element[namesLength + 1];
++            getEl(root,id,els);
++            for (int i=0;i<els.length;i++) {
++                    if (els[i]!=null) {
++                            return els[i];
++                    }
++            }
++            return null;
++    }
+ 
+-   private static Element getElementBySearching(Node root,String id) {
+-           Element []els=new Element[5];
+-           getElementBySearching(root,id,els);
+-           for (int i=0;i<els.length;i++) {
+-                   if (els[i]!=null) {
+-                           return els[i];
+-                   }
+-           }
+-           return null;
++    private static int getEl(Node currentNode,String id,Element []els) {
++        Node sibling=null;
++        Node parentNode=null;
++        do {
++                switch (currentNode.getNodeType()) {
++                case Node.DOCUMENT_FRAGMENT_NODE :
++                case Node.DOCUMENT_NODE :
++                        sibling= currentNode.getFirstChild();
++                        break;
++
++
++                case Node.ELEMENT_NODE :
++                        Element currentElement = (Element) currentNode;
++                        if (isElement(currentElement, id, els)==1)
++                                return 1;
++                        sibling= currentNode.getFirstChild();
++                        if (sibling==null) {
++                            if (parentNode != null) {
++                                        sibling= currentNode.getNextSibling();
++                                    }
++                        } else {
++                                parentNode=currentElement;
++                        }
++                        break;
++        } while (sibling==null  && parentNode!=null) {
++                        sibling=parentNode.getNextSibling();
++                        parentNode=parentNode.getParentNode();
++                        if (!(parentNode instanceof Element)) {
++                                parentNode=null;
++                        }
++                }
++                if (sibling==null)
++                        return 1;
++                currentNode=sibling;
++                sibling=currentNode.getNextSibling();
++        } while(true);
+ 
+-   }
+-   private static int getElementBySearching(Node root,String id,Element []els) {
+-           switch (root.getNodeType()) {
+-           case Node.ELEMENT_NODE:
+-                   Element el=(Element)root;
+-                   if (el.hasAttributes()) {
+-                           int index=names.indexOf(el.getNamespaceURI());
+-                           if (index<0) {
+-                                   index=4;
+-                           }
+-                           if (el.getAttribute("Id").equals(id)) {
+-                                   els[index]=el;
+-                                   if (index==0) {
+-                                           return 1;
+-                                   }
+-                           } else if ( el.getAttribute("id").equals(id) ) {
+-                                   if (index!=2) {
+-                                           index=4;
+-                                   }
+-                                   els[index]=el;
+-                           } else if ( el.getAttribute("ID").equals(id) ) {
+-                                   if (index!=3) {
+-                                           index=4;
+-                                   }
+-                                   els[index]=el;
+-                           } else if ((index==3)&&(
+-                                   el.getAttribute("OriginalRequestID").equals(id) ||
+-                                   el.getAttribute("RequestID").equals(id) ||
+-                                   el.getAttribute("ResponseID" ).equals(id))) {
+-                                   els[3]=el;
+-                           }
+-                   }
+-                case Node.DOCUMENT_NODE:
+-                        Node sibling=root.getFirstChild();
+-                        while (sibling!=null) {
+-                                if (getElementBySearching(sibling,id,els)==1)
++    }
++    private static int isElement(Element el, String id,Element[] els) {
++        if (!el.hasAttributes()) {
++                return 0;
++        }
++        NamedNodeMap ns=el.getAttributes();
++        int elementIndex=names.indexOf(el.getNamespaceURI());
++            elementIndex=(elementIndex<0) ? namesLength : elementIndex;
++        for (int length=ns.getLength(), i=0; i<length; i++) {
++                Attr n=(Attr)ns.item(i);
++                String s=n.getNamespaceURI();
++
++                    int index=s==null ? elementIndex : names.indexOf(n.getNamespaceURI());
++                    index=(index<0) ? namesLength : index;
++                    String name=n.getLocalName();
++                    if (name == null)
++                        name = n.getName();
++                    if (name.length()>2)
++                        continue;
++                    String value=n.getNodeValue();
++                    if (name.charAt(0)=='I') {
++                        char ch=name.charAt(1);
++                        if (ch=='d' && value.equals(id)) {
++                                els[index]=el;
++                                if (index==0) {
+                                         return 1;
+-                                sibling=sibling.getNextSibling();
++                                }
++                        } else if (ch=='D' &&value.endsWith(id)) {
++                                if (index!=3) {
++                                    index=namesLength;
++                                }
++                                els[index]=el;
+                         }
+-           }
+-           return 0;
+-   }
+-
++                    } else if ( "id".equals(name) && value.equals(id) ) {
++                        if (index!=2) {
++                                index=namesLength;
++                        }
++                        els[index]=el;
++                    }
++        }
++        //For an element namespace search for importants
++        if ((elementIndex==3)&&(
++                    el.getAttribute("OriginalRequestID").equals(id) ||
++                    el.getAttribute("RequestID").equals(id) ||
++                    el.getAttribute("ResponseID").equals(id))) {
++                    els[3]=el;
++        } else if ((elementIndex==4)&&(
++                    el.getAttribute("AssertionID").equals(id))) {
++                    els[4]=el;
++        } else if ((elementIndex==5)&&(
++                    el.getAttribute("RequestID").equals(id) ||
++                    el.getAttribute("ResponseID").equals(id))) {
++                    els[5]=el;
++                 }
++        return 0;
++    }
+ }



More information about the distro-pkg-dev mailing list