XmlDsigC14NTransform framework 1.0 vs 1.1. Bug?

Discussion in 'ASP .Net Security' started by A programmer, Aug 20, 2003.

  1. A programmer

    A programmer Guest

    Hi,

    I have been using XmlDsigC14NTransform class and I am getting different
    result with framework 1.1 and framework 1.0. It looks like the 1.1 version
    handles newlines between elements differently - it replaces newline
    charaacter (ASCII) 10 with escaped version -

    This means, that XML digital signatures, created with one version of the
    framework are invalid with the other one!

    Any ideas?

    Bye,
    Matej

    static byte[] CreateC14NXml()
    {

    XmlDsigC14NTransform t=new XmlDsigC14NTransform(false);
    XmlDocument doc=new XmlDocument();

    // load XML:
    doc.Load("xml.xml");

    t.LoadInput(doc);
    byte[] ret;
    // copy output to byte array
    using (Stream s=(Stream) t.GetOutput(typeof(Stream)))
    {
    s.Position=0;
    ret=new byte[s.Length];
    if (s.Read(ret,0,(int)s.Length)!=s.Length)
    throw new Exception("Error while reading C14N stream!");
    }
    return ret;
    }
    A programmer, Aug 20, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anatoly Volodko
    Replies:
    1
    Views:
    2,078
    Mattias Sjögren
    Aug 14, 2003
  2. Charles A. Lackman
    Replies:
    1
    Views:
    1,330
    smith
    Dec 8, 2004
  3. Mark
    Replies:
    4
    Views:
    1,707
    Juan T. Llibre
    Nov 17, 2005
  4. moi
    Replies:
    3
    Views:
    4,039
    quaiser_ali
    Sep 26, 2008
  5. Replies:
    2
    Views:
    9,300
    Darryl L. Pierce
    Sep 11, 2005
Loading...

Share This Page