Uploaded image for project: 'Santuario'
  1. Santuario
  2. SANTUARIO-286

Test case Santuario273.testC14n11Base() tests for a side-effect of canonicalization, rather than the desired effect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Java 1.4.6
    • Java 1.4.7
    • Java
    • Security Level: Public (Public issues, viewable by everyone)
    • None

    Description

      This test case, added in the 1.4.6 release, does the following:

      NamedNodeMap attributes = signedInfo.getAttributes();
      boolean foundBase = false;
      for (int i = 0; i < attributes.getLength(); i++) {
      Node attribute = attributes.item;
      if ("base".equals(attribute.getLocalName())
      && "http://www.acme.com/resources/subresources/".equals(attribute.getNodeValue()))

      { foundBase = true; break; }

      }
      if (!foundBase)

      { fail("The base attribute was not found or was incorrect"); }

      However, if you inspect the above, you'll notice that what it is doing is verifying a change to the input document, rather than verifying that the output is correct.

      I ran across this issue when porting the Santuario library to use the GenXDM library, and the ported version of the c14n code does not modify the input document, which means that this test fails after the port.

      I could change my port of the library to actually modify the original document - as an optional feature - but that seems like an anti-feature, rather than a benefit, so I'm requesting that the test case itself be updated.

      Patch to follow.

      Attachments

        1. santuario286.patch
          3 kB
          Eric Johnson

        Activity

          People

            coheigea Colm O hEigeartaigh
            eric@tibco.com Eric Johnson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: