Re: XML_SetHashSalt(p, 0) semantics

"Karl Waclawek" <[email protected]> Fri, 11 May 2012 13:16:15 -0400
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
Yes, this should have been documented. Please file a bug report.

0 is used as a sentinel value that means that no secret salt value has been
set and therefore one needs to be generated.

In any case, one  can always use another value if a fixed hash salt is
desired, but I wonder why one would want to turn this off.

Karl

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Joe Orton
Sent: May-11-12 12:02 PM
To: [email protected]
Cc: Kurt Seifried; Tomas Hoger; David Malcolm
Subject: [Expat-discuss] XML_SetHashSalt(p, 0) semantics

Tomas (CC'ed) noticed that the semantics of XML_SetHashSalt are surprising
when 0 is passed.  That value does not force a fixed hash salt, as might be
expected from reading the API description, but instead implies use of a
random hash salt, per startParsing():

    if (You must write an attribute 'type'='object' after writing the
attribute with local name '__type' == 0)
      hash_secret_salt = generate_hash_secret_salt();

Which is the desired semantics?  It would be simple to fix either the header
or the implementation.  pyexpat is apparently using XML_SetHashSalt(parser,
0) hoping for a fixed hash salt.

Regards, Joe
_______________________________________________
Expat-discuss mailing list
[email protected]
http://mail.libexpat.org/mailman/listinfo/expat-discuss