/hg/release/icedtea6-1.11: PR881: Sign tests (wsse.policy.basic)...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Tue Apr 17 09:01:02 PDT 2012
changeset 16896bd9ecbc in /hg/release/icedtea6-1.11
details: http://icedtea.classpath.org/hg/release/icedtea6-1.11?cmd=changeset;node=16896bd9ecbc
author: ptisnovs
date: Tue Apr 17 19:00:05 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 a134afa67a3f -r 16896bd9ecbc ChangeLog
--- a/ChangeLog Thu Mar 29 18:28:28 2012 +0200
+++ b/ChangeLog Tue Apr 17 19:00:05 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-29 Pavel Tisnovsky <ptisnovs at redhat.com>
* patches/revert-6885123.patch: Removed to fix
diff -r a134afa67a3f -r 16896bd9ecbc Makefile.am
--- a/Makefile.am Thu Mar 29 18:28:28 2012 +0200
+++ b/Makefile.am Tue Apr 17 19:00:05 2012 +0200
@@ -416,7 +416,8 @@
patches/openjdk/7091528-javadoc_class_files.patch \
patches/openjdk/7103725-ssl_beast_regression.patch \
patches/openjdk/7140882-dont-return-booleans-from-methods-returning-pointers.patch \
- patches/openjdk/remove-mimpure-option-to-gcc.patch
+ patches/openjdk/remove-mimpure-option-to-gcc.patch \
+ patches/idresolver_fix.patch
if WITH_RHINO
ICEDTEA_PATCHES += \
diff -r a134afa67a3f -r 16896bd9ecbc NEWS
--- a/NEWS Thu Mar 29 18:28:28 2012 +0200
+++ b/NEWS Tue Apr 17 19:00:05 2012 +0200
@@ -14,6 +14,7 @@
* Bug fixes
- RH789154: javac error messages no longer contain the full path to the offending file:
+ - PR881: Sign tests (wsse.policy.basic) failures with OpenJDK6
New in release 1.11.1 (2012-02-14):
diff -r a134afa67a3f -r 16896bd9ecbc patches/idresolver_fix.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/idresolver_fix.patch Tue Apr 17 19:00:05 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