Re: [WSS4J] wss4j/src/org/apache/ws/security/util WSSecurityUtil.java,1.13,1.14
[email protected] (Werner Dittmann) Wed, 7 Jan 2004 16:35:04 +0100
| Newsgroups | gmane.text.xml.wss4j |
|---|---|
| Message-ID | <002301c3d533$d324d280$fe78a8c0@nonehome> |
Dims, pls check out latest CVS modifications. Fixed a problem in EnvelopeIdResolver (XPath handling was warong). The other fix was a bung just found during enhanced testinh. btw, I can't run the "ant systemTests"...complains with "classpath.library" not found when it tries to start the simple HTTP server. Running Ant 1.5.3. Regards, Werner ----- Original Message ----- From: "Davanum Srinivas" <dims-/[email protected]> To: <[email protected]>; <[email protected]> Sent: Wednesday, January 07, 2004 5:56 AM Subject: Re: [WSS4J] wss4j/src/org/apache/ws/security/util WSSecurityUtil.java,1.13,1.14 > Werner, > > testScenario5 fails :( > > WSDoAllSender: Signature: error during message > procesingorg.apache.xml.security.signature.XMLSignatureException: Prefix must resolve to a > namespace: Original Exception was > org.apache.xml.security.signature.ReferenceNotInitializedException: Prefix must resolve to a > namespace: Original Exception was > org.apache.xml.security.signature.ReferenceNotInitializedException: Prefix must resolve to a > namespace: Original Exception was > org.apache.xml.security.signature.ReferenceNotInitializedException: Prefix must resolve to a > namespace: Original Exception was > org.apache.xml.security.utils.resolver.ResourceResolverException: Prefix must resolve to a > namespace: Original Exception was javax.xml.transform.TransformerException: Prefix must resolve to > a namespace: > > thanks, > dims > > --- [email protected] wrote: > > Update of /cvsroot/wss4j/wss4j/src/org/apache/ws/security/util > > In directory sc8-pr-cvs1:/tmp/cvs-serv24603/src/org/apache/ws/security/util > > > > Modified Files: > > WSSecurityUtil.java > > Log Message: > > Replace the recursive findElement code with a depth-first loop > > (no recursion required). > > > > Index: WSSecurityUtil.java > > =================================================================== > > RCS file: /cvsroot/wss4j/wss4j/src/org/apache/ws/security/util/WSSecurityUtil.java,v > > retrieving revision 1.13 > > retrieving revision 1.14 > > diff -C2 -d -r1.13 -r1.14 > > *** WSSecurityUtil.java 22 Dec 2003 13:36:29 -0000 1.13 > > --- WSSecurityUtil.java 2 Jan 2004 12:15:49 -0000 1.14 > > *************** > > *** 160,170 **** > > * not deal with prefixes, just with the real namespace URI > > * > > ! * @param node Where to start the search > > * @param name Local name of the element > > * @param namespace Namespace URI of the element > > * @return The found element or <code>null</code> > > */ > > ! public static Node findElement(Node node, String name, String namespace) { > > > > if (node.getNodeType() != Node.ELEMENT_NODE) { > > return null; > > --- 160,218 ---- > > * not deal with prefixes, just with the real namespace URI > > * > > ! * @param startNode Where to start the search > > * @param name Local name of the element > > * @param namespace Namespace URI of the element > > * @return The found element or <code>null</code> > > */ > > ! public static Node findElement(Node startNode, String name, String namespace) { > > > > + /* > > + * Replace the formely recursive implementation > > + * with a depth-first-loop lookup > > + */ > > + if (startNode == null) { > > + return null; > > + } > > + Node startParent = startNode.getParentNode(); > > + Node processedNode = null; > > + > > + while (startNode != null) { > > + // start node processing at this point > > + if (startNode.getNodeType() == Node.ELEMENT_NODE > > + && startNode.getLocalName().equals(name)) { > > + String ns = startNode.getNamespaceURI(); > > + if (ns != null && ns.equals(namespace)) { > > + return startNode; > > + } > > + > > + if ((namespace == null || namespace.length() == 0) > > + && (ns == null || ns.length() == 0)) { > > + return startNode; > > + } > > + } > > + processedNode = startNode; > > + startNode = startNode.getFirstChild(); > > + > > + // no child, this node is done. > > + if (startNode == null) { > > + // close node processing, get sibling > > + startNode = processedNode.getNextSibling(); > > + } > > + // no more siblings, get parent, all children > > + // of parent are processed. > > + while (startNode == null) { > > + processedNode = processedNode.getParentNode(); > > + if (processedNode == startParent) { > > + return null; > > + } > > + // close parent node processing (processed node now) > > + startNode = processedNode.getNextSibling(); > > + } > > + } > > + return null; > > + > > + /* > > + * Replace the recursive implementation with a depth-first lookup loop > > + > > if (node.getNodeType() != Node.ELEMENT_NODE) { > > return null; > > *************** > > *** 197,200 **** > > --- 245,249 ---- > > } > > return found; > > + */ > > } > > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: IBM Linux Tutorials. > > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > > _______________________________________________ > > wss4j-devel mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/wss4j-devel > > > ===== > Davanum Srinivas - http://webservices.apache.org/~dims/ > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > wss4j-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/wss4j-devel ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html