Re: Decryption Transform processing question

On Tuesday 16 July 2002 11:34 am, merlin wrote:
> You're recalling my earlier confusion which turned out to be misplaced.
> The c14n is performed internally within the decryption transform; it is
> not the signature canonicalization; and it is fixed as standard c14n.
> This is the final c14n-with-replacement/parse step done by the
> decryptXML() function. So we have no choice but to solve the problem, and
> it doesn't have an impact on subsequent signature c14n/exc-c14n
> processing.

Let me walk through it in detail...

  <Document xml:lang="ie">
    <Foo id="foo-1" />
    <Signature xmlns="&dsig;"> ...
      <Reference URI="#foo-1"> ...
      <Transform Algorithm="&decrypt;XML" />
      <Transform Algorithm="&exc-c14n;" /> ...
    </Signature>
  </Document>

Since I'm using exc-c14n, the signed form of <Foo> does not have the 
xml:lang attribute.

Later, someone encrypts the <Foo> element.

  <Document xml:lang="ie">
    <EncryptedData Id="foo-1" [[<Foo Id="foo-1" />]] />
    <Signature xmlns="&dsig;"> ...
      <Reference URI="#foo-1"> ...
      <Transform Algorithm="&decrypt;XML" />
      <Transform Algorithm="&exc-c14n;" /> ...
    </Signature>
  </Document>

When the receiver goes to check the signature, the decryptor (using your 
"patched" text) adds the xml:lang declaration in the decrypted octet 
sequence:

  <Document xml:lang="ie">
    <Foo Id="foo-1" xml:lang="ie" />
    <Signature xmlns="&dsig;"> ...
      <Reference URI="#foo-1"> ...
      <Transform Algorithm="&decrypt;XML" /> ...
      <Transform Algorithm="&exc-c14n;" />
    </Signature>
  </Document>

This document is then parsed and exclusively canonicalized and it looks much 
like it does above. The  Signature over Foo fails because it contains a 
xml:lang it did not originally contain.

Maybe I'm in error because of my confusion over the fact that these 
attributes are only added when "an element from N whose parent element is 
not in N". <Foo> is replacing the <EncryptedData> element in N, and its 
parent (<Document>) is not in N, so by that, I think I am supposed to add 
them...

Received on Tuesday, 16 July 2002 12:22:20 UTC