[Expat-discuss] XML_SetHashSalt(p, 0) semantics

Karl Waclawek karl at waclawek.net
Fri May 11 19:16:15 CEST 2012


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: expat-discuss-bounces+karl=waclawek.net at libexpat.org
[mailto:expat-discuss-bounces+karl=waclawek.net at libexpat.org] On Behalf Of
Joe Orton
Sent: May-11-12 12:02 PM
To: expat-discuss at libexpat.org
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
Expat-discuss at libexpat.org
http://mail.libexpat.org/mailman/listinfo/expat-discuss



More information about the Expat-discuss mailing list