ASF Bugzilla – Attachment 13738 Details for
Bug 32657
Experimental single pass SAX xml signature verification
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
First Version
sax-patch.txt (text/plain), 63.11 KB, created by
Raul Benito
on 2004-12-12 14:10:40 UTC
(
hide
)
Description:
First Version
Filename:
MIME Type:
Creator:
Raul Benito
Created:
2004-12-12 14:10:40 UTC
Size:
63.11 KB
patch
obsolete
>Index: src/org/apache/xml/security/algorithms/Algorithm.java >=================================================================== >RCS file: /home/cvs/xml-security/src/org/apache/xml/security/algorithms/Algorithm.java,v >retrieving revision 1.13 >diff -u -r1.13 Algorithm.java >--- src/org/apache/xml/security/algorithms/Algorithm.java 24 Sep 2004 21:29:34 -0000 1.13 >+++ src/org/apache/xml/security/algorithms/Algorithm.java 30 Nov 2004 21:17:02 -0000 >@@ -58,6 +58,10 @@ > throws XMLSecurityException { > super(element, BaseURI); > } >+ >+ protected Algorithm() { >+ >+ }; > > /** > * Method getAlgorithmURI >Index: src/org/apache/xml/security/algorithms/SignatureAlgorithm.java >=================================================================== >RCS file: /home/cvs/xml-security/src/org/apache/xml/security/algorithms/SignatureAlgorithm.java,v >retrieving revision 1.19 >diff -u -r1.19 SignatureAlgorithm.java >--- src/org/apache/xml/security/algorithms/SignatureAlgorithm.java 25 Sep 2004 19:42:22 -0000 1.19 >+++ src/org/apache/xml/security/algorithms/SignatureAlgorithm.java 30 Nov 2004 21:17:06 -0000 >@@ -163,6 +163,42 @@ > ex); > } > } >+ public SignatureAlgorithm(String algorithm) throws XMLSecurityException { >+ >+ try { >+ String implementingClass = >+ SignatureAlgorithm.getImplementingClass(algorithm); >+ if (log.isDebugEnabled()) >+ log.debug("Create URI \"" + algorithm + "\" class \"" >+ + implementingClass + "\""); >+ >+ this._signatureAlgorithm = >+ (SignatureAlgorithmSpi) Class.forName(implementingClass) >+ .newInstance(); >+ >+ >+ } catch (ClassNotFoundException ex) { >+ Object exArgs[] = { algorithm, ex.getMessage() }; >+ >+ throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, >+ ex); >+ } catch (IllegalAccessException ex) { >+ Object exArgs[] = { algorithm, ex.getMessage() }; >+ >+ throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, >+ ex); >+ } catch (InstantiationException ex) { >+ Object exArgs[] = { algorithm, ex.getMessage() }; >+ >+ throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, >+ ex); >+ } catch (NullPointerException ex) { >+ Object exArgs[] = { algorithm, ex.getMessage() }; >+ >+ throw new RuntimeException("algorithms.NoSuchAlgorithm", >+ ex); >+ } >+ } > > /** > * Proxy method for {@link java.security.Signature#sign()} >Index: src/org/apache/xml/security/c14n/implementations/Canonicalizer20010315.java >=================================================================== >RCS file: /home/cvs/xml-security/src/org/apache/xml/security/c14n/implementations/Canonicalizer20010315.java,v >retrieving revision 1.35 >diff -u -r1.35 Canonicalizer20010315.java >--- src/org/apache/xml/security/c14n/implementations/Canonicalizer20010315.java 18 Nov 2004 22:47:47 -0000 1.35 >+++ src/org/apache/xml/security/c14n/implementations/Canonicalizer20010315.java 30 Nov 2004 21:17:08 -0000 >@@ -97,7 +97,7 @@ > continue; > } > >- Node n=ns.addMappingAndRender(NName,NValue,N); >+ Node n=(Node)ns.addMappingAndRender(NName,NValue,N); > > if (n!=null) { > //Render the ns definition >@@ -227,7 +227,7 @@ > //ns.addInclusiveMapping(NName,NValue,N,isRealVisible); > if (this._xpathNodeSet.contains(N)) { > //The xpath select this node output it if needed. >- Node n=ns.addMappingAndRenderXNodeSet(NName,NValue,N,isRealVisible); >+ Node n=(Node)ns.addMappingAndRenderXNodeSet(NName,NValue,N,isRealVisible); > if (n!=null) { > result.add(n); > if (C14nHelper.namespaceIsRelative(N)) { >@@ -244,11 +244,11 @@ > Node n=null; > if (xmlns == null) { > //No xmlns def just get the already defined. >- n=ns.getMapping(XMLNS); >+ n=(Node)ns.getMapping(XMLNS); > } else if ( !this._xpathNodeSet.contains(xmlns)) { > //There is a definition but the xmlns is not selected by the xpath. > //then xmlns="" >- n=ns.addMappingAndRenderXNodeSet(XMLNS,"",nullNode,true); >+ n=(Node)ns.addMappingAndRenderXNodeSet(XMLNS,"",nullNode,true); > } > //output the xmlns def if needed. > if (n!=null) { >Index: src/org/apache/xml/security/c14n/implementations/Canonicalizer20010315Excl.java >=================================================================== >RCS file: /home/cvs/xml-security/src/org/apache/xml/security/c14n/implementations/Canonicalizer20010315Excl.java,v >retrieving revision 1.18 >diff -u -r1.18 Canonicalizer20010315Excl.java >--- src/org/apache/xml/security/c14n/implementations/Canonicalizer20010315Excl.java 18 Nov 2004 22:50:26 -0000 1.18 >+++ src/org/apache/xml/security/c14n/implementations/Canonicalizer20010315Excl.java 30 Nov 2004 21:17:11 -0000 >@@ -166,7 +166,7 @@ > Iterator it=visiblyUtilized.iterator(); > while (it.hasNext()) { > String s=(String)it.next(); >- Attr key=ns.getMapping(s); >+ Attr key=(Attr)ns.getMapping(s); > if (key==null) { > continue; > } >@@ -283,7 +283,7 @@ > Iterator it=visiblyUtilized.iterator(); > while (it.hasNext()) { > String s=(String)it.next(); >- Attr key=ns.getMapping(s); >+ Attr key=(Attr)ns.getMapping(s); > if (key==null) { > continue; > } >@@ -293,7 +293,7 @@ > Iterator it=this._inclusiveNSSet.iterator(); > while (it.hasNext()) { > String s=(String)it.next(); >- Attr key=ns.getMappingWithoutRendered(s); >+ Attr key=(Attr)ns.getMappingWithoutRendered(s); > if (key==null) { > continue; > } >Index: src/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java >=================================================================== >RCS file: /home/cvs/xml-security/src/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java,v >retrieving revision 1.10 >diff -u -r1.10 CanonicalizerBase.java >--- src/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java 8 Oct 2004 20:27:39 -0000 1.10 >+++ src/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java 30 Nov 2004 21:17:16 -0000 >@@ -443,7 +443,7 @@ > } > } > Attr nsprefix; >- if (((nsprefix=ns.getMappingWithoutRendered("xmlns"))!=null) >+ if (((nsprefix=(Attr)ns.getMappingWithoutRendered("xmlns"))!=null) > && "".equals(nsprefix.getValue())) { > ns.addMappingAndRender("xmlns","",nullNode); > } >Index: src/org/apache/xml/security/c14n/implementations/NameSpaceSymbTable.java >=================================================================== >RCS file: /home/cvs/xml-security/src/org/apache/xml/security/c14n/implementations/NameSpaceSymbTable.java,v >retrieving revision 1.4 >diff -u -r1.4 NameSpaceSymbTable.java >--- src/org/apache/xml/security/c14n/implementations/NameSpaceSymbTable.java 18 Sep 2004 16:49:44 -0000 1.4 >+++ src/org/apache/xml/security/c14n/implementations/NameSpaceSymbTable.java 30 Nov 2004 21:17:18 -0000 >@@ -72,6 +72,18 @@ > } > } > } >+ >+ public void getUnrenderedNodesNon(Collection result) { >+ //List result=new ArrayList(); >+ Iterator it=symb.entrySet().iterator(); >+ while (it.hasNext()) { >+ NameSpaceSymbEntry n=(NameSpaceSymbEntry)((Map.Entry)it.next()).getValue(); >+ //put them rendered? >+ if ((!n.rendered) && (n.n!=null)) { >+ result.add(n.n); >+ } >+ } >+ } > > /** > * Push a frame for visible namespace. >@@ -125,8 +137,11 @@ > } > > final void needsClone() { >- if (!cloned) { >- level.remove(level.size()-1); >+ if (!cloned ) { >+ int num=level.size()-1; >+ if (num<0) >+ return; >+ level.remove(num); > level.add(symb); > symb=(HashMap) symb.clone(); > cloned=true; >@@ -140,7 +155,7 @@ > * @return null if there is no need to render the prefix. Otherwise the node of > * definition. > **/ >- public Attr getMapping(String prefix) { >+ public Object getMapping(String prefix) { > NameSpaceSymbEntry entry=(NameSpaceSymbEntry) symb.get(prefix); > if (entry==null) { > //There is no definition for the prefix(a bug?). >@@ -167,7 +182,7 @@ > * @param prefix The prefix whose definition is neaded. > * @return the attr to render, null if there is no need to render > **/ >- public Attr getMappingWithoutRendered(String prefix) { >+ public Object getMappingWithoutRendered(String prefix) { > NameSpaceSymbEntry entry=(NameSpaceSymbEntry) symb.get(prefix); > if (entry==null) { > return null; >@@ -185,7 +200,7 @@ > * @param n the attribute that have the definition > * @return true if there is already defined. > **/ >- public boolean addMapping(String prefix, String uri,Attr n) { >+ public boolean addMapping(String prefix, String uri,Object n) { > NameSpaceSymbEntry ob = (NameSpaceSymbEntry)symb.get(prefix); > if ((ob!=null) && uri.equals(ob.uri)) { > //If we have it previously defined. Don't keep working. >@@ -215,7 +230,7 @@ > * @param n the attribute that have the definition > * @return the attr to render, null if there is no need to render > **/ >- public Node addMappingAndRender(String prefix, String uri,Attr n) { >+ public Object addMappingAndRender(String prefix, String uri,Attr n) { > NameSpaceSymbEntry ob = (NameSpaceSymbEntry)symb.get(prefix); > > if ((ob!=null) && uri.equals(ob.uri)) { >@@ -254,7 +269,7 @@ > * @return null if there is no need to render the prefix. Otherwise the node of > * definition. > **/ >- public Node addMappingAndRenderXNodeSet(String prefix, String uri,Attr n,boolean outputNode) { >+ public Object addMappingAndRenderXNodeSet(String prefix, String uri,Attr n,boolean outputNode) { > NameSpaceSymbEntry ob = (NameSpaceSymbEntry)symb.get(prefix); > int visibleNameSpaces=nameSpaces; > if ((ob!=null) && uri.equals(ob.uri)) { >@@ -297,7 +312,7 @@ > * The internal structure of NameSpaceSymbTable. > **/ > class NameSpaceSymbEntry implements Cloneable { >- NameSpaceSymbEntry(String name,Attr n,boolean rendered) { >+ NameSpaceSymbEntry(String name,Object n,boolean rendered) { > this.uri=name; > this.rendered=rendered; > this.n=n; >@@ -319,5 +334,5 @@ > /**This prefix-URI has been already render or not.*/ > boolean rendered=false; > /**The attribute to include.*/ >- Attr n; >+ Object n; > }; >Index: src/org/apache/xml/security/signature/Reference.java >=================================================================== >RCS file: /home/cvs/xml-security/src/org/apache/xml/security/signature/Reference.java,v >retrieving revision 1.36 >diff -u -r1.36 Reference.java >--- src/org/apache/xml/security/signature/Reference.java 23 Sep 2004 20:23:18 -0000 1.36 >+++ src/org/apache/xml/security/signature/Reference.java 30 Nov 2004 21:17:27 -0000 >@@ -689,7 +689,7 @@ > MessageDigestAlgorithm mda = this.getMessageDigestAlgorithm(); > > mda.reset(); >- DigesterOutputStream diOs=new DigesterOutputStream(mda); >+ DigesterOutputStream diOs=new DigesterOutputStream(mda.getAlgorithm()); > OutputStream os=new BufferedOutputStream(diOs); > XMLSignatureInput output=this.dereferenceURIandPerformTransforms(os); > output.updateOutputStream(os); >Index: src/org/apache/xml/security/utils/DigesterOutputStream.java >=================================================================== >RCS file: /home/cvs/xml-security/src/org/apache/xml/security/utils/DigesterOutputStream.java,v >retrieving revision 1.1 >diff -u -r1.1 DigesterOutputStream.java >--- src/org/apache/xml/security/utils/DigesterOutputStream.java 23 Sep 2004 20:23:19 -0000 1.1 >+++ src/org/apache/xml/security/utils/DigesterOutputStream.java 30 Nov 2004 21:17:38 -0000 >@@ -17,6 +17,7 @@ > package org.apache.xml.security.utils; > > import java.io.ByteArrayOutputStream; >+import java.security.MessageDigest; > > import org.apache.xml.security.algorithms.MessageDigestAlgorithm; > >@@ -26,11 +27,11 @@ > */ > public class DigesterOutputStream extends ByteArrayOutputStream { > final static byte none[]="error".getBytes(); >- final MessageDigestAlgorithm mda; >+ final MessageDigest mda; > /** > * @param mda > */ >- public DigesterOutputStream(MessageDigestAlgorithm mda) { >+ public DigesterOutputStream(MessageDigest mda) { > this.mda=mda; > } > >Index: src/org/apache/xml/security/utils/SignerOutputStream.java >=================================================================== >RCS file: /home/cvs/xml-security/src/org/apache/xml/security/utils/SignerOutputStream.java,v >retrieving revision 1.2 >diff -u -r1.2 SignerOutputStream.java >--- src/org/apache/xml/security/utils/SignerOutputStream.java 8 Oct 2004 20:27:39 -0000 1.2 >+++ src/org/apache/xml/security/utils/SignerOutputStream.java 30 Nov 2004 21:17:39 -0000 >@@ -46,7 +46,7 @@ > try { > sa.update(arg0); > } catch (XMLSignatureException e) { >- throw new RuntimeException(""+e); >+ throw new RuntimeException("",e); > } > } > >@@ -66,7 +66,14 @@ > sa.update(arg0,arg1,arg2); > } catch (XMLSignatureException e) { > throw new RuntimeException(""+e); >- } >+ } >+ } >+ public boolean verify(byte []a) { >+ try { >+ return sa.verify(a); >+ } catch (XMLSignatureException e) { >+ throw new RuntimeException(""+e); >+ } > } > > >Index: src_unitTests/org/apache/xml/security/test/encryption/BaltimoreEncTest.java >=================================================================== >RCS file: /home/cvs/xml-security/src_unitTests/org/apache/xml/security/test/encryption/BaltimoreEncTest.java,v >retrieving revision 1.18 >diff -u -r1.18 BaltimoreEncTest.java >--- src_unitTests/org/apache/xml/security/test/encryption/BaltimoreEncTest.java 6 Oct 2004 21:11:00 -0000 1.18 >+++ src_unitTests/org/apache/xml/security/test/encryption/BaltimoreEncTest.java 30 Nov 2004 21:17:46 -0000 >@@ -21,6 +21,7 @@ > import java.security.KeyFactory; > import java.security.NoSuchAlgorithmException; > import java.security.PrivateKey; >+import java.security.Provider; > import java.security.cert.X509Certificate; > import java.security.spec.PKCS8EncodedKeySpec; > >@@ -184,11 +185,14 @@ > haveISOPadding = false; > String algorithmId = > JCEMapper.translateURItoJCEID(org.apache.xml.security.utils.EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES128); >- >+ >+ System.out.println("URItoJCEID:"+algorithmId); > if (algorithmId != null) { > try { >- if (Cipher.getInstance(algorithmId) != null) >+ >+ if (Cipher.getInstance(algorithmId,"SunJCE") != null) > haveISOPadding = true; >+ > } catch (NoSuchAlgorithmException nsae) { > } catch (NoSuchPaddingException nspe) { > } >Index: src_samples/prb/SaxCanon.java >=================================================================== >RCS file: src_samples/prb/SaxCanon.java >diff -N src_samples/prb/SaxCanon.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src_samples/prb/SaxCanon.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,402 @@ >+package prb; >+import java.io.ByteArrayInputStream; >+import java.io.ByteArrayOutputStream; >+import java.io.FileNotFoundException; >+import java.io.IOException; >+import java.io.OutputStream; >+import java.security.MessageDigest; >+import java.util.ArrayList; >+import java.util.Iterator; >+import java.util.List; >+import java.util.SortedSet; >+import java.util.TreeSet; >+ >+import javax.xml.parsers.DocumentBuilder; >+import javax.xml.parsers.DocumentBuilderFactory; >+import javax.xml.parsers.ParserConfigurationException; >+import javax.xml.parsers.SAXParser; >+import javax.xml.parsers.SAXParserFactory; >+import javax.xml.transform.TransformerException; >+ >+import org.apache.xerces.dom.AttrImpl; >+import org.apache.xml.security.Init; >+import org.apache.xml.security.c14n.CanonicalizationException; >+import org.apache.xml.security.c14n.InvalidCanonicalizerException; >+import org.apache.xml.security.c14n.implementations.Canonicalizer20010315Excl; >+import org.apache.xml.security.c14n.implementations.Canonicalizer20010315ExclWithComments; >+import org.apache.xml.security.c14n.implementations.NameSpaceSymbTable; >+import org.apache.xml.security.exceptions.XMLSecurityException; >+import org.apache.xml.security.signature.XMLSignatureException; >+import org.apache.xml.security.utils.Base64; >+import org.apache.xml.security.utils.Constants; >+import org.apache.xml.security.utils.DigesterOutputStream; >+import org.apache.xml.security.utils.JavaUtils; >+import org.apache.xml.security.utils.SignerOutputStream; >+import org.apache.xml.security.utils.XMLUtils; >+import org.apache.xpath.XPathAPI; >+import org.w3c.dom.Attr; >+import org.w3c.dom.Document; >+import org.w3c.dom.Node; >+import org.w3c.dom.NodeList; >+import org.xml.sax.Attributes; >+import org.xml.sax.SAXException; >+import org.xml.sax.ext.LexicalHandler; >+import org.xml.sax.helpers.DefaultHandler; >+ >+/* >+ * Created on Oct 18, 2004 >+ * >+ * TODO To change the template for this generated file go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+ >+/** >+ * @author raul >+ * >+ * TODO To change the template for this generated type comment go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+public abstract class SaxCanon extends DefaultHandler implements LexicalHandler{ >+ NameSpaceSymbTable ns=new NameSpaceSymbTable(); >+ >+ private boolean outputComments=true; >+ OutputStream os=new ByteArrayOutputStream(); >+ /** >+ * >+ */ >+ public SaxCanon() { >+ // TODO Auto-generated constructor stub >+ } >+ >+ /** @throws IOException >+ * @inheritDoc **/ >+ final static byte[] EQ_Q= {'=','"'}; >+ final static byte[] END_T= {'<','/'}; >+ public void startElement(String arg0, String arg1, String arg2, Attributes arg3) >+ throws SAXException { >+ ns.push(); >+ SortedSet s = handleAttributes(arg2, arg3); >+ try { >+ os.write('<'); >+ writeStringToUtf8(arg2,os); >+ Iterator it=s.iterator(); >+ while (it.hasNext()) { >+ String[] attr=(String[])it.next(); >+ os.write(' ');writeStringToUtf8(attr[2],os); >+ os.write(EQ_Q); >+ writeStringToUtf8(attr[1],os); >+ os.write('"'); >+ } >+ os.write('>'); >+ } catch (IOException e) { >+ throw new RuntimeException(e); >+ } >+ } >+ abstract SortedSet handleAttributes(String arg2, Attributes arg3); >+ /** @inheritDoc **/ >+ public void characters(char[] arg0, int arg1, int arg2) { >+ try { >+ for (int i=arg1;i<arg1+arg2;i++) >+ writeCharToUtf8(arg0[i],os); >+ } catch (IOException e) { >+ throw new RuntimeException(e); >+ } >+ } >+ >+ /** @inheritDoc **/ >+ public void startPrefixMapping(String arg0, String arg1) >+ throws SAXException { >+ String prefix=("".equals(arg0) ? "xmlns" : arg0); >+ String []attr = {"xmlns" >+ ,arg1,("".equals(arg0) ? "xmlns" : "xmlns:"+arg0)}; >+ ns.addMapping(prefix,arg1,attr); >+ } >+ >+ /** @inheritDoc **/ >+ public void endElement(String arg0, String arg1, String arg2) >+ throws SAXException { >+ try { >+ os.write(END_T); >+ writeStringToUtf8(arg2,os); >+ os.write('>'); >+ } catch (IOException e) { >+ throw new RuntimeException(e); >+ } >+ ns.pop(); >+ >+ } >+ >+ /**@param args >+ * @throws Exception **/ >+ public static void main2(String[] args) throws Exception { >+ SAXParserFactory sf=SAXParserFactory.newInstance(); >+ sf.setNamespaceAware(true); >+ >+ SAXParser saxP=sf.newSAXParser(); >+ >+ >+ String prb="<A:a attr=\"2222\" xmlns:A=\"http://uri-a\">" + >+ "<!--== Prueba de -->\n" + >+ "<b xmlns:C=\"http://uri-c\" C:a=\"2\" a=\"2\" xmlns=\"http://default\">\n" + >+ "<b xmlns=\"http://default\">1<b>2<b/><b/><b>1</b></b></b></b>"+ >+ "</A:a>"; >+ ByteArrayInputStream is=new ByteArrayInputStream(prb.getBytes()); >+ SaxDistributor sc=new SaxDistributor("http://default","b",null,true); >+ //saxP.setProperty("http://xml.org/sax/properties/lexical-handler",sc); >+ saxP.parse(is,sc); >+ System.out.println(new String( >+ ((ByteArrayOutputStream)((CanonWatch)sc.scs.get(1)).sc.os).toByteArray())); >+ } >+ public static void main(String[] args) throws Exception { >+ main2(null); >+ SAXParserFactory sf=SAXParserFactory.newInstance(); >+ sf.setNamespaceAware(true); >+ SAXParser saxP=sf.newSAXParser(); >+ long start; >+ >+ start=System.currentTimeMillis(); >+ int iterator=1; >+ for (int i=0;i<iterator;i++) >+ testExcl(saxP); >+ >+ System.out.println("Hecho en:"+(System.currentTimeMillis()-start)); >+ >+ start=System.currentTimeMillis(); >+ for (int i=0;i<iterator;i++) >+ testExcl(saxP); >+ >+ System.out.println("Hecho en:"+(System.currentTimeMillis()-start)); >+ >+ DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance(); >+ dbf.setNamespaceAware(true); >+ DocumentBuilder db=dbf.newDocumentBuilder(); >+ start=System.currentTimeMillis(); >+ for (int i=0;i<iterator;i++) >+ testExclDOM(db); >+ System.out.println("Hecho en:"+(System.currentTimeMillis()-start)); >+ >+ start=System.currentTimeMillis(); >+ for (int i=0;i<iterator;i++) >+ testExclDOM(db); >+ System.out.println("Hecho en:"+(System.currentTimeMillis()-start)); >+ >+ >+ } >+ public static void testExcl(SAXParser saxP) throws Exception{ >+ >+ SaxDistributor sc=new SaxDistributor("http://example.net","elem2",null,true); >+ //saxP.setProperty("http://xml.org/sax/properties/lexical-handler",sc); >+ saxP.parse(getAbsolutePath("data/org/apache/xml/security/c14n/inExcl/example2_2_1.xml"),sc); >+ byte[] reference = JavaUtils.getBytesFromFile(getAbsolutePath( >+ "data/org/apache/xml/security/c14n/inExcl/example2_2_c14nized_exclusive.xml") ); >+ byte[] result = ((ByteArrayOutputStream)((CanonWatch)sc.scs.get(1)).sc.os).toByteArray(); >+ >+ System.out.println("RESULT:"+new String(result)); >+ System.out.println("EXPECTED:"+new String(reference)); >+ boolean equals = JavaUtils.binaryCompare(reference, result); >+ if (!equals) { >+ throw new RuntimeException("fail"); >+ } >+ >+ } >+ static public void testExclDOM(DocumentBuilder db) throws Exception { >+ Document doc = >+ db.parse(getAbsolutePath("data/org/apache/xml/security/c14n/inExcl/example2_2_1.xml")); >+ Node root = doc.getElementsByTagNameNS("http://example.net", >+ "elem2").item(0); >+ Canonicalizer20010315Excl c = new Canonicalizer20010315ExclWithComments(); >+ //byte[] reference = JavaUtils.getBytesFromFile(getAbsolutePath( >+ //"data/org/apache/xml/security/c14n/inExcl/example2_2_c14nized_exclusive.xml") ); >+ byte[] result = c.engineCanonicalizeSubTree(root); >+ //boolean equals = JavaUtils.binaryCompare(reference, result); >+ } >+ >+ /** @inheritDoc **/ >+ public void endCDATA() { >+ >+ } >+ >+ /** @inheritDoc **/ >+ public void endDTD() { >+ >+ } >+ >+ /** @inheritDoc **/ >+ public void startCDATA(){ >+ >+ } >+ >+ /** @inheritDoc **/ >+ public void comment(char[] arg0, int arg1, int arg2) { >+ if (!outputComments) { >+ return; >+ } >+ String st=new String(arg0,arg1,arg2); >+ try { >+ os.write(("<!--"+st+"-->").getBytes()); >+ } catch (IOException e) { >+ throw new RuntimeException(e); >+ } >+ } >+ final static void writeCharToUtf8(char c,OutputStream out) throws IOException{ >+ >+ if (/*(c >= 0x0001) &&*/ (c <= 0x007F)) { >+ out.write(c); >+ } else if (c > 0x07FF) { >+ out.write(0xE0 | ((c >> 12) & 0x0F)); >+ out.write(0x80 | ((c >> 6) & 0x3F)); >+ out.write(0x80 | ((c >> 0) & 0x3F)); >+ >+ } else { >+ out.write(0xC0 | ((c >> 6) & 0x1F)); >+ out.write(0x80 | ((c >> 0) & 0x3F)); >+ >+ } >+ >+ } >+ >+ /** @inheritDoc **/ >+ public void endEntity(String arg0) { >+ >+ } >+ >+ /** @inheritDoc **/ >+ public void startEntity(String arg0) { >+ >+ } >+ >+ /** @inheritDoc **/ >+ public void startDTD(String arg0, String arg1, String arg2) { >+ } >+ private static String getAbsolutePath(String path) >+ { >+ String basedir = System.getProperty("basedir"); >+ if(basedir != null && !"".equals(basedir)) { >+ path = basedir + "/" + path; >+ } >+ return path; >+ } >+ >+ final static void writeStringToUtf8(String str,OutputStream out) throws IOException{ >+ int length=str.length(); >+ for (int i=0;i<length;i++) { >+ char c=str.charAt(i); >+ if (/*(c >= 0x0001) && */(c <= 0x007F)) { >+ out.write(c); >+ } else if (c > 0x07FF) { >+ out.write(0xE0 | ((c >> 12) & 0x0F)); >+ out.write(0x80 | ((c >> 6) & 0x3F)); >+ out.write(0x80 | ((c >> 0) & 0x3F)); >+ >+ } else { >+ out.write(0xC0 | ((c >> 6) & 0x1F)); >+ out.write(0x80 | ((c >> 0) & 0x3F)); >+ >+ } >+ } >+ } >+ >+ /** >+ * @param md >+ * @throws IOException >+ */ >+ public void setOutputStream(OutputStream md) throws IOException { >+ md.write(((ByteArrayOutputStream)os).toByteArray()); >+ os=md; >+ } >+ >+ >+ public String getBase64Digest() { >+ try { >+ os.flush(); >+ } catch (IOException e) { >+ // TODO Auto-generated catch block >+ e.printStackTrace(); >+ } >+ if (os instanceof DigesterOutputStream) >+ return Base64.encode(((DigesterOutputStream)os).getDigestValue()); >+ >+ return null; >+ } >+ public boolean verifySignature(byte[] a) { >+ if (os instanceof SignerOutputStream) >+ return ((SignerOutputStream)os).verify(a); >+ return false; >+ } >+} >+ >+class AttributesCompare implements java.util.Comparator { >+ /* (non-Javadoc) >+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) >+ */ >+ public int compare(Object obj0, Object obj1) { >+ String[] attr0 = (String[]) obj0; >+ String[] attr1 = (String[]) obj1; >+ String namespaceURI0 = attr0[0]; >+ String namespaceURI1 = attr1[0]; >+ >+ boolean isNamespaceAttr0 = >+ "xmlns".equals(namespaceURI0); >+ boolean isNamespaceAttr1 = >+ "xmlns".equals(namespaceURI1); >+ >+ if (isNamespaceAttr0) { >+ if (isNamespaceAttr1) { >+ >+ // both are namespaces >+ String localname0 = attr0[1]; >+ String localname1 = attr1[1]; >+ >+ if (localname0.equals("xmlns")) { >+ localname0 = ""; >+ } >+ >+ if (localname1.equals("xmlns")) { >+ localname1 = ""; >+ } >+ >+ return localname0.compareTo(localname1); >+ } >+ // attr0 is a namespace, attr1 is not >+ return -1; >+ >+ } >+ if (isNamespaceAttr1) { >+ >+ // attr1 is a namespace, attr0 is not >+ return +1; >+ } >+ >+ // none is a namespae >+ >+ if (namespaceURI0 == null) { >+ if (namespaceURI1 == null) { >+ /* >+ String localName0 = attr0.getLocalName(); >+ String localName1 = attr1.getLocalName(); >+ return localName0.compareTo(localName1); >+ */ >+ >+ String name0 = attr0[1]; >+ String name1 = attr1[1]; >+ return name0.compareTo(name1); >+ } >+ return -1; >+ >+ } >+ if (namespaceURI1 == null) { >+ return +0; >+ } >+ int a = namespaceURI0.compareTo(namespaceURI1); >+ >+ if (a != 0) { >+ return a; >+ } >+ >+ String localName0 = attr0[2]; >+ String localName1 = attr1[2]; >+ >+ return localName0.compareTo(localName1); >+ } >+ >+} >Index: src_samples/prb/SaxDistributor.java >=================================================================== >RCS file: src_samples/prb/SaxDistributor.java >diff -N src_samples/prb/SaxDistributor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src_samples/prb/SaxDistributor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,146 @@ >+/* >+ * Created on Oct 24, 2004 >+ * >+ * TODO To change the template for this generated file go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+package prb; >+ >+import java.io.ByteArrayOutputStream; >+import java.security.PublicKey; >+import java.util.ArrayList; >+import java.util.Iterator; >+import java.util.List; >+ >+import org.xml.sax.Attributes; >+import org.xml.sax.SAXException; >+import org.xml.sax.helpers.DefaultHandler; >+ >+/** >+ * @author raul >+ * >+ * TODO To change the template for this generated type comment go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+public class SaxDistributor extends DefaultHandler { >+ >+ List scs=new ArrayList(); >+ >+ SaxSign ss; >+ PublicKey pk; >+ boolean inSigning=false; >+ private static final String XMLNS_URI = "http://www.w3.org/2000/09/xmldsig#"; >+ >+ /** >+ * >+ */ >+ public SaxDistributor(PublicKey pk,boolean excl) { >+ this.pk=pk; >+ scs.add(new CanonWatch(XMLNS_URI,"SignedInfo",true)); >+ } >+ public SaxDistributor(String uri,String node,PublicKey pk,boolean excl) { >+ this(pk,excl); >+ scs.add(new CanonWatch(uri,node,excl)); >+ } >+ public void startElement(String arg0, String arg1, String arg2, >+ Attributes arg3) throws SAXException { >+ if (XMLNS_URI.equals(arg0) && "Signature".equals(arg1)) { >+ inSigning=true; >+ ss=new SaxSign(this,pk); >+ } >+ Iterator it=scs.iterator() ; >+ while (it.hasNext()) { >+ ((CanonWatch)it.next()).updateStartState(arg0,arg1,arg2,arg3); >+ } >+ if (inSigning) >+ ss.startElement(arg0,arg1,arg2,arg3); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.xml.sax.helpers.DefaultHandler#startPrefixMapping(java.lang.String, java.lang.String) >+ */ >+ public void startPrefixMapping(String arg0, String arg1) >+ throws SAXException { >+ Iterator it=scs.iterator() ; >+ while (it.hasNext()) { >+ ((CanonWatch)it.next()).sc.startPrefixMapping(arg0, arg1); >+ } >+ } >+ public void endElement(String arg0, String arg1, String arg2) >+ throws SAXException { >+ Iterator it=scs.iterator() ; >+ while (it.hasNext()) { >+ ((CanonWatch)it.next()).updateEndState(arg0,arg1,arg2); >+ } >+ if (inSigning) >+ ss.endElement(arg0,arg1,arg2); >+ if (XMLNS_URI.equals(arg0) && "Signature".equals(arg1)) { >+ inSigning=false; >+ } >+ } >+ /* (non-Javadoc) >+ * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int) >+ */ >+ public void characters(char[] arg0, int arg1, int arg2) throws SAXException { >+ if (inSigning) >+ ss.characters(arg0, arg1, arg2); >+ Iterator it=scs.iterator() ; >+ while (it.hasNext()) { >+ ((CanonWatch)it.next()).characters(arg0, arg1, arg2); >+ } >+ } >+ >+ public static void main(String[] args) { >+ } >+} >+ >+class CanonWatch { >+ private Object c14nUri; >+ private Object c14nNode; >+ String id; >+ private boolean already; >+ private int anitate=0; >+ boolean c14ning=false; >+ SaxCanon sc=null; >+ public CanonWatch(String uri,String node,boolean excl) { >+ c14nNode=node; >+ c14nUri=uri; >+ if (excl) { >+ sc=new SaxExclCanon(); >+ } else { >+ sc=new SaxInclCanon(); >+ } >+ } >+ public CanonWatch() { >+ c14ning=true; >+ } >+ public void updateStartState(String arg0, String arg1, String arg2, >+ Attributes arg3) throws SAXException { >+ if (arg0.equals(c14nUri) && arg1.equals(c14nNode)) { >+ if ((anitate==0) && !already) { >+ id=arg3.getValue("id"); >+ } >+ c14ning=!already; >+ anitate++; >+ } >+ if (c14ning) >+ sc.startElement(arg0,arg1,arg2,arg3); >+ } >+ public void updateEndState(String arg0, String arg1, String arg2) >+ throws SAXException { >+ if (c14ning) >+ sc.endElement(arg0,arg1,arg2); >+ if ((arg0.equals(c14nUri) && arg1.equals(c14nNode))) { >+ anitate--; >+ if (anitate==0) { >+ c14ning=false; >+ already=true; >+ } >+ } >+ } >+ public void characters(char[] arg0, int arg1, int arg2) throws SAXException { >+ if (c14ning) { >+ sc.characters(arg0, arg1, arg2); >+ } >+ } >+} >Index: src_samples/prb/SaxExclCanon.java >=================================================================== >RCS file: src_samples/prb/SaxExclCanon.java >diff -N src_samples/prb/SaxExclCanon.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src_samples/prb/SaxExclCanon.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,66 @@ >+/* >+ * Created on Nov 11, 2004 >+ * >+ * TODO To change the template for this generated file go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+package prb; >+ >+import java.util.Iterator; >+import java.util.SortedSet; >+import java.util.TreeSet; >+ >+import org.xml.sax.Attributes; >+ >+/** >+ * @author raul >+ * >+ * TODO To change the template for this generated type comment go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+public class SaxExclCanon extends SaxCanon { >+ >+ public static void main(String[] args) { >+ } >+ >+ /** >+ * @param arg2 >+ * @param arg3 >+ * @return >+ */ >+ SortedSet handleAttributes(String arg2, Attributes arg3) { >+ SortedSet visiblyUtilized =new TreeSet(); >+ SortedSet s=new TreeSet(new AttributesCompare()); >+ for (int i=0;i<arg3.getLength();i++) { >+ String qname=arg3.getQName(i); >+ int colon=qname.indexOf(':'); >+ String prefix=qname; >+ if (colon>0) { >+ prefix=qname.substring(0,colon); >+ } >+ if (!"xml".equals(prefix)) { >+ visiblyUtilized.add(prefix); >+ } >+ String []attr= {arg3.getURI(i),arg3.getValue(i),qname}; >+ s.add(attr); >+ } >+ int colon=arg2.indexOf(':'); >+ String prefix=null; >+ if (colon>0) { >+ prefix=arg2.substring(0,arg2.indexOf(':')); >+ visiblyUtilized.add(prefix); >+ } else { >+ visiblyUtilized.add("xmlns"); >+ } >+ Iterator it=visiblyUtilized.iterator(); >+ while (it.hasNext()) { >+ String prefix1=(String)it.next(); >+ String[] key=(String [])ns.getMapping(prefix1); >+ if (key==null) { >+ continue; >+ } >+ s.add(key); >+ } >+ return s; >+ } >+} >Index: src_samples/prb/SaxInclCanon.java >=================================================================== >RCS file: src_samples/prb/SaxInclCanon.java >diff -N src_samples/prb/SaxInclCanon.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src_samples/prb/SaxInclCanon.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,36 @@ >+/* >+ * Created on Nov 11, 2004 >+ * >+ * TODO To change the template for this generated file go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+package prb; >+ >+import java.util.SortedSet; >+import java.util.TreeSet; >+ >+import org.xml.sax.Attributes; >+ >+/** >+ * @author raul >+ * >+ * TODO To change the template for this generated type comment go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+public class SaxInclCanon extends SaxCanon { >+ >+ /* (non-Javadoc) >+ * @see prb.SaxCanon#handleAttributes(java.lang.String, org.xml.sax.Attributes) >+ */ >+ SortedSet handleAttributes(String arg2, Attributes arg3) { >+ SortedSet s=new TreeSet(new AttributesCompare()); >+ for (int i=0;i<arg3.getLength();i++) { >+ String qname=arg3.getQName(i); >+ String []attr= {arg3.getURI(i),arg3.getValue(i),qname}; >+ s.add(attr); >+ } >+ ns.getUnrenderedNodes(s); >+ return s; >+ } >+ >+} >Index: src_samples/prb/SaxPrb.java >=================================================================== >RCS file: src_samples/prb/SaxPrb.java >diff -N src_samples/prb/SaxPrb.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src_samples/prb/SaxPrb.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,312 @@ >+/* >+ * Created on Oct 24, 2004 >+ * >+ * TODO To change the template for this generated file go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+package prb; >+ >+import java.io.ByteArrayInputStream; >+import java.io.ByteArrayOutputStream; >+import java.io.File; >+import java.io.FileInputStream; >+import java.io.FileOutputStream; >+import java.io.IOException; >+import java.io.InputStream; >+import java.security.KeyPair; >+import java.security.KeyPairGenerator; >+import java.security.KeyStore; >+import java.security.NoSuchAlgorithmException; >+import java.security.PrivateKey; >+import java.security.PublicKey; >+import java.security.cert.CertificateFactory; >+import java.security.cert.X509Certificate; >+import java.util.AbstractCollection; >+import java.util.logging.Level; >+import java.util.logging.Logger; >+import java.util.zip.GZIPInputStream; >+ >+import javax.xml.parsers.DocumentBuilder; >+import javax.xml.parsers.FactoryConfigurationError; >+import javax.xml.parsers.ParserConfigurationException; >+import javax.xml.parsers.SAXParser; >+import javax.xml.parsers.SAXParserFactory; >+ >+import org.apache.commons.logging.LogFactory; >+import org.apache.xml.security.Init; >+import org.apache.xml.security.c14n.CanonicalizationException; >+import org.apache.xml.security.c14n.InvalidCanonicalizerException; >+import org.apache.xml.security.exceptions.XMLSecurityException; >+import org.apache.xml.security.signature.ObjectContainer; >+import org.apache.xml.security.signature.XMLSignature; >+import org.apache.xml.security.signature.XMLSignatureException; >+import org.apache.xml.security.transforms.TransformationException; >+import org.apache.xml.security.transforms.Transforms; >+import org.apache.xml.security.utils.Base64; >+import org.apache.xml.security.utils.Constants; >+import org.apache.xml.security.utils.IdResolver; >+import org.apache.xml.security.utils.SignerOutputStream; >+import org.apache.xml.security.utils.XMLUtils; >+import org.w3c.dom.Document; >+import org.w3c.dom.Element; >+ >+/** >+ * @author raul >+ * >+ * TODO To change the template for this generated type comment go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+public class SaxPrb { >+ >+ private static ByteArrayOutputStream f; >+ /** >+ * >+ */ >+ public SaxPrb() { >+ super(); >+ // TODO Auto-generated constructor stub >+ } >+ public static void main(String[] args) throws Exception { >+ Init.init(); >+ javax.xml.parsers.DocumentBuilderFactory dbf = >+ javax.xml.parsers.DocumentBuilderFactory.newInstance(); >+ >+ dbf.setNamespaceAware(true); >+ >+ javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder(); >+ testBug(db); >+ } >+ public static void main2(String[] args) throws Exception { >+ Init.init(); >+ Logger.getLogger("org.apache.xml.security.signature.Reference").setLevel(Level.OFF); >+ check122MFile(); >+ javax.xml.parsers.DocumentBuilderFactory dbf = >+ javax.xml.parsers.DocumentBuilderFactory.newInstance(); >+ >+ dbf.setNamespaceAware(true); >+ >+ javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder(); >+ KeyPairGenerator kpg=KeyPairGenerator.getInstance("RSA"); >+ KeyPair kp=kpg.generateKeyPair(); >+ createAndTestSignature(kp,db); >+ >+ SAXParserFactory sf=SAXParserFactory.newInstance(); >+ sf.setNamespaceAware(true); >+ SAXParser saxP=sf.newSAXParser(); >+ int iterations=100; >+ long start=System.currentTimeMillis(); >+ for (int i=0;i<iterations;i++) { >+ checkSox(saxP,f.toByteArray(),kp.getPublic()); >+ } >+ System.out.println("Tardo SAX:"+(System.currentTimeMillis()-start)); >+ start=System.currentTimeMillis(); >+ for (int i=0;i<iterations;i++) { >+ checkSox(saxP,f.toByteArray(),kp.getPublic()); >+ } >+ System.out.println("Tardo SAX:"+(System.currentTimeMillis()-start)); >+ >+ start=System.currentTimeMillis(); >+ for (int i=0;i<iterations;i++) { >+ checkDOM(f.toByteArray(),kp.getPublic(),db); >+ } >+ System.out.println("Tardo DOM:"+(System.currentTimeMillis()-start)); >+ start=System.currentTimeMillis(); >+ for (int i=0;i<iterations;i++) { >+ checkDOM(f.toByteArray(),kp.getPublic(),db); >+ } >+ System.out.println("Tardo DOM:"+(System.currentTimeMillis()-start)); >+ //check122MFile(); >+ } >+ /** >+ * @throws NoSuchAlgorithmException >+ * @throws FactoryConfigurationError >+ * @throws ParserConfigurationException >+ * @throws XMLSecurityException >+ * @throws TransformationException >+ * @throws XMLSignatureException >+ * @throws IOException >+ * @throws CanonicalizationException >+ * @throws InvalidCanonicalizerException >+ */ >+ private static void createAndTestSignature(KeyPair kp,DocumentBuilder db) throws NoSuchAlgorithmException, FactoryConfigurationError, ParserConfigurationException, XMLSecurityException, TransformationException, XMLSignatureException, IOException, CanonicalizationException, InvalidCanonicalizerException { >+ //J- >+ >+ //J+ >+ >+ >+ org.w3c.dom.Document doc = db.newDocument(); >+ String BaseURI = "#1"; >+ XMLSignature sig = new XMLSignature(doc, BaseURI, >+ XMLSignature.ALGO_ID_SIGNATURE_RSA, >+ Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS); >+ Element anElement = doc.createElementNS(null, "RootObject"); >+ Element anElement2 = doc.createElementNS(null, "UnderObject"); >+ anElement2.setAttribute("id","1"); >+ anElement.appendChild(anElement2); >+ anElement.appendChild(sig.getElement()); >+ doc.appendChild(anElement); >+ anElement2.appendChild(doc.createTextNode("A text in a box")); >+ Element anElement3 =doc.createElementNS(null,"OtherObject"); >+ anElement2.appendChild(anElement3); >+ anElement3.appendChild(doc.createElementNS(null,"OtherObject2")); >+ anElement3.appendChild(doc.createElementNS(null,"OtherObject6")); >+ anElement3.appendChild(doc.createElementNS(null,"OtherObject")); >+ { >+ Transforms transforms = new Transforms(doc); >+ >+ transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS); >+ sig.addDocument("#1" , transforms, Constants.ALGO_ID_DIGEST_SHA1); >+ } >+ >+ { >+ System.out.println("Start signing"); >+ sig.sign(kp.getPrivate()); >+ System.out.println("Finished signing"); >+ System.out.println("verifying in memory:"+sig.checkSignatureValue(kp.getPublic())); >+ } >+ >+ f = new ByteArrayOutputStream(); >+ XMLUtils.outputDOMc14nWithComments(doc, f); >+ f.close(); >+ System.out.println("Wrote signature to:" + new String(f.toByteArray())); >+ >+ for (int i=0; i<sig.getSignedInfo().getSignedContentLength(); i++) { >+ System.out.println("--- Signed Content follows ---"); >+ System.out.println(new String(sig.getSignedInfo().getSignedContentItem(i))); >+ } >+ ByteArrayOutputStream os=new ByteArrayOutputStream(); >+ sig.getSignedInfo().signInOctectStream(os); >+ System.out.println(new String(os.toByteArray())); >+ } >+ >+ public static void check122MFile() throws Exception{ >+ >+ String certS="-----BEGIN CERTIFICATE-----\n"+ >+ "MIIDCDCCAfCgAwIBAgIEPhq2jTANBgkqhkiG9w0BAQUFADBAMQswCQYDVQQGEwJISzESMBAGA1UE\n" + >+ "ChMJQmFsdGltb3JlMQwwCgYDVQQLEwNHU1MxDzANBgNVBAMTBlRlc3RDQTAeFw0wMzAxMDcxMTE0\n" + >+ "MjFaFw0wNDAxMDcxMTE0MjFaMEMxCzAJBgNVBAYTAkhLMRIwEAYDVQQKEwlCYWx0aW1vcmUxDDAK\n" + >+ "BgNVBAsTA0dTUzESMBAGA1UEAxMJQmFsdHVzZXIxMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n" + >+ "gQCsCDe8BAn/w7PJOYVV/WXudE64m2MNDZNNjPsxUJXcTDYmcomd4n3niekOdsxTG1PPesMgUxhw\n" + >+ "deh2OgpTXsZNOW77pRFUQMzNzU/Fc+YVUDN7I4hFWuxd3PMP8gWI1dJnljyJ86QXjxESGVglpXrK\n" + >+ "3TzvIbBnZzUCrOGYY6tY2wIDAQABo4GKMIGHMA4GA1UdDwEB/wQEAwIDyDB1BgNVHR8EbjBsMGqg\n" + >+ "aKBmhmRsZGFwOi8vcGMyMDMuYmFsdGltb3JlLmNvbS5oazozODkvY249VGVzdENBLG91PUdTUyxv\n" + >+ "PUJhbHRpbW9yZSxjPUhLP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3Q7YmluYXJ5MA0GCSqGSIb3\n" + >+ "DQEBBQUAA4IBAQCdqNoHr/bJlTrVkuVYS58wNswmSWA6HLaiggLj6i7N/qav9GNpyNLc157JeoFW\n" + >+ "4J/tT7NLrKWzZW4sRWRnAF5O0xbZz7eBS+8kBttjejHgZKx2n+QCjVfOwghsUxCBfTgAqN9anUvP\n" + >+ "IuZYggYfZqLTY+MY6wdnXb1mqb8at6aztbuKnvGnJJITb8Bi4fsaD060dd4Eqj7HZZZluXhGm+z8\n" + >+ "KL3e8qjNdZabdyBCSrdDRpWXckTD5lU3bivlgVN8Ree9jRM1jEjpCOwhgN3Xvde4BkscL2ZGPZCC\n" + >+ "LH9mea9wzIkfbjm7wdqEwGghT0GucFPl5t9P/gltNfYkPSq+IjcP\n"+ >+ "-----END CERTIFICATE-----\n"; >+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); >+ X509Certificate cert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(certS.getBytes())); >+ SAXParserFactory sf=SAXParserFactory.newInstance(); >+ sf.setNamespaceAware(true); >+ SAXParser saxP=sf.newSAXParser(); >+ >+ InputStream is=new GZIPInputStream(new FileInputStream("122M_sig.xml.gz")); >+ long start=System.currentTimeMillis(); >+ SaxDistributor sd=new SaxDistributor("http://www.w3.org/2000/09/xmldsig#","Object",cert.getPublicKey(),false); >+ //sd.scs.add(new CanonWatch()); >+ saxP.parse(is,sd); >+ System.out.println("duracion:"+(System.currentTimeMillis()-start)); >+ >+ //System.out.println("RESULT:"+new String(result)); >+ System.out.println("RESULT:"+sd.ss.validateReferences()); >+ System.out.println("RESULT sd:"+sd.ss.validateSignature()); >+ >+ } >+ public static void checkSox(SAXParser saxP,byte sig[],PublicKey pk) throws Exception { >+ >+ ByteArrayInputStream is=new ByteArrayInputStream(sig); >+ SaxDistributor sd=new SaxDistributor("","UnderObject",pk,true); >+ //sd.scs.add(new CanonWatch()); >+ saxP.parse(is,sd); >+ //byte[] result = ((CanonWatch)sd.scs.get(1)).sc.os.toByteArray(); >+ >+ //System.out.println("RESULT:"+new String(result)); >+ if (!(sd.ss.validateReferences() && sd.ss.validateSignature())) { >+ throw new RuntimeException("ERROR SAX"); >+ } >+ //System.out.println("RESULT:"+sd.ss.validateReferences()); >+ //.System.out.println("RESULT sd:"+sd.ss.validateSignature()); >+ //result = ((CanonWatch)sd.scs.get(0)).sc.os.toByteArray(); >+ >+ //System.out.println("RESULT:"+new String(result)); >+ } >+ >+ public static void checkDOM(byte sig[],PublicKey pk, DocumentBuilder db) throws Exception { >+ Document doc=db.parse(new ByteArrayInputStream(sig)); >+ //System.out.println(); >+ IdResolver.registerElementById((Element)doc.getFirstChild().getFirstChild(),"1"); >+ XMLSignature xs=new XMLSignature((Element)doc.getFirstChild().getFirstChild().getNextSibling(),""); >+ if (!xs.checkSignatureValue(pk)) >+ throw new RuntimeException("FAIL DOM"); >+ >+ } >+ public static void testBug(DocumentBuilder db) throws Exception{ >+ String signagture="<Assertion AssertionID=\"932aa4da-9aeb-484e-8ecf-99b4609c48f6\" IssueInstant=\"2004-11-18T05:26:26Z\" Issuer=\"DC=org,DC=DOEGrids,OU=Certificate Authorities,CN=DOEGrids CA 1\" MajorVersion=\"1\" MinorVersion=\"0\" xmlns=\"urn:oasis:names:tc:SAML:1.0:assertion\"><Conditions NotBefore=\"2004-11-18T05:26:26Z\" NotOnOrAfter=\"2004-11-18T05:28:06Z\"/><AuthorizationDecisionStatement Decision=\"Permit\" Resource=\"FTPNamespace|ftp://sample1.org\" xmlns=\"urn:oasis:names:tc:SAML:1.0:assertion\"><Subject xmlns=\"urn:oasis:names:tc:SAML:1.0:assertion\"><NameIdentifier Format=\"#X509SubjectName\" NameQualifier=\"dummyDN\">dummy DN</NameIdentifier><SubjectConfirmation><ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:am:X509-PKI</ConfirmationMethod></SubjectConfirmation></Subject><Action Namespace=\"fileType\" xmlns=\"urn:oasis:names:tc:SAML:1.0:assertion\">read</Action><Action Namespace=\"directory\" xmlns=\"urn:oasis:names:tc:SAML:1.0:assertion\">read</Action></AuthorizationDecisionStatement><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\">\n" + >+ "<ds:SignedInfo xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\">\n" + >+ "<ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"/>\n" + >+ "<ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"/>\n" + >+ "<ds:Reference URI=\"\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\">\n" + >+ "<ds:Transforms xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" xmlns:signs=\"urn:oasis:names:tc:SAML:1.0:assertion\">\n" + >+ "<ds:Transform Algorithm=\"http://www.w3.org/2002/06/xmldsig-filter2\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\">\n" + >+ "<dsig-xpath:XPath Filter=\"intersect\" xmlns:dsig-xpath=\"http://www.w3.org/2002/06/xmldsig-filter2\">here()/ancestor::signs:Assertion[1]</dsig-xpath:XPath>\n" + >+ "<dsig-xpath:XPath Filter=\"subtract\" xmlns:dsig-xpath=\"http://www.w3.org/2002/06/xmldsig-filter2\">here()/ancestor::ds:Signature[1]</dsig-xpath:XPath>\n" + >+ "</ds:Transform>\n" + >+ "<ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"><ec:InclusiveNamespaces PrefixList=\"code ds kind rw saml samlp signs #default xsd xsi\" xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\"/></ds:Transform>\n" + >+ "</ds:Transforms>\n" + >+ "<ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"/>\n" + >+ "<ds:DigestValue xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\">1P4tHsFzvYgx4KAEBHpQMSSy1pM=</ds:DigestValue>\n" + >+ "</ds:Reference>\n" + >+ "</ds:SignedInfo>\n" + >+ "<ds:SignatureValue xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\">\n" + >+ "S78gPVnzpVjNineV6V6I0Kn8zh8dcxz2vKnj3RmORx86nQfWnFRdP1RCwRkDOpiuvKXAQsSFpQRa\n" + >+ "GkerMG/7iQ==\n" + >+ "</ds:SignatureValue>\n" + >+ "<ds:KeyInfo xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\">\n" + >+ "<ds:X509Data xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\">\n" + >+ "<ds:X509Certificate xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\">\n" + >+ "MIICuTCCAaGgAwIBAgIEEJvQxTANBgkqhkiG9w0BAQQFADBeMRMwEQYKCZImiZPyLGQBGRYDb3Jn\n" + >+ "MRgwFgYKCZImiZPyLGQBGRYIZG9lZ3JpZHMxDzANBgNVBAsTBlBlb3BsZTEcMBoGA1UEAxMTU2Ft\n" + >+ "dWVsIE1lZGVyIDE5NjM0NDAeFw0wNDExMTgwNDMwMzBaFw0wNDExMTgxNjM1MzBaMHIxEzARBgoJ\n" + >+ "kiaJk/IsZAEZFgNvcmcxGDAWBgoJkiaJk/IsZAEZFghkb2VncmlkczEPMA0GA1UECxMGUGVvcGxl\n" + >+ "MRwwGgYDVQQDExNTYW11ZWwgTWVkZXIgMTk2MzQ0MRIwEAYDVQQDEwkyNzg2NDY5ODEwXDANBgkq\n" + >+ "hkiG9w0BAQEFAANLADBIAkEAyEix18UyUMK2w3Onb/7EXCSrfnAMxwotpvVF6KJ/qA5xcAWVizaJ\n" + >+ "UPdtmGZY6It2l+DSDK/nvoLRlX/LH3xnRwIDAQABozMwMTAOBgNVHQ8BAf8EBAMCBLAwHwYKKwYB\n" + >+ "BAGbUAGBXgEB/wQOMAwwCgYIKwYBBQUHFQEwDQYJKoZIhvcNAQEEBQADggEBAEVIF9ZDPZxZL0wh\n" + >+ "1tHZi0VdJrjug8g59cTip5dWcKz7eusKWkR0eXt/vQ6gv0KqYLO2NUt8zVk1d32Z6v3nrg2NzxNR\n" + >+ "EjwGqrxB7sZGkNnwWNKW+Ao8AkfE5gfqzVmuEOGDbKlXMeL2XYZhO5jpUSAMCQawl0SvCtDbfxmH\n" + >+ "ygUuKUeTCLA4tSAXKcxTSkvNAV0W/KObKSOoZ9qq3zG4f2+GqujrPa1ahRo3uwl7YIJTEjkmaPqC\n" + >+ "MFvJdC4D3LLb8WyB8LYofRVpwc0TtkotbiwjIEy4CN59sLtrTx5TGbDWDiK0Ukw6ichNP3Nr44i0\n" + >+ "eC8h/LpG0SJgzgHt0LY2agc=\n" + >+ "</ds:X509Certificate>\n" + >+ "<ds:X509Certificate xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\">\n" + >+ "MIIDpzCCAo+gAwIBAgICBVEwDQYJKoZIhvcNAQEFBQAwaTETMBEGCgmSJomT8ixkARkWA29yZzEY\n" + >+ "MBYGCgmSJomT8ixkARkWCERPRUdyaWRzMSAwHgYDVQQLExdDZXJ0aWZpY2F0ZSBBdXRob3JpdGll\n" + >+ "czEWMBQGA1UEAxMNRE9FR3JpZHMgQ0EgMTAeFw0wNDAxMDcxNzEyNTJaFw0wNTAxMDYxNzEyNTJa\n" + >+ "MF4xEzARBgoJkiaJk/IsZAEZFgNvcmcxGDAWBgoJkiaJk/IsZAEZFghkb2VncmlkczEPMA0GA1UE\n" + >+ "CxMGUGVvcGxlMRwwGgYDVQQDExNTYW11ZWwgTWVkZXIgMTk2MzQ0MIIBIjANBgkqhkiG9w0BAQEF\n" + >+ "AAOCAQ8AMIIBCgKCAQEAmsC01HNrzO0ddRWo6IajmK8A0iRCebL206gFwzH9uJHhH6pcYu1ro6Es\n" + >+ "8Db36wb0u04DFhUsQBjEUoLanK9S7QhxeD9jkkpycX8mwfJhzxCeFMLG743Es0EfQJZNF4cOtnKy\n" + >+ "zB8hBYbc52q5Xbo7Xdjz81yuzTYdyXnkxUgDCdXoPeYiPy+eRCJFnqo6lQ9QKhMTVWsfEUPpfoSy\n" + >+ "C/YkMN0ag3H2bmWouZ/YauOQfCzCTtFDKP3+RroBhYDOkEoqyq77z204crdGYdQUlE5ata5ZbFtL\n" + >+ "uBuCXkup1Y0f+AcPFiN8M24E3L7AJQ9VAJSELvfz8IWSBsFd+meEl/NanwIDAQABo2QwYjARBglg\n" + >+ "hkgBhvhCAQEEBAMCBeAwDgYDVR0PAQH/BAQDAgTwMBwGA1UdEQQVMBOBEW1lZGVyQG1jcy5hbmwu\n" + >+ "Z292MB8GA1UdIwQYMBaAFMoZHRKObqQ4XULUMQ4I29mNFw1dMA0GCSqGSIb3DQEBBQUAA4IBAQAq\n" + >+ "30xAqkVK4dmXOVLbGqmcEaNDBaJeURYotUiAxrt9r/fTlLWpOUf3Dh2kQZiS3vJPc2GDvM7AF/AO\n" + >+ "dfsrJ1wSmh44qubqsorBVy23urTI1nOvSMwaMJ5k03GiVdu0MGiMFDlz4W1OYgLVThxtFH7dQsuS\n" + >+ "EiGvKK1LWZLT32b+uSI75K+x/UryJHFEpbSLCer6Tb31ZItg+eeUs08276Nu4tUyN6CIPGizueOd\n" + >+ "ebGhj6o9YuS9rsbxUC73TabuZX6EeohIFN73+2nOX0kn0JgN+qAbh3ARdFj8f6zFRuzbeYX1Okxh\n" + >+ "WUPNYSMbA+vV+rp6lv0+FN7E9Ao+1q9dLdLX\n" + >+ "</ds:X509Certificate>\n" + >+ "</ds:X509Data>\n" + >+ "</ds:KeyInfo></ds:Signature></Assertion>\n"; >+ Document doc=db.parse(new ByteArrayInputStream(signagture.getBytes())); >+ Element el=(Element)doc.getFirstChild().getFirstChild().getNextSibling().getNextSibling(); >+ System.out.println(el); >+ XMLSignature sig=new XMLSignature(el,""); >+ System.out.println(new String(sig.getSignedInfo().getReferencedContentAfterTransformsItem(0).getBytes())); >+ } >+ } >+ >Index: src_samples/prb/SaxSign.java >=================================================================== >RCS file: src_samples/prb/SaxSign.java >diff -N src_samples/prb/SaxSign.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src_samples/prb/SaxSign.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,219 @@ >+/* >+ * Created on Oct 23, 2004 >+ * >+ * TODO To change the template for this generated file go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+package prb; >+ >+ >+import java.io.BufferedOutputStream; >+import java.io.IOException; >+import java.nio.BufferOverflowException; >+import java.security.MessageDigest; >+import java.security.PublicKey; >+ >+import javax.xml.parsers.SAXParser; >+import javax.xml.parsers.SAXParserFactory; >+ >+import org.apache.xml.security.algorithms.JCEMapper; >+import org.apache.xml.security.algorithms.MessageDigestAlgorithm; >+import org.apache.xml.security.algorithms.SignatureAlgorithm; >+import org.apache.xml.security.exceptions.Base64DecodingException; >+import org.apache.xml.security.exceptions.XMLSecurityException; >+import org.apache.xml.security.signature.XMLSignatureException; >+import org.apache.xml.security.utils.Base64; >+import org.apache.xml.security.utils.DigesterOutputStream; >+import org.apache.xml.security.utils.SignerOutputStream; >+import org.w3c.dom.Document; >+import org.w3c.dom.Element; >+import org.xml.sax.Attributes; >+import org.xml.sax.SAXException; >+import org.xml.sax.helpers.DefaultHandler; >+ >+/** >+ * @author raul >+ * >+ */ >+public class SaxSign extends DefaultHandler { >+ >+ private static final String XMLNS_URI = "http://www.w3.org/2000/09/xmldsig#"; >+ private boolean inSignature; >+ boolean inReference=false; >+ boolean inSignatureValue=false; >+ ReferenceHolder ref; >+ SaxDistributor sd; >+ SignerOutputStream si=null; >+ String signatureValue=null; >+ PublicKey pk; >+ private SignatureAlgorithm sa; >+ /** >+ * >+ */ >+ public SaxSign(SaxDistributor sd,PublicKey pk) { >+ this.pk=pk; >+ this.sd=sd; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) >+ */ >+ public void startElement(String arg0, String arg1, String arg2, >+ Attributes arg3) throws SAXException { >+ if (XMLNS_URI.equals(arg0) && "Signature".equals(arg1)) { >+ inSignature=true; >+ } >+ if (!inSignature) >+ return; //Check if reference >+ >+ if (XMLNS_URI.equals(arg0) && "Reference".equals(arg1)) { >+ inReference=true; >+ ref=new ReferenceHolder(arg3,((CanonWatch)sd.scs.get(1)).sc); >+ } >+ if (XMLNS_URI.equals(arg0) && "SignatureValue".equals(arg1)) { >+ inSignatureValue=true; >+ } >+ if (XMLNS_URI.equals(arg0) && "SignatureMethod".equals(arg1)) { >+ updateSignatureStream(arg3); >+ } >+ >+ if (inReference) { >+ ref.update(arg0,arg1,arg3); >+ } >+ } >+ >+ /** >+ * @param arg3 >+ */ >+ private void updateSignatureStream(Attributes arg3) { >+ try { >+ sa = new SignatureAlgorithm(arg3.getValue("Algorithm")); >+ si= >+ new SignerOutputStream( >+ sa); >+ if (pk!=null) { >+ sa.initVerify(pk); >+ try { >+ ((CanonWatch)sd.scs.get(0)).sc.setOutputStream(new BufferedOutputStream(si)); >+ } catch (IOException e1) { >+ // TODO Auto-generated catch block >+ e1.printStackTrace(); >+ } >+ } >+ >+ } catch (XMLSecurityException e) { >+ throw new RuntimeException("No algoth",e); >+ } >+ } >+ >+ public void endElement(String arg0, String arg1, String arg2) >+ throws SAXException { >+ if (XMLNS_URI.equals(arg0) && "Signature".equals(arg1)) { >+ inSignature=false; >+ } >+ if (XMLNS_URI.equals(arg0) && "Reference".equals(arg1)) { >+ inReference=false; >+ } >+ if (XMLNS_URI.equals(arg0) && "SignatureValue".equals(arg1)) { >+ inSignatureValue=false; >+ } >+ if (inReference) { >+ ref.update(arg0,arg1); >+ } >+ } >+ public boolean validateReferences() { >+ return ref.validate(); >+ } >+ >+ public void characters(char[] arg0, int arg1, int arg2) throws SAXException { >+ if (inReference) { >+ ref.setValue(new String(arg0,arg1,arg2)); >+ } >+ if (inSignatureValue) { >+ if (signatureValue!=null) >+ signatureValue+=new String(arg0,arg1,arg2); >+ else >+ signatureValue=new String(arg0,arg1,arg2); >+ } >+ } >+ >+ public boolean validateSignature() { >+ //System.out.println("a="+signatureValue); >+ try { >+ ((CanonWatch)sd.scs.get(0)).sc.os.flush(); >+ return sa.verify(Base64.decode(signatureValue)); >+ } catch (Exception e) { >+ throw new RuntimeException(e); >+ } >+ } >+} >+ >+class ReferenceHolder { >+ String uri; >+ boolean inDigest=false; >+ String digestValue; >+ SaxCanon sc; >+ DigesterOutputStream di; >+ >+ public ReferenceHolder(Attributes atrs,SaxCanon sc) { >+ uri=atrs.getValue("URI"); >+ this.sc=sc; >+ } >+ public void update(String uri,String localname,Attributes arg3) { >+ if ("Transform".equals(localname)) { >+ if (!"http://www.w3.org/2001/10/xml-exc-c14n#". >+ equals(arg3.getValue("Algorithm"))) { >+ throw new RuntimeException("Only xml-exc-c14n transformation accepted,sorry"); >+ } >+ } >+ if ("DigestMethod".equals(localname)) { >+ String algorithmURI=arg3.getValue("Algorithm"); >+ String algorithmID = JCEMapper.translateURItoJCEID(algorithmURI); >+ >+ MessageDigest md; >+ >+ try { >+ md = MessageDigest.getInstance(algorithmID); >+ } catch (java.security.NoSuchAlgorithmException ex) { >+ Object[] exArgs = { algorithmID, >+ ex.getLocalizedMessage() }; >+ >+ throw new RuntimeException("No such algorithm"); >+ } >+ this.di=new DigesterOutputStream(md); >+ try { >+ sc.setOutputStream(new BufferedOutputStream(di)); >+ } catch (IOException e) { >+ // TODO Auto-generated catch block >+ e.printStackTrace(); >+ } >+ >+ } >+ if ("DigestValue".equals(localname)) { >+ inDigest=true; >+ } >+ } >+ public boolean validate() { >+ try { >+ sc.os.flush(); >+ } catch (IOException e) { >+ >+ } >+ boolean b=digestValue.equals(Base64.encode(di.getDigestValue())); >+ if (!b) { >+ System.out.println("fail the value:"+sc.getBase64Digest()); >+ } >+ return b; >+ } >+ public void setValue(String value) { >+ if (inDigest) { >+ //System.out.println("Setting digest:"+value); >+ digestValue=value; >+ } >+ } >+ public void update(String uri,String localname) { >+ if ("DigestValue".equals(localname)) { >+ inDigest=false; >+ } >+ } >+} >Index: src_unitTests/org/apache/xml/security/test/encryption/AllTests.java >=================================================================== >RCS file: src_unitTests/org/apache/xml/security/test/encryption/AllTests.java >diff -N src_unitTests/org/apache/xml/security/test/encryption/AllTests.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src_unitTests/org/apache/xml/security/test/encryption/AllTests.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,35 @@ >+/* >+ * Created on Oct 5, 2004 >+ * >+ * TODO To change the template for this generated file go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+package org.apache.xml.security.test.encryption; >+ >+import java.security.Provider; >+import java.security.Security; >+ >+import org.bouncycastle.jce.provider.BouncyCastleProvider; >+ >+import junit.framework.Test; >+import junit.framework.TestSuite; >+ >+/** >+ * @author raul >+ * >+ * TODO To change the template for this generated type comment go to >+ * Window - Preferences - Java - Code Style - Code Templates >+ */ >+public class AllTests { >+ >+ public static Test suite() throws Exception { >+ Security.addProvider(new BouncyCastleProvider()); >+ TestSuite suite = new TestSuite( >+ "Test for org.apache.xml.security.test.encryption"); >+ //$JUnit-BEGIN$ >+ suite.addTestSuite(XMLCipherTester.class); >+ suite.addTest(BaltimoreEncTest.suite()); >+ //$JUnit-END$ >+ return suite; >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 32657
:
13738
|
13928