santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 41474] New: - two text nodes with the value '\n' in succession within <ds:SignedInfo> and <ds:X509IssuerSerial>
Date Fri, 26 Jan 2007 10:09:46 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41474>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41474

           Summary: two text nodes with the value '\n' in succession within
                    <ds:SignedInfo> and <ds:X509IssuerSerial>
           Product: Security
           Version: Java 1.3
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: Signature
        AssignedTo: security-dev@xml.apache.org
        ReportedBy: lijun.liao@gmail.com


There are always two text nodes with the value '\n' in succession within
<ds:SignedInfo> and <ds:X509IssuerSerial>. If we have signed some elements and
wish to add another signature with xpath as the tranform, then we get the
runtime exception that says could not found a node to a handle (raised by
xalan-J). After the debug I found the responding codes as in following:


[01]  public SignedInfo(
[02]         Document doc, Element SignatureMethodElem, Element
CanonicalizationMethodElem)
[03]             throws XMLSecurityException {
[04]
[05]     super(doc);
[06]     this._constructionElement.appendChild(CanonicalizationMethodElem);
[07]     XMLUtils.addReturnToElement(this._constructionElement);
[08]     //Check this?
[09]     this.c14nMethod=CanonicalizationMethodElem;
[10]     this._constructionElement.appendChild(c14nMethod);
[11]     XMLUtils.addReturnToElement (this._constructionElement);
  
      this._signatureAlgorithm = new SignatureAlgorithm(SignatureMethodElem, null);

      signatureMethod=this._signatureAlgorithm.getElement();
      this._constructionElement.appendChild(signatureMethod);
     
      XMLUtils.addReturnToElement(this._constructionElement);
   }

Line 06 and 10 add the same element twice, hence line 06 has no effect. But the
text-node with the value "\n" added at line 07 is remained there.

[01] public XMLX509IssuerSerial(Document doc, String X509IssuerName,
[02]                             BigInteger X509SerialNumber) {
[03]    super(doc);
[04]
[05]      XMLUtils.addReturnToElement(this._constructionElement);
[06]      this.addTextElement(X509IssuerName, Constants._TAG_X509ISSUERNAME);
[07]      XMLUtils.addReturnToElement(this._constructionElement);
[08]      this.addTextElement(X509SerialNumber.toString(),
Constants._TAG_X509SERIALNUMBER);
[09]   }

Line 07 should be removed, since '\n' is added in line 06.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message