jdev - 2020-04-05

  1. Alex

    is someone able to help me to validate this Caps Hash? ``` <query xmlns="http://jabber.org/protocol/disco#info" node="http://gajim.org#KV4qaXUgvEqhWE7WEJoqvO6gTYA="> <identity type="pc" category="client" name="Gajim" /> <feature var="http://jabber.org/protocol/bytestreams" /> <feature var="http://jabber.org/protocol/si" /> <feature var="http://jabber.org/protocol/si/profile/file-transfer" /> <feature var="http://jabber.org/protocol/muc" /> <feature var="http://jabber.org/protocol/muc#user" /> <feature var="http://jabber.org/protocol/muc#admin" /> <feature var="http://jabber.org/protocol/muc#owner" /> <feature var="http://jabber.org/protocol/muc#roomconfig" /> <feature var="http://jabber.org/protocol/commands" /> <feature var="http://jabber.org/protocol/disco#info" /> <feature var="ipv6" /> <feature var="jabber:iq:gateway" /> <feature var="jabber:iq:last" /> <feature var="jabber:iq:privacy" /> <feature var="jabber:iq:private" /> <feature var="jabber:iq:register" /> <feature var="jabber:iq:version" /> <feature var="jabber:x:data" /> <feature var="jabber:x:encrypted" /> <feature var="msglog" /> <feature var="sslc2s" /> <feature var="stringprep" /> <feature var="urn:xmpp:ping" /> <feature var="urn:xmpp:time" /> <feature var="urn:xmpp:ssn" /> <feature var="http://jabber.org/protocol/mood" /> <feature var="http://jabber.org/protocol/activity" /> <feature var="http://jabber.org/protocol/nick" /> <feature var="http://jabber.org/protocol/rosterx" /> <feature var="urn:xmpp:sec-label:0" /> <feature var="urn:xmpp:hashes:2" /> <feature var="urn:xmpp:hash-function-text-names:md5" /> <feature var="urn:xmpp:hash-function-text-names:sha-1" /> <feature var="urn:xmpp:hash-function-text-names:sha-256" /> <feature var="urn:xmpp:hash-function-text-names:sha-512" /> <feature var="jabber:x:conference" /> <feature var="urn:xmpp:message-correct:0" /> <feature var="urn:xmpp:eme:0" /> <feature var="urn:xmpp:avatar:metadata+notify" /> <feature var="http://jabber.org/protocol/mood+notify" /> <feature var="http://jabber.org/protocol/activity+notify" /> <feature var="http://jabber.org/protocol/tune+notify" /> <feature var="http://jabber.org/protocol/nick+notify" /> <feature var="http://jabber.org/protocol/geoloc+notify" /> <feature var="http://jabber.org/protocol/chatstates" /> <feature var="http://jabber.org/protocol/xhtml-im" /> <feature var="urn:xmpp:receipts" /> <feature var="urn:xmpp:jingle:1" /> <feature var="urn:xmpp:jingle:apps:file-transfer:5" /> <feature var="urn:xmpp:jingle:security:xtls:0" /> <feature var="urn:xmpp:jingle:transports:s5b:1" /> <feature var="urn:xmpp:jingle:transports:ibb:1" /> <feature var="eu.siacs.conversations.axolotl.devicelist+notify" /> </query> ```

  2. Zash


  3. Alex

    my code always tells mt its wrong, I don't see why, have not seen caps hash errors in years ;-)

  4. Zash

    Prosodys util for this says `KV4qaXUgvEqhWE7WEJoqvO6gTYA=`

  5. jonas’

    can you paste this somewhere?

  6. Zash

    Code block rendering that doesn't take up the entire screen would be nice. *hint* client authors :)

  7. Alex

    jonas’‎, you need a bigger screen ;-)

  8. Alex

    jonas’‎, https://gist.github.com/agnauck/75759eff6277de616151e4cc27d72cb9

  9. Alex

    Zash‎, so Prosody sais its correct? Then something is getting messed up in my codes 🤔

  10. Zash


  11. Zash


  12. Alex

    can you point me ot the Prosody code you used to verify? Then I can debug and try to find dthe issue

  13. Zash


  14. Alex

    have tons of samples in my unit tests which all succeed, but it does not like that one for some reason :(

  15. Alex


  16. Alex

    how do I execute this LUA util?

  17. Zash


  18. Zash

    Save this as caps.lua or something: `print((require "util.caps".calculate_hash(require "util.xml".parse(io.read("*a")))))`

  19. Zash

    assumes it's in a prosody checkout and you built the C stuff and have all the dependencies

  20. Alex

    are you able to send me the string which LUA concats before building the hash?

  21. Zash


  22. pep.


  23. Zash

    It's the second return value of calculate_hash()

  24. Zash

    Alex: http://paste.debian.net/1138517/

  25. Zash

    looooooooong line at the end

  26. Alex

    thank you, owe you a beer next time we meet ;-)

  27. lovetox

    Alex this is a very easy example

  28. lovetox

    so i guess the only thing that can go wrong with that is preparing the identity correctly

  29. lovetox

    so i would look into that

  30. lovetox


  31. Alex

    this is where I looked forst and thought its related to the xml-lang which Gajim put on the iq, but this looks correct

  32. lovetox

    if you find the problem i also would be interested to know in which trap you fell

  33. Alex

    Looks like its this: ``` urn:xmpp:hash-function-text-names:md5< urn:xmpp:hash-function-text-names:sha-1< urn:xmpp:hash-function-text-names:sha-256< urn:xmpp:hash-function-text-names:sha-512< urn:xmpp:hashes:2< ``` vs ``` urn:xmpp:hashes:2< urn:xmpp:hash-function-text-names:md5< urn:xmpp:hash-function-text-names:sha-1< urn:xmpp:hash-function-text-names:sha-256< urn:xmpp:hash-function-text-names:sha-512< ``` some weird stuff going on in .NET string sorting which I am hitting for the first time

  34. jonas’

    the i;octet collation is relevant for sorting

  35. Alex

    ya, it looks like .NET by default sorts by OS culture, fixed by using `StringComparer.Ordinal`

  36. Alex

    this code is on prod for over 10 years and hitting it the first time 😀

  37. Zash

    I sure hope nobody goes and invents some non-ascii feature

  38. Alex

    my OS is using Germany culture settings

  39. Alex

    time for a walk before publishing a fix, Thank you guys for the help 👍

  40. mbt

    hi everyone, currently im having trouble with implementation stanzas on xmpp.js. can anyone help me about it?

  41. pep.

    sonny, ^ ?

  42. sonny

    Feel free to open an issue with your question on the repository and I'll have a look

  43. mbt

    okay thanks i ll move on there