XML_SetHashSalt(p, 0) semantics

Joe Orton <[email protected]> Fri, 11 May 2012 17:02:12 +0100
Newsgroups gmane.text.xml.expat.general
Organization Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham (USA), Mark Hegarty (Ireland), Matt Parson (USA), Charlie Peters (USA)
Message-ID <[email protected]>
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 (hash_secret_salt == 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