From securityzcarey@example.org Mon Aug 02 14:12:18 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 58688 invoked from network); 2 Aug 2010 14:12:18 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Aug 2010 14:12:18 -0000 Received: (qmail 89882 invoked by uid 500); 2 Aug 2010 14:12:18 -0000 Delivered-To: zcarey@example.org Received: (qmail 89706 invoked by uid 500); 2 Aug 2010 14:12:15 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 89696 invoked by uid 99); 2 Aug 2010 14:12:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 14:12:15 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-qw0-f41.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 14:12:07 +0000 Received: by qwk4 with SMTP id 4so1572967qwk.28 for <zcarey@example.org>; Mon, 02 Aug 2010 07:11:46 -0700 (PDT) Received: by 83.161.120.155 with SMTP id ko1mr99036qcb.4.1280758304820; Mon, 02 Aug 2010 07:11:44 -0700 (PDT) Received: from lypse.local (c-68-40-239-226.hsd1.mi.comcast.net [83.161.120.155]) by mx.google.com with ESMTPS id g31sm5537369ibh.4.283.161.120.155.11.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Aug 2010 07:11:40 -0700 (PDT) Message-ID: <zcarey@example.org> Date: Mon, 02 Aug 2010 10:11:38 -0400 From: Chad La Joie <zcarey@example.org> Organization: Itumi, LLC User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:83.161.120.155) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: zcarey@example.org Subject: Status of == vs equals() Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org So, while I don't have my access yet, Colm asked me if I'd take a look at the == vs equals() issue (relevant bugs: 40897[1], 45637[2], 46681[3]) My executive summary is that clearly, as things stand, the current code favors optimization over correctness. Rarely is this a good thing. Colm notes[4] that the reliance on intern'ed strings (and thus the ability to use ==) occurs sporadically throughout the code and not just within the ElementChecker implementations. He specifically mentioned that the various C14N implementations, and indeed the == is used about 6 times there for string comparison. My recommendation then is two fold: - Ensure that nothing other than namespace bits are compared via ==. I don't know that this occurs but the code should definitely be reviewed to ensure that. - Create a new "NamespaceEqualityChecker" that provides methods for checking the various bits of a namespace (URIs, prefixes) and use it anywhere that either == or equals() is used today. Implementations based on == and equals() would be provided with the default implementation being equals()-based. A configuration option should then be made available to control which impl gets used. Additionally, it might even be possible to add some smarts that could detect known "good" parsers that use interning and automatically use the == based implementation. I do not recommend changing any part of the code without addressing the whole codebase (i.e. all the =='s need to be fixed or no change should be made) because of the possibility of creating new, unwanted, effects. The current functionality is undesirable but better the devil you know. I think that this should be addressed in the upcoming 1.4.4 release. If quick consensus can be reached I'm willing to do the work with a window of time I have available over the next 2-3 weeks. [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=40897 [2] https://issues.apache.org/bugzilla/show_bug.cgi?id=45637 [3] https://issues.apache.org/bugzilla/show_bug.cgi?id=46681 [4] https://issues.apache.org/bugzilla/show_bug.cgi?id=45637#c1 -- Chad La Joie http://itumi.biz trusted identities, delivered From securityzcarey@example.org Mon Aug 02 14:14:16 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 59564 invoked from network); 2 Aug 2010 14:14:16 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Aug 2010 14:14:16 -0000 Received: (qmail 93340 invoked by uid 500); 2 Aug 2010 14:14:16 -0000 Delivered-To: zcarey@example.org Received: (qmail 93001 invoked by uid 500); 2 Aug 2010 14:14:14 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 92806 invoked by uid 99); 2 Aug 2010 14:14:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 14:14:14 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of zcarey@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO defang2.it.ohio-state.edu) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 14:14:03 +0000 Received: from defang6.it.ohio-state.edu (defang6.it.ohio-state.edu [83.161.120.155]) by defang2.it.ohio-state.edu (8.13.7/8.13.1) with ESMTP id o72EDgbR019935; Mon, 2 Aug 2010 10:13:42 -0400 Received: from SNOWDOG (SNOWDOG.dyn.cio.osu.edu [83.161.120.155]) by defang6.it.ohio-state.edu (8.13.7/8.13.1) with ESMTP id o72EDfNS012638; Mon, 2 Aug 2010 10:13:41 -0400 From: "Scott Cantor" <zcarey@example.org> To: <zcarey@example.org> Cc: <zcarey@example.org> Subject: Santuario infra changes Date: Mon, 2 Aug 2010 10:13:52 -0400 Organization: The Ohio State University Message-ID: <zcarey@example.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AcsySYn7Br34oH7USfGY/r6tcJBLeA== Content-language: en-us X-Spam-Score: 0.00 () [zcarey@example.org] SPF(pass,0) X-CanIt-Geo: ip=83.161.120.155; country=US; region=OH; city=Columbus; latitude=39.9968; longitude=-82.9882; metrocode=535; areacode=614; http://maps.google.com/maps?q=39.9968,-82.9882&z=6 X-CanItPRO-Stream: outbound X-Scanned-By: CanIt (www . roaringpenguin . com) on 83.161.120.155 X-Virus-Checked: Checked by ClamAV on apache.org As a starting point for discussion, I would like to propose that we request the following changes from the infrastructure team to complete the migration of Santuario to a TLP. I'm looking at the example of Axis here: https://issues.apache.org/jira/browse/INFRA-2441 [0] Root Tasks I believe the santuario Unix group and DNS alias are already created, so this is done. [1] Mailing Lists This change was never made. We should migrate zcarey@example.org to a new zcarey@example.org, and we *could* create a zcarey@example.org list if we want that separated. Personally, I don't think the traffic is enough to bother. [2] Source Code I would suggest we reorganize svn like so: /xml/security/trunk/c => /santuario/xml-security/cpp/trunk (plus branches/tags) /xml/security/trunk (minus the c/) => /santuario/xml-security/java/trunk (plus branches and tags) For now we can leave the web site generation stuff in the Java area until we can dump the site altogether and use the wiki. We probably need to find out from them what we can do with the tags and branches. If need be we could just copy those to a special historical location under /santuario/xml-security since they include the C++ and Java bits. Initial access should be the same committer set we have now, plus Chad who I think still doesn't have an account. [3] Distributions I believe we need to have a santuario directory added to http://www.apache.org/dist [4] Bugs I would also request Jira projects be added for XMLSecurity-C++ and XMLSecurity-Java, but only if they do bug imports. If not, I'd suggest we wait until the next set of releases and then do the move. [5] Wiki I would like to have a wiki space zcarey@example.org/santuario. I think that's actually a separate Jira request to the wiki category, so we can probably do that any time. Once we have things moved and finished, we can talk about the web site changing. Thoughts? -- Scott From securityzcarey@example.org Mon Aug 02 14:28:38 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 63746 invoked from network); 2 Aug 2010 14:28:38 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Aug 2010 14:28:38 -0000 Received: (qmail 16418 invoked by uid 500); 2 Aug 2010 14:28:38 -0000 Delivered-To: zcarey@example.org Received: (qmail 16270 invoked by uid 500); 2 Aug 2010 14:28:36 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 16261 invoked by uid 99); 2 Aug 2010 14:28:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 14:28:35 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-iw0-f169.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 14:28:27 +0000 Received: by iwn2 with SMTP id 2so4383801iwn.28 for <zcarey@example.org>; Mon, 02 Aug 2010 07:28:06 -0700 (PDT) Received: by 83.161.120.155 with SMTP id w9mr1684825ibw.99.1280759285139; Mon, 02 Aug 2010 07:28:05 -0700 (PDT) Received: from lypse.local (c-68-40-239-226.hsd1.mi.comcast.net [83.161.120.155]) by mx.google.com with ESMTPS id n20sm5537927ibe.17.283.161.120.155.28.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Aug 2010 07:28:04 -0700 (PDT) Message-ID: <zcarey@example.org> Date: Mon, 02 Aug 2010 10:27:59 -0400 From: Chad La Joie <zcarey@example.org> Organization: Itumi, LLC User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:83.161.120.155) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: zcarey@example.org Subject: Re: Santuario infra changes References: <zcarey@example.org> In-Reply-To: <zcarey@example.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 8/2/10 10:13 AM, Scott Cantor wrote: > [2] Source Code > > I would suggest we reorganize svn like so: > > /xml/security/trunk/c => /santuario/xml-security/cpp/trunk (plus > branches/tags) > /xml/security/trunk (minus the c/) => /santuario/xml-security/java/trunk > (plus branches and tags) Is there really any expectation that santuario would house something other than the security library? If not, why not drop "xml-security" from the path? Or maybe xml-security-cpp and xml-security-java. > We probably need to find out from them what we can do with the tags and > branches. If need be we could just copy those to a special historical > location under /santuario/xml-security since they include the C++ and Java > bits. If the infra people will do a full export of the "xml/security" repo and import it into the santuario repo you don't need to do anything with the existing branches or tags. You just re-org trunk, as described above. As long as you're using SVN moves everything in the existing branches/tags will be just fine. > Initial access should be the same committer set we have now, plus Chad who I > think still doesn't have an account. No, no account (that I know of) yet. :( -- Chad La Joie http://itumi.biz trusted identities, delivered From securityzcarey@example.org Mon Aug 02 14:32:48 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 65879 invoked from network); 2 Aug 2010 14:32:48 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Aug 2010 14:32:48 -0000 Received: (qmail 25215 invoked by uid 500); 2 Aug 2010 14:32:48 -0000 Delivered-To: zcarey@example.org Received: (qmail 25094 invoked by uid 500); 2 Aug 2010 14:32:46 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 25080 invoked by uid 99); 2 Aug 2010 14:32:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 14:32:46 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of zcarey@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO defang2.it.ohio-state.edu) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 14:32:36 +0000 Received: from defang9.it.ohio-state.edu (defang9.it.ohio-state.edu [83.161.120.155]) by defang2.it.ohio-state.edu (8.13.7/8.13.1) with ESMTP id o72EWFZ9028111; Mon, 2 Aug 2010 10:32:15 -0400 Received: from SNOWDOG (SNOWDOG.dyn.cio.osu.edu [83.161.120.155]) by defang9.it.ohio-state.edu (8.13.7/8.13.1) with ESMTP id o72EWF31018508; Mon, 2 Aug 2010 10:32:15 -0400 From: "Scott Cantor" <zcarey@example.org> To: <zcarey@example.org> Cc: <zcarey@example.org> References: <zcarey@example.org> <zcarey@example.org> In-Reply-To: <zcarey@example.org> Subject: RE: Santuario infra changes Date: Mon, 2 Aug 2010 10:32:25 -0400 Organization: The Ohio State University Message-ID: <zcarey@example.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQIxC/q+d4czV/SG+VJU1mY3jfzKiAIf3cLNkfGHXlA= Content-language: en-us X-Spam-Score: 0.00 () [zcarey@example.org] SPF(pass,0) X-CanIt-Geo: ip=83.161.120.155; country=US; region=OH; city=Columbus; latitude=39.9968; longitude=-82.9882; metrocode=535; areacode=614; http://maps.google.com/maps?q=39.9968,-82.9882&z=6 X-CanItPRO-Stream: outbound X-Scanned-By: CanIt (www . roaringpenguin . com) on 83.161.120.155 X-Virus-Checked: Checked by ClamAV on apache.org > Is there really any expectation that santuario would house something > other than the security library? If not, why not drop "xml-security" > from the path? Or maybe xml-security-cpp and xml-security-java. I was reserving the possibility (otherwise why bother with the TLP, let's just go back under XML and save time), but the latter suggestion solves the same problem without the need to rename the svn checkout, so that's fine. -- Scott From securityzcarey@example.org Mon Aug 02 15:05:04 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 82520 invoked from network); 2 Aug 2010 15:05:04 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Aug 2010 15:05:04 -0000 Received: (qmail 77326 invoked by uid 500); 2 Aug 2010 15:05:04 -0000 Delivered-To: zcarey@example.org Received: (qmail 77224 invoked by uid 500); 2 Aug 2010 15:05:03 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 77209 invoked by uid 99); 2 Aug 2010 15:05:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 15:05:03 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of zcarey@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO defang2.it.ohio-state.edu) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 15:04:52 +0000 Received: from defang6.it.ohio-state.edu (defang6.it.ohio-state.edu [83.161.120.155]) by defang2.it.ohio-state.edu (8.13.7/8.13.1) with ESMTP id o72F4VgM009520; Mon, 2 Aug 2010 11:04:31 -0400 Received: from SNOWDOG (SNOWDOG.dyn.cio.osu.edu [83.161.120.155]) by defang6.it.ohio-state.edu (8.13.7/8.13.1) with ESMTP id o72F4UAM022126; Mon, 2 Aug 2010 11:04:30 -0400 From: "Scott Cantor" <zcarey@example.org> To: <zcarey@example.org> Cc: <zcarey@example.org> References: <zcarey@example.org> <zcarey@example.org> In-Reply-To: <zcarey@example.org> Subject: RE: Santuario infra changes Date: Mon, 2 Aug 2010 11:04:41 -0400 Organization: The Ohio State University Message-ID: <zcarey@example.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQIxC/q+d4czV/SG+VJU1mY3jfzKiAHisAE8kfN40lA= Content-language: en-us X-Spam-Score: 0.00 () [zcarey@example.org] SPF(pass,0) X-CanIt-Geo: ip=83.161.120.155; country=US; region=OH; city=Columbus; latitude=39.9968; longitude=-82.9882; metrocode=535; areacode=614; http://maps.google.com/maps?q=39.9968,-82.9882&z=6 X-CanItPRO-Stream: outbound X-Scanned-By: CanIt (www . roaringpenguin . com) on 83.161.120.155 X-Virus-Checked: Checked by ClamAV on apache.org > > I believe the santuario Unix group and DNS alias are already created, so > > this is done. > > Do we need a santuario-pmc group as well? I wasn't sure if that was done or not, but yeah, if it's not there, we need LDAP groups for both. We can just ask. I suggest we wait for comments by end of day today, and then Colm, if you could file the request to INFRA and the WIKI group? It sounds like we want: - check on the santuario-pmc group - migrate the list to zcarey@example.org - bulk migrate /xml/security into /santuario and then just reorg the trunk ourselves once it's done? - add the santuario folder to www.apache.org/dist - ask about Jira, specifically if they import bugs or not - get a wiki space created (with edit access by the santuario LDAP group, I assume) -- Scott From securityzcarey@example.org Tue Aug 03 10:23:53 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 32933 invoked from network); 3 Aug 2010 10:23:52 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 3 Aug 2010 10:23:52 -0000 Received: (qmail 12414 invoked by uid 500); 3 Aug 2010 10:23:52 -0000 Delivered-To: zcarey@example.org Received: (qmail 12126 invoked by uid 500); 3 Aug 2010 10:23:49 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 12103 invoked by uid 99); 3 Aug 2010 10:23:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 10:23:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO thor.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 10:23:46 +0000 Received: from thor.apache.org (localhost [83.161.120.155]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o73ANOj8013028 for <zcarey@example.org>; Tue, 3 Aug 2010 10:23:24 GMT Received: (from daemon@localhost) by thor.apache.org (8.13.8+Sun/8.13.8/Submit) id o73ANN89013027; Tue, 3 Aug 2010 06:23:23 -0400 (EDT) Date: Tue, 3 Aug 2010 06:23:23 -0400 (EDT) From: zcarey@example.org To: zcarey@example.org Subject: DO NOT REPLY [Bug 49692] New: xmlsec 1.4.3 not compatible with xmlbeans 2.4.0 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Security X-Bugzilla-Component: Encryption X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zcarey@example.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: zcarey@example.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: <zcarey@example.org/bugzilla/> X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=49692 Summary: xmlsec 1.4.3 not compatible with xmlbeans 2.4.0 Product: Security Version: Java 1.4.2 Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Encryption AssignedTo: zcarey@example.org ReportedBy: zcarey@example.org See this bug for details: https://issues.apache.org/jira/browse/WSS-235 IdResolver.java was refactored from release xmlsec/1.3.0 to xmlsec/1.4.3. Symptoms: zcarey@example.org(Unknown Source) at org.apache.xml.security.utils.IdResolver.getEl(Unknown Source) at org.apache.xml.security.utils.IdResolver.getElementBySearching(Unknown Source) at org.apache.xml.security.utils.IdResolver.getElementById(Unknown Source) at org.apache.xml.security.utils.resolver.implementations.ResolverFragment.engineResolve(Unknown Source) at org.apache.xml.security.utils.resolver.ResourceResolver.resolve(Unknown Source) Problem: Under certain circumstances, the ID attribute of an XML node in the XMLBeans DOM implementation is treated as !nodeCanHavePrefixUri -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From securityzcarey@example.org Tue Aug 03 10:37:00 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 39102 invoked from network); 3 Aug 2010 10:37:00 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 3 Aug 2010 10:37:00 -0000 Received: (qmail 24210 invoked by uid 500); 3 Aug 2010 10:36:59 -0000 Delivered-To: zcarey@example.org Received: (qmail 24039 invoked by uid 500); 3 Aug 2010 10:36:57 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 24032 invoked by uid 99); 3 Aug 2010 10:36:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 10:36:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO thor.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 10:36:56 +0000 Received: from thor.apache.org (localhost [83.161.120.155]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o73AaaHZ013124 for <zcarey@example.org>; Tue, 3 Aug 2010 10:36:36 GMT Received: (from daemon@localhost) by thor.apache.org (8.13.8+Sun/8.13.8/Submit) id o73AaZRM013123; Tue, 3 Aug 2010 06:36:35 -0400 (EDT) Date: Tue, 3 Aug 2010 06:36:35 -0400 (EDT) Message-Id: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: DO NOT REPLY [Bug 49692] xmlsec 1.4.3 not compatible with xmlbeans 2.4.0 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Security X-Bugzilla-Component: Encryption X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zcarey@example.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: zcarey@example.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Resolution In-Reply-To: <zcarey@example.org/bugzilla/> References: <zcarey@example.org/bugzilla/> X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 https://issues.apache.org/bugzilla/show_bug.cgi?id=49692 coheigea <zcarey@example.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From securityzcarey@example.org Tue Aug 03 10:55:23 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 42514 invoked from network); 3 Aug 2010 10:55:23 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 3 Aug 2010 10:55:23 -0000 Received: (qmail 39443 invoked by uid 500); 3 Aug 2010 10:55:23 -0000 Delivered-To: zcarey@example.org Received: (qmail 39219 invoked by uid 500); 3 Aug 2010 10:55:21 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 39208 invoked by uid 99); 3 Aug 2010 10:55:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 10:55:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 03 Aug 2010 10:55:19 +0000 Received: (qmail 42441 invoked by uid 99); 3 Aug 2010 10:54:59 -0000 Received: from localhost.apache.org (HELO mail-bw0-f41.google.com) (83.161.120.155) (smtp-auth username coheigea, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 10:54:59 +0000 Received: by bwz9 with SMTP id 9so2374042bwz.28 for <zcarey@example.org>; Tue, 03 Aug 2010 03:54:56 -0700 (PDT) MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id bn19mr5142381bkb.15.1280832896849; Tue, 03 Aug 2010 03:54:56 -0700 (PDT) Reply-To: zcarey@example.org Received: by 83.161.120.155 with HTTP; Tue, 3 Aug 2010 03:54:56 -0700 (PDT) In-Reply-To: <zcarey@example.org> References: <zcarey@example.org> Date: Tue, 3 Aug 2010 11:54:56 +0100 Message-ID: <zcarey@example.org> Subject: Re: Status of == vs equals() From: Colm O hEigeartaigh <zcarey@example.org> To: zcarey@example.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Chad, > My recommendation then is two fold: > - Ensure that nothing other than namespace bits are compared via =3D=3D.= I > don't know that this occurs but the code should definitely be reviewed to > ensure that. Agreed. > - Create a new "NamespaceEqualityChecker" that provides methods for > checking the various bits of a namespace (URIs, prefixes) and use it > anywhere that either =3D=3D or equals() is used today. Implementations b= ased on > =3D=3D and equals() would be provided with the default implementation bei= ng > equals()-based. A configuration option should then be made available to > control which impl gets used. Sounds good. Have you thought about backwards compatibility issues though, in relation to the ElementCheckerImpl? We don't want to break backwards compatibility for a minor release if at all possible. > I think that this should be addressed in the upcoming 1.4.4 release. If > quick consensus can be reached I'm willing to do the work with a window o= f > time I have available over the next 2-3 weeks. That would be great! It would be interesting to run some benchmarks when you're done to compare both options. Colm. On Mon, Aug 2, 2010 at 3:11 PM, Chad La Joie <zcarey@example.org> wrote: > So, while I don't have my access yet, Colm asked me if I'd take a look at > the =3D=3D vs equals() issue (relevant bugs: 40897[1], 45637[2], 46681[3]= ) > > My executive summary is that clearly, as things stand, the current code > favors optimization over correctness. =A0Rarely is this a good thing. > > Colm notes[4] that the reliance on intern'ed strings (and thus the abilit= y > to use =3D=3D) occurs sporadically throughout the code and not just withi= n the > ElementChecker implementations. =A0He specifically mentioned that the var= ious > C14N implementations, and indeed the =3D=3D is used about 6 times there f= or > string comparison. > > My recommendation then is two fold: > =A0- Ensure that nothing other than namespace bits are compared via =3D= =3D. I > don't know that this occurs but the code should definitely be reviewed to > ensure that. > > =A0- Create a new "NamespaceEqualityChecker" that provides methods for > checking the various bits of a namespace (URIs, prefixes) and use it > anywhere that either =3D=3D or equals() is used today. =A0Implementations= based on > =3D=3D and equals() would be provided with the default implementation bei= ng > equals()-based. =A0A configuration option should then be made available t= o > control which impl gets used. =A0Additionally, it might even be possible = to > add some smarts that could detect known "good" parsers that use interning > and automatically use the =3D=3D based implementation. > > I do not recommend changing any part of the code without addressing the > whole codebase (i.e. all the =3D=3D's need to be fixed or no change shoul= d be > made) because of the possibility of creating new, unwanted, effects. =A0T= he > current functionality is undesirable but better the devil you know. > > I think that this should be addressed in the upcoming 1.4.4 release. =A0I= f > quick consensus can be reached I'm willing to do the work with a window o= f > time I have available over the next 2-3 weeks. > > [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=3D40897 > [2] https://issues.apache.org/bugzilla/show_bug.cgi?id=3D45637 > [3] https://issues.apache.org/bugzilla/show_bug.cgi?id=3D46681 > [4] https://issues.apache.org/bugzilla/show_bug.cgi?id=3D45637#c1 > -- > Chad La Joie > http://itumi.biz > trusted identities, delivered > From securityzcarey@example.org Tue Aug 03 13:15:34 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 3396 invoked from network); 3 Aug 2010 13:15:34 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 3 Aug 2010 13:15:34 -0000 Received: (qmail 61700 invoked by uid 500); 3 Aug 2010 13:15:34 -0000 Delivered-To: zcarey@example.org Received: (qmail 61557 invoked by uid 500); 3 Aug 2010 13:15:32 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 61544 invoked by uid 99); 3 Aug 2010 13:15:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 13:15:32 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-wy0-f169.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 13:15:25 +0000 Received: by wyg36 with SMTP id 36so4637495wyg.28 for <zcarey@example.org>; Tue, 03 Aug 2010 06:15:05 -0700 (PDT) MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id m7mr6457372wbt.11.1280841304690; Tue, 03 Aug 2010 06:15:04 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Tue, 3 Aug 2010 06:15:04 -0700 (PDT) In-Reply-To: <zcarey@example.org> References: <zcarey@example.org> <zcarey@example.org> Date: Tue, 3 Aug 2010 09:15:04 -0400 Message-ID: <zcarey@example.org> Subject: Re: Status of == vs equals() From: Chad La Joie <zcarey@example.org> To: zcarey@example.org, zcarey@example.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Aug 3, 2010 at 06:54, Colm O hEigeartaigh <zcarey@example.org> wro= te: >> =A0- Create a new "NamespaceEqualityChecker" that provides methods for >> checking the various bits of a namespace (URIs, prefixes) and use it >> anywhere that either =3D=3D or equals() is used today. =A0Implementation= s based on >> =3D=3D and equals() would be provided with the default implementation be= ing >> equals()-based. =A0A configuration option should then be made available = to >> control which impl gets used. > > Sounds good. Have you thought about backwards compatibility issues > though, in relation to the ElementCheckerImpl? We don't want to break > backwards compatibility for a minor release if at all possible. Yeah, just replace the innards of the ElementCheckerImpls with calls to the corresponding NamespaceEqualityChecker impls that correspond to that functionality and mark ElementChecker as deprecated. Then it can be removed later. --=20 Chad La Joie www.itumi.biz trusted identities, delivered From securityzcarey@example.org Thu Aug 05 14:16:32 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 84602 invoked from network); 5 Aug 2010 14:16:32 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Aug 2010 14:16:32 -0000 Received: (qmail 12747 invoked by uid 500); 5 Aug 2010 14:16:32 -0000 Delivered-To: zcarey@example.org Received: (qmail 12598 invoked by uid 500); 5 Aug 2010 14:16:30 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 12591 invoked by uid 99); 5 Aug 2010 14:16:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:16:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO thor.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:16:29 +0000 Received: from thor.apache.org (localhost [83.161.120.155]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o75EG8Vo005587 for <zcarey@example.org>; Thu, 5 Aug 2010 14:16:08 GMT Received: (from daemon@localhost) by thor.apache.org (8.13.8+Sun/8.13.8/Submit) id o75EG8PI005586; Thu, 5 Aug 2010 10:16:08 -0400 (EDT) Date: Thu, 5 Aug 2010 10:16:08 -0400 (EDT) From: zcarey@example.org To: zcarey@example.org Subject: DO NOT REPLY [Bug 49710] New: exc-c14n damages namespaces of XML X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Security X-Bugzilla-Component: Canonicalization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zcarey@example.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: zcarey@example.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: <zcarey@example.org/bugzilla/> X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 https://issues.apache.org/bugzilla/show_bug.cgi?id=49710 Summary: exc-c14n damages namespaces of XML Product: Security Version: Java 1.4.2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Canonicalization AssignedTo: zcarey@example.org ReportedBy: zcarey@example.org The canonicalizer (java) with exc-c14n produces an invalid XML document here. It removes a namespace from an attribute that is still used in that element. It attach an example xsd and xml file. If I use canonicalize this xml file with exc-c14n it will remove the namespace xmlns:xs="http://www.w3.org/2001/XMLSchema". So the attribute ns:type="xs:string" won't be valid afterwards. Even if I add the namespace to the root element (bla:document) it will be removed. Validated with xmllint --noout --schema example.xsd example.xml Is this really correct for this canonicalization method to damage the xml file? -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From securityzcarey@example.org Thu Aug 05 14:18:30 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 85707 invoked from network); 5 Aug 2010 14:18:30 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Aug 2010 14:18:30 -0000 Received: (qmail 15528 invoked by uid 500); 5 Aug 2010 14:18:30 -0000 Delivered-To: zcarey@example.org Received: (qmail 15414 invoked by uid 500); 5 Aug 2010 14:18:28 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 15404 invoked by uid 99); 5 Aug 2010 14:18:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:18:27 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO thor.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:18:25 +0000 Received: from thor.apache.org (localhost [83.161.120.155]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o75EI4hB005621 for <zcarey@example.org>; Thu, 5 Aug 2010 14:18:04 GMT Received: (from daemon@localhost) by thor.apache.org (8.13.8+Sun/8.13.8/Submit) id o75EI4v1005620; Thu, 5 Aug 2010 10:18:04 -0400 (EDT) Date: Thu, 5 Aug 2010 10:18:04 -0400 (EDT) Message-Id: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: DO NOT REPLY [Bug 49710] exc-c14n damages namespaces of XML X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Security X-Bugzilla-Component: Canonicalization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zcarey@example.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: zcarey@example.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: <zcarey@example.org/bugzilla/> References: <zcarey@example.org/bugzilla/> X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=49710 --- Comment #1 from AK <zcarey@example.org> 2010-08-05 10:18:01 EDT --- Created an attachment (id=25845) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25845) XML Schema -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From securityzcarey@example.org Thu Aug 05 14:20:42 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 86226 invoked from network); 5 Aug 2010 14:20:41 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Aug 2010 14:20:41 -0000 Received: (qmail 17139 invoked by uid 500); 5 Aug 2010 14:20:41 -0000 Delivered-To: zcarey@example.org Received: (qmail 17054 invoked by uid 500); 5 Aug 2010 14:20:39 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 17020 invoked by uid 99); 5 Aug 2010 14:20:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:20:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO thor.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:20:38 +0000 Received: from thor.apache.org (localhost [83.161.120.155]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o75EKIrU005644 for <zcarey@example.org>; Thu, 5 Aug 2010 14:20:18 GMT Received: (from daemon@localhost) by thor.apache.org (8.13.8+Sun/8.13.8/Submit) id o75EKIOO005643; Thu, 5 Aug 2010 10:20:18 -0400 (EDT) Date: Thu, 5 Aug 2010 10:20:18 -0400 (EDT) Message-Id: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: DO NOT REPLY [Bug 49710] exc-c14n damages namespaces of XML X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Security X-Bugzilla-Component: Canonicalization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zcarey@example.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: zcarey@example.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: <zcarey@example.org/bugzilla/> References: <zcarey@example.org/bugzilla/> X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 https://issues.apache.org/bugzilla/show_bug.cgi?id=49710 --- Comment #2 from AK <zcarey@example.org> 2010-08-05 10:20:16 EDT --- Created an attachment (id=25846) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25846) XML File -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From securityzcarey@example.org Thu Aug 05 14:21:48 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 86400 invoked from network); 5 Aug 2010 14:21:47 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Aug 2010 14:21:47 -0000 Received: (qmail 17893 invoked by uid 500); 5 Aug 2010 14:21:47 -0000 Delivered-To: zcarey@example.org Received: (qmail 17737 invoked by uid 500); 5 Aug 2010 14:21:46 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 17730 invoked by uid 99); 5 Aug 2010 14:21:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:21:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO thor.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:21:45 +0000 Received: from thor.apache.org (localhost [83.161.120.155]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o75ELOTm005652 for <zcarey@example.org>; Thu, 5 Aug 2010 14:21:24 GMT Received: (from daemon@localhost) by thor.apache.org (8.13.8+Sun/8.13.8/Submit) id o75ELObm005651; Thu, 5 Aug 2010 10:21:24 -0400 (EDT) Date: Thu, 5 Aug 2010 10:21:24 -0400 (EDT) Message-Id: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: DO NOT REPLY [Bug 49710] exc-c14n damages namespaces of XML X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Security X-Bugzilla-Component: Canonicalization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zcarey@example.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: zcarey@example.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: <zcarey@example.org/bugzilla/> References: <zcarey@example.org/bugzilla/> X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 https://issues.apache.org/bugzilla/show_bug.cgi?id=49710 --- Comment #3 from AK <zcarey@example.org> 2010-08-05 10:21:22 EDT --- Created an attachment (id=25847) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25847) XML File (after canonicalization - invalid in schema checking) -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From securityzcarey@example.org Thu Aug 05 14:30:38 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 93621 invoked from network); 5 Aug 2010 14:30:38 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Aug 2010 14:30:38 -0000 Received: (qmail 38833 invoked by uid 500); 5 Aug 2010 14:30:38 -0000 Delivered-To: zcarey@example.org Received: (qmail 38607 invoked by uid 500); 5 Aug 2010 14:30:35 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 38600 invoked by uid 99); 5 Aug 2010 14:30:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:30:35 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-yx0-f169.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:30:28 +0000 Received: by yxs7 with SMTP id 7so2873453yxs.28 for <zcarey@example.org>; Thu, 05 Aug 2010 07:30:07 -0700 (PDT) Received: by 83.161.120.155 with SMTP id g8mr11958345anc.174.1281018606974; Thu, 05 Aug 2010 07:30:06 -0700 (PDT) Received: from lypse.local (c-68-40-239-226.hsd1.mi.comcast.net [83.161.120.155]) by mx.google.com with ESMTPS id i25sm334953anh.17.283.161.120.155.30.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 05 Aug 2010 07:30:06 -0700 (PDT) Message-ID: <zcarey@example.org> Date: Thu, 05 Aug 2010 10:30:04 -0400 From: Chad La Joie <zcarey@example.org> Organization: Itumi, LLC User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:83.161.120.155) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: zcarey@example.org Subject: Re: DO NOT REPLY [Bug 49710] New: exc-c14n damages namespaces of XML References: <zcarey@example.org/bugzilla/> In-Reply-To: <zcarey@example.org/bugzilla/> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sean, Colm could you please hold off on doing any changes to the Canonicalizers for a day or two. Those were the classes that most heavily used the == so I have some local changes here that I'll be submitting a patch for quite soon. On 8/5/10 10:16 AM, zcarey@example.org wrote: > https://issues.apache.org/bugzilla/show_bug.cgi?id=49710 > > Summary: exc-c14n damages namespaces of XML > Product: Security > Version: Java 1.4.2 > Platform: All > OS/Version: All > Status: NEW > Severity: normal > Priority: P2 > Component: Canonicalization > AssignedTo: zcarey@example.org > ReportedBy: zcarey@example.org > > > The canonicalizer (java) with exc-c14n produces an invalid XML document here. > It removes a namespace from an attribute that is still used in that element. It > attach an example xsd and xml file. > If I use canonicalize this xml file with exc-c14n it will remove the namespace > xmlns:xs="http://www.w3.org/2001/XMLSchema". So the attribute > ns:type="xs:string" won't be valid afterwards. > Even if I add the namespace to the root element (bla:document) it will be > removed. > > Validated with xmllint --noout --schema example.xsd example.xml > > Is this really correct for this canonicalization method to damage the xml file? > -- Chad La Joie http://itumi.biz trusted identities, delivered From securityzcarey@example.org Thu Aug 05 14:33:46 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 95887 invoked from network); 5 Aug 2010 14:33:46 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Aug 2010 14:33:46 -0000 Received: (qmail 47246 invoked by uid 500); 5 Aug 2010 14:33:45 -0000 Delivered-To: zcarey@example.org Received: (qmail 46974 invoked by uid 500); 5 Aug 2010 14:33:44 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 46967 invoked by uid 99); 5 Aug 2010 14:33:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:33:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO thor.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:33:41 +0000 Received: from thor.apache.org (localhost [83.161.120.155]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o75EXJgi005782 for <zcarey@example.org>; Thu, 5 Aug 2010 14:33:19 GMT Received: (from daemon@localhost) by thor.apache.org (8.13.8+Sun/8.13.8/Submit) id o75EXJNU005781; Thu, 5 Aug 2010 10:33:19 -0400 (EDT) Date: Thu, 5 Aug 2010 10:33:19 -0400 (EDT) Message-Id: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: DO NOT REPLY [Bug 49710] exc-c14n damages namespaces of XML X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Security X-Bugzilla-Component: Canonicalization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zcarey@example.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: zcarey@example.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: <zcarey@example.org/bugzilla/> References: <zcarey@example.org/bugzilla/> X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=49710 --- Comment #4 from AK <zcarey@example.org> 2010-08-05 10:33:16 EDT --- damaged.xml:4: element value: Schemas validity error : Element '{http://test/1.0}value', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The QName value 'xs:string' has no corresponding namespace declaration in scope. damaged.xml fails to validate -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From securityzcarey@example.org Thu Aug 05 14:38:01 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 97304 invoked from network); 5 Aug 2010 14:38:01 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Aug 2010 14:38:01 -0000 Received: (qmail 54874 invoked by uid 500); 5 Aug 2010 14:38:01 -0000 Delivered-To: zcarey@example.org Received: (qmail 54716 invoked by uid 500); 5 Aug 2010 14:37:59 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 54691 invoked by uid 99); 5 Aug 2010 14:37:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:37:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO thor.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:37:57 +0000 Received: from thor.apache.org (localhost [83.161.120.155]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o75EbbkJ005822 for <zcarey@example.org>; Thu, 5 Aug 2010 14:37:37 GMT Received: (from daemon@localhost) by thor.apache.org (8.13.8+Sun/8.13.8/Submit) id o75EbaTB005821; Thu, 5 Aug 2010 10:37:36 -0400 (EDT) Date: Thu, 5 Aug 2010 10:37:36 -0400 (EDT) Message-Id: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: DO NOT REPLY [Bug 49710] exc-c14n damages namespaces of XML X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Security X-Bugzilla-Component: Canonicalization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zcarey@example.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: zcarey@example.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Resolution In-Reply-To: <zcarey@example.org/bugzilla/> References: <zcarey@example.org/bugzilla/> X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 https://issues.apache.org/bugzilla/show_bug.cgi?id=49710 Scott Cantor <zcarey@example.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #5 from Scott Cantor <zcarey@example.org> 2010-08-05 10:37:34 EDT --- Your example is not a bug. Exclusive c14n does not handle namespace prefixes found in QName content, including xsi:type attributes. If you have such cases, you have to force inclusive mode using the InclusivePrefix list. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. From securityzcarey@example.org Mon Aug 09 14:20:16 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 31836 invoked from network); 9 Aug 2010 14:20:16 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 9 Aug 2010 14:20:16 -0000 Received: (qmail 21298 invoked by uid 500); 9 Aug 2010 14:20:16 -0000 Delivered-To: zcarey@example.org Received: (qmail 21155 invoked by uid 500); 9 Aug 2010 14:20:13 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 21147 invoked by uid 99); 9 Aug 2010 14:20:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 14:20:13 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-gx0-f169.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 14:20:05 +0000 Received: by gxk4 with SMTP id 4so4251575gxk.28 for <zcarey@example.org>; Mon, 09 Aug 2010 07:19:44 -0700 (PDT) Received: by 83.161.120.155 with SMTP id e5mr18053972ann.138.1281363584545; Mon, 09 Aug 2010 07:19:44 -0700 (PDT) Received: from lypse.local (c-68-40-239-226.hsd1.mi.comcast.net [83.161.120.155]) by mx.google.com with ESMTPS id t24sm8651823ano.12.283.161.120.155.19.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Aug 2010 07:19:43 -0700 (PDT) Message-ID: <zcarey@example.org> Date: Mon, 09 Aug 2010 10:19:41 -0400 From: Chad La Joie <zcarey@example.org> Organization: Itumi, LLC User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:83.161.120.155) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: zcarey@example.org Subject: Re: Status of == vs equals() RESULTS References: <zcarey@example.org> In-Reply-To: <zcarey@example.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit So, I have some unexpected results from this work. I implemented a helper class that checked the equality of element local names, attribute local names, namespace URIs, and namespace prefixes (i.e. everything that Xerces always interns). Then I made sure to replace all == != and equals() that I could find with the appropriate call. To test, I picked the Canonicalizer20010315ExclusiveTest test case and made two alterations to the test22*excl methods: - do one c14n operation out the timing loop just to make sure all the classes are in memory, constants are loaded, etc. - in a 100 iteration loop, create a new canonicalizer, canonicalize a DOM tree, and time it using nanosecond time I did this for the example2_2_1.xml[1], example2_2_2.xml[2], example 2_2_3.xml[3] input files (test221excl, test221excl, test223excl respectively). Here are the results, measured in nanosecond timing. "total" indicates the total time spent in all 100 runs, i.e. the summation of each of the 100 results. test221excl: equals() == min 101000 99000 max 123000 191000 median 103000 105000 avg 103760 106540 total 10376000 10654000 test222excl: equals() == min 99000 101000 max 192000 128000 median 100000 108000 avg 102110 108480 total 10211000 10848000 test223excl (an XPath nodeset canonicalization) equals() == min 254000 248000 max 290000 353000 median 266000 265000 avg 266820 265800 total 26682000 26580000 So, what these numbers appear to suggest is that, in fact, equals() is more often faster than ==. This seems counter-intuitive unless the JVM has specialized optimization for the String.equals() method. Can anyone see where my testing is likely to be flawed? [1] http://svn.apache.org/viewvc/xml/security/trunk/data/org/apache/xml/security/c14n/inExcl/example2_2_1.xml?revision=350494&view=markup [2] http://svn.apache.org/viewvc/xml/security/trunk/data/org/apache/xml/security/c14n/inExcl/example2_2_2.xml?revision=350494&view=markup [3] http://svn.apache.org/viewvc/xml/security/trunk/data/org/apache/xml/security/c14n/inExcl/example2_2_3.xml?revision=350915&view=markup On 8/2/10 10:11 AM, Chad La Joie wrote: > So, while I don't have my access yet, Colm asked me if I'd take a look > at the == vs equals() issue (relevant bugs: 40897[1], 45637[2], 46681[3]) > > My executive summary is that clearly, as things stand, the current code > favors optimization over correctness. Rarely is this a good thing. > > Colm notes[4] that the reliance on intern'ed strings (and thus the > ability to use ==) occurs sporadically throughout the code and not just > within the ElementChecker implementations. He specifically mentioned > that the various C14N implementations, and indeed the == is used about 6 > times there for string comparison. > > My recommendation then is two fold: > - Ensure that nothing other than namespace bits are compared via ==. I > don't know that this occurs but the code should definitely be reviewed > to ensure that. > > - Create a new "NamespaceEqualityChecker" that provides methods for > checking the various bits of a namespace (URIs, prefixes) and use it > anywhere that either == or equals() is used today. Implementations based > on == and equals() would be provided with the default implementation > being equals()-based. A configuration option should then be made > available to control which impl gets used. Additionally, it might even > be possible to add some smarts that could detect known "good" parsers > that use interning and automatically use the == based implementation. > > I do not recommend changing any part of the code without addressing the > whole codebase (i.e. all the =='s need to be fixed or no change should > be made) because of the possibility of creating new, unwanted, effects. > The current functionality is undesirable but better the devil you know. > > I think that this should be addressed in the upcoming 1.4.4 release. If > quick consensus can be reached I'm willing to do the work with a window > of time I have available over the next 2-3 weeks. > > [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=40897 > [2] https://issues.apache.org/bugzilla/show_bug.cgi?id=45637 > [3] https://issues.apache.org/bugzilla/show_bug.cgi?id=46681 > [4] https://issues.apache.org/bugzilla/show_bug.cgi?id=45637#c1 -- Chad La Joie http://itumi.biz trusted identities, delivered From securityzcarey@example.org Mon Aug 09 14:41:30 2010 Return-Path: <securityzcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 47940 invoked from network); 9 Aug 2010 14:41:30 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 9 Aug 2010 14:41:30 -0000 Received: (qmail 61015 invoked by uid 500); 9 Aug 2010 14:41:30 -0000 Delivered-To: zcarey@example.org Received: (qmail 60779 invoked by uid 500); 9 Aug 2010 14:41:28 -0000 Mailing-List: contact zcarey@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:zcarey@example.org> List-Help: <mailto:zcarey@example.org> List-Unsubscribe: <mailto:zcarey@example.org> Reply-To: zcarey@example.org List-Id: <security-dev.xml.apache.org> Delivered-To: mailing list zcarey@example.org Received: (qmail 60770 invoked by uid 99); 9 Aug 2010 14:41:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 14:41:27 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zcarey@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-pw0-f41.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 14:41:22 +0000 Received: by pwj7 with SMTP id 7so1796278pwj.28 for <zcarey@example.org>; Mon, 09 Aug 2010 07:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=IcDNcDdudSM/etu2dFvZ+HYQQd91dQJJhQHfB2E262A=; b=rbfN4bb+KMjr6BTBYFAc0rHTCe/PFbRldBN0mTjDnWM7xREJtKn29ozT7Ppjmddn2t LqGfCWqKSMgPGLQ+lCL1lFFmqVxCvT4u/7z8MGspLQSt05VcNCx1oCPcXbMfOWuN67LE qKOXuKDz6vtGd2lkD1ajPgmQrBRt3GI/eAzq0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=Q8G1fLNtAN1U3ETfW4FuF/QBhgDEESfH79m6PAQ5VePet9teNVdCSwJxG7WaxzEOW9 hWQZyHjKFQMPRTDjsIfqjLsR4dtKqBz7PgDw8YNJnaTNIztjYw8HZISdSMc1YE5a2Jd4 AbhWJkx82yN9kEpiCKPqTc0y/VMKsO9XpwkNs= Received: by 83.161.120.155 with SMTP id x21mr13722640wff.207.1281364861553; Mon, 09 Aug 2010 07:41:01 -0700 (PDT) MIME-Version: 1.0 Sender: zcarey@example.org Received: by 83.161.120.155 with HTTP; Mon, 9 Aug 2010 07:40:41 -0700 (PDT) In-Reply-To: <zcarey@example.org> References: <zcarey@example.org> <zcarey@example.org> From: Raul Benito <zcarey@example.org> Date: Mon, 9 Aug 2010 16:40:41 +0200 X-Google-Sender-Auth: Jq99wrM5vrpWkA6I5x42HwU3SqY Message-ID: <zcarey@example.org> Subject: Re: Status of == vs equals() RESULTS To: zcarey@example.org Content-Type: multipart/alternative; boundary=000e0cd28d42668eca048d6501e7 --000e0cd28d42668eca048d6501e7 Content-Type: text/plain; charset=ISO-8859-1 Hello Chad, What command line options did you use? My testings were more reliable if use 100 warms-up let the jit run its magic, and then go for the timed test. Also are you running both tests in the same invocation if you do, the second will be handicap, as the first one will be just inline the second will have a switch to see if it is one interface or the other. Regards, Raul On Mon, Aug 9, 2010 at 4:19 PM, Chad La Joie <zcarey@example.org> wrote: > So, I have some unexpected results from this work. > > I implemented a helper class that checked the equality of element local > names, attribute local names, namespace URIs, and namespace prefixes (i.e. > everything that Xerces always interns). Then I made sure to replace all == > != and equals() that I could find with the appropriate call. > > To test, I picked the Canonicalizer20010315ExclusiveTest test case and made > two alterations to the test22*excl methods: > - do one c14n operation out the timing loop just to make sure all the > classes are in memory, constants are loaded, etc. > - in a 100 iteration loop, create a new canonicalizer, canonicalize a DOM > tree, and time it using nanosecond time > > I did this for the example2_2_1.xml[1], example2_2_2.xml[2], example > 2_2_3.xml[3] input files (test221excl, test221excl, test223excl > respectively). > > Here are the results, measured in nanosecond timing. "total" indicates the > total time spent in all 100 runs, i.e. the summation of each of the 100 > results. > > test221excl: > equals() == > min 101000 99000 > max 123000 191000 > median 103000 105000 > avg 103760 106540 > total 10376000 10654000 > > test222excl: > equals() == > min 99000 101000 > max 192000 128000 > median 100000 108000 > avg 102110 108480 > total 10211000 10848000 > > test223excl (an XPath nodeset canonicalization) > equals() == > min 254000 248000 > max 290000 353000 > median 266000 265000 > avg 266820 265800 > total 26682000 26580000 > > So, what these numbers appear to suggest is that, in fact, equals() is more > often faster than ==. This seems counter-intuitive unless the JVM has > specialized optimization for the String.equals() method. > > Can anyone see where my testing is likely to be flawed? > > [1] > http://svn.apache.org/viewvc/xml/security/trunk/data/org/apache/xml/security/c14n/inExcl/example2_2_1.xml?revision=350494&view=markup > [2] > http://svn.apache.org/viewvc/xml/security/trunk/data/org/apache/xml/security/c14n/inExcl/example2_2_2.xml?revision=350494&view=markup > [3] > http://svn.apache.org/viewvc/xml/security/trunk/data/org/apache/xml/security/c14n/inExcl/example2_2_3.xml?revision=350915&view=markup > > On 8/2/10 10:11 AM, Chad La Joie wrote: > >> So, while I don't have my access yet, Colm asked me if I'd take a look >> at the == vs equals() issue (relevant bugs: 40897[1], 45637[2], 46681[3]) >> >> My executive summary is that clearly, as things stand, the current code >> favors optimization over correctness. Rarely is this a good thing. >> >> Colm notes[4] that the reliance on intern'ed strings (and thus the >> ability to use ==) occurs sporadically throughout the code and not just >> within the ElementChecker implementations. He specifically mentioned >> that the various C14N implementations, and indeed the == is used about 6 >> times there for string comparison. >> >> My recommendation then is two fold: >> - Ensure that nothing other than namespace bits are compared via ==. I >> don't know that this occurs but the code should definitely be reviewed >> to ensure that. >> >> - Create a new "NamespaceEqualityChecker" that provides methods for >> checking the various bits of a namespace (URIs, prefixes) and use it >> anywhere that either == or equals() is used today. Implementations based >> on == and equals() would be provided with the default implementation >> being equals()-based. A
{'source': 'Apache Software Foundation Public Mail Archives'}