QDomDocument toString() producing different results



  • Hi everyone.

    So situation is:

    QDomDocument::toString()
    

    producing different results.
    This happens cause of QHash now have random seeding (against hash attacks).

    Problem is - we generate sign based on xml-string produced by toString() , so when we check sign we got sign mismatch because of different strings.

    Possible solutions like

    qSetGlobalQHashSeed(0);
    

    is not solution because it works only at same machine but not work on different machines.

    So is there are way produce identical xml-strings on different PCs?



  • The only possibility I see is to find-and-replace QHash with QMap inside QDomDocument sources and re-compile Qt. This would also have licensing implications though



  • @VRonin said in QDomDocument toString() producing different results:

    This would also have licensing implications though

    Thanks for idea, i think we can build our own QDom* classes and make lib for application.
    Also possible solution is canonical serializer, that will save xml in right way, but both solutions require much more code than .toString() :)

    This link demonstrate canonical serializer
    https://stackoverflow.com/questions/27378143/qt-5-produce-random-attribute-order-in-xml


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.