[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-security-dev
Subject:    improvements over RetrievalMethodResolver
From:       "David Garcia" <david.garcia () partners ! netfocus ! es>
Date:       2005-09-09 17:56:21
Message-ID: 003801c5b567$c9b52cc0$571912ac () extendforce ! net
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]

[Attachment #4 (multipart/alternative)]


Hi,
 
Working with the class RetrievalMethodResolver I got some problems,
mainly when the retrieved content was transformed using an XPath
Transformer. 
For example using a "http://www.w3.org/TR/1999/REC-xpath-19991116"
transformer, if the query returned more than one node the code converted
the result into a byte[]and tried to parse it again.
That resulted in a fail, because the parser cannot parse the resulting
structure. It also made an unnecessary reparsing of the retrieved nodes
that caused an extra overhead.
 
To reproduce this error you can try to parse the signature provided
inside data/org/apache/xml/security/temp/key/retrieval-from-same-doc.xml
of the current release.
When executing the xpath transformation
(ancestor::my:KeyMaterials[@Id="thecert"]) 2 nodes where retrieved and
when the method tried to parse the result to get a KeyInfo (or child)
node an error was raised.
 
I made a refactor of the code supporting this case and eliminating the
need of reparse the xpath resulting set if the XmlSignatureInput
contains a node.
 
I don't know how to contribute it so I post it to you , hope this will
be useful to someone ;).
 
Regards
 
Dave Garcia
 

[Attachment #7 (text/html)]

<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">


<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 10">
<meta name=Originator content="Microsoft Word 10">
<link rel=File-List href="cid:filelist.xml@01C5B578.8D1C9210">
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:EnvelopeVis/>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
span.EstiloCorreo17
	{mso-style-type:personal-compose;
	mso-style-noshow:yes;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:Arial;
	mso-ascii-font-family:Arial;
	mso-hansi-font-family:Arial;
	mso-bidi-font-family:Arial;
	color:windowtext;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:70.85pt 3.0cm 70.85pt 3.0cm;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */ 
 table.MsoNormalTable
	{mso-style-name:"Tabla normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=ES link=blue vlink=purple style='tab-interval:35.4pt'>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>Hi,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>Working with the class <span
class=SpellE>RetrievalMethodResolver</span> I got some problems, mainly when
the retrieved content was transformed using an XPath<o:p></o:p></span></font></p>

<p class=MsoNormal><span class=GramE><font size=2 face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-US'>Transformer.</span></font></span><font
 size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>For example using a \
&#8220;</span></font><font size=2 face="Courier New"><span lang=EN-US \
style='font-size:10.0pt;font-family: "Courier \
New";mso-ansi-language:EN-US'>http://www.w3.org/TR/1999/REC-xpath-19991116</span></font><font
 size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US'>&#8221; transformer, if the query returned more than
one node the code converted the result into a <span class=GramE>byte[</span>]and
tried to parse it again.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>That resulted in a fail,
because the parser cannot parse the resulting structure. It also made an
unnecessary reparsing of the retrieved nodes that caused an extra \
overhead.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>To reproduce this error you
can try to parse the signature provided inside
data/org/apache/xml/security/temp/key/retrieval-from-same-doc.xml of the
current release.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>When executing the <span
class=SpellE>xpath</span> transformation (</span></font><span class=SpellE><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier \
New"'>ancestor</span></font></span><font size=2 face="Courier New"><span \
style='font-size:10.0pt;font-family:"Courier New"'>:<span class=GramE>:<span \
class=SpellE>my:KeyMaterials</span></span>[@<span \
class=SpellE>Id=&quot;thecert</span>&quot;]</span></font><font size=2 \
face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial; \
mso-ansi-language:EN-US'>) 2 nodes where retrieved and when the method tried to parse \
the result to get a <span class=SpellE>KeyInfo</span> (or child) node an error was \
raised.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>I made a <span \
class=SpellE>refactor</span> of the code supporting this case and eliminating the \
need of reparse the <span class=SpellE>xpath</span> resulting set if the <span \
class=SpellE>XmlSignatureInput</span> contains a node.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>I don&#8217;t know how to
contribute it so I post it to <span class=GramE>you ,</span> hope this will be
useful to someone ;).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>Regards<o:p></o:p></span></font></p>


<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>Dave \
Garcia<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>


["RetrievalMethodResolver.java" (application/octet-stream)]
["smime.p7s" (application/x-pkcs7-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic