Return-Path: Delivered-To: apmail-xml-security-dev-archive@www.apache.org Received: (qmail 74690 invoked from network); 1 Apr 2005 17:24:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Apr 2005 17:24:14 -0000 Received: (qmail 62062 invoked by uid 500); 1 Apr 2005 17:24:13 -0000 Delivered-To: apmail-xml-security-dev-archive@xml.apache.org Received: (qmail 62039 invoked by uid 500); 1 Apr 2005 17:24:12 -0000 Mailing-List: contact security-dev-help@xml.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: security-dev@xml.apache.org Delivered-To: mailing list security-dev@xml.apache.org Received: (qmail 62025 invoked by uid 99); 1 Apr 2005 17:24:12 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of raul.benito.garcia@gmail.com designates 64.233.170.207 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.207) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 01 Apr 2005 09:24:10 -0800 Received: by rproxy.gmail.com with SMTP id z35so1275793rne for ; Fri, 01 Apr 2005 09:24:08 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=Q5szU2yaWEP+79cMMgbNm+t8Gcut8g1bNbLM1S4SjYRCvsLIfrPnwUKOJmrWwPWnkcRKPkya4q4xpPr0zEKPz6dyr9jLQmaf65+oIvJ5S+Zye4NmT+yU/O9T+0SObuZ2O+AQXo+TSG0A3Lc+BoIvcwvxgzt6PdTO3eSF6xstA+Q= Received: by 10.38.82.78 with SMTP id f78mr236565rnb; Fri, 01 Apr 2005 09:24:08 -0800 (PST) Received: by 10.38.97.34 with HTTP; Fri, 1 Apr 2005 09:24:08 -0800 (PST) Message-ID: <949ac941050401092440df107a@mail.gmail.com> Date: Fri, 1 Apr 2005 19:24:08 +0200 From: Raul Benito Reply-To: raul@apache.org To: skipwork@skipwalker.com, security-dev@xml.apache.org Subject: Re: Java XML C14n interop with .Net In-Reply-To: <200504011633.j31GXdHZ426440@pimout6-ext.prodigy.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <949ac941050331210861edc762@mail.gmail.com> <200504011633.j31GXdHZ426440@pimout6-ext.prodigy.net> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is something I've never worried about. But I think you can edit your XML files with an editor that let you select how to encode end of line if just \n like unix does or \n\r like windows does. I'm also sure you can investigate how java handles the CR/LF headache. But above this I cannot help you more. If you happen to find a solution, can you post to the list for further generations ;)/ Regards On Apr 1, 2005 6:34 PM, Skip Walker wrote: > Raul, thanks for the second pair of eyes. I figured there was something > stupid causing the problem. > > The bug with the namespace aware issue resolved. I still have the issue > with the entities. The C# canonicalizer adds these apparently on any > document that contains some sort of line feed. Is there any more thoughts > on these line feed things. > > Thanks, > Skip > > Skip Walker > skip@gossamer-group.com > Gossamer Group > Bldg #2, Suite 410 > 4807 Spicewood Springs Rd. > Austin, TX 78759 > (512) 342-2600 Fax (512) 342-2612 > > -----Original Message----- > From: Raul Benito [mailto:raul.benito.garcia@gmail.com] > Sent: Thursday, March 31, 2005 11:09 PM > To: security-dev@xml.apache.org; skipwork@skipwalker.com > Subject: Re: Java XML C14n interop with .Net > > Ok, > > You have a bug in your code. You are using a parser non namespaceaware, > you have this: > DocumentBuilderFactory factory = > DocumentBuilderFactory.newInstance(); > factory.setValidating(false); > factory.setNamespaceAware(true); > > DocumentBuilder builder = factory.newInstance(). > newDocumentBuilder(); > Take a look of the last line you are obtaining a new factory that by > default is not name space aware, please write this and everything > should work: > DocumentBuilder builder = factory.newDocumentBuilder(); > Regards, > > On Mar 31, 2005 11:45 PM, Skip Walker wrote: > > Outputting the dom via the serializer before running the canonicalizer, > and > > comparing it with the output after the canonicalizer, it appears that the > > canonicalizer is having no effect. See below. > > > > I'm attaching my test class and test files. Would someone please check if > > they have similar results, or check to see if I'm making some stupid > > mistake. > > > > The class needs glue 5.0.2 to run the glue test, or at least the > ElectricXML > > bundled with it, but one can comment that section out easily, and just run > > the JAXP test. > > > > _______ > > > > Serializing Doc before Canonicalization: > > > > > > > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" > > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > > > > > usa > > japan > > > > > > > > > > > > test crapola > > > > > > > > Canonicalized XML written to file: c14n-jaxp.xml > > > > > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" > > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > > > > > usa > > japan > > > > > > > > > > > > test crapola > > > > > > > > ________ > > > > Skip Walker > > skip@gossamer-group.com > > Gossamer Group > > Bldg #2, Suite 410 > > 4807 Spicewood Springs Rd. > > Austin, TX 78759 > > (512) 342-2600 Fax (512) 342-2612 > > > > -----Original Message----- > > From: Raul Benito [mailto:raul.benito.garcia@gmail.com] > > Sent: Thursday, March 31, 2005 2:04 PM > > To: security-dev@xml.apache.org > > Subject: Re: Java XML C14n interop with .Net > > > > I'll think you are still having problems with your dom, but it is > > really weird as if your program is really what you have shown it > > should work, correctly. Anyway can you tell me what's the output of > > the following lines in your example: > > XMLSerializer ser=new XMLSerializer(); > > ser.setOutputByteStream(System.out); > > ser.serialize(doc); > > Regards, > > > > Raul > > > > On Thu, 31 Mar 2005 14:45:32 -0500, Scott Cantor wrote: > > > > For some reason, in my little test case, the canonicalizer renders a > > > > different result with the DOM from the JAXP api then from the Glue > api. > > > > Apparently, the result from the JAXP DOM, produces something wrong, as > > far > > > > as the soap:encodingStyle attribute goes. > > > > > > I guess a first sanity check would be to compare the DOMs in a piecemeal > > > fashion. Literally spit out a property-based display for every single > node > > > in the tree with the node type, name, NS, and hex value. > > > > > > If those match, well, hmm. If not, at least that explains something. > > > > > > But the thing I don't get is that your JAXP DOM c14n output just doesn't > > > seem to be canonical, at least not unless the DOMs are really different. > > > > > > -- Scott > > > > > > > > > > -- > > http://r-bg.com > > > > > > > > -- > http://r-bg.com > > -- http://r-bg.com