Modern XMPP project discussion - 2021-06-28


  1. southerntofu

    hello, we had a chat about account migration on another chan

  2. southerntofu

    i was proposing we should standardize client signatures for migration requests early on, whether clients wish to verify them or not

  3. southerntofu

    could use OMEMO or PGP keys you already trust as associated to an account, in my view

  4. jonas’

    I think this goes well as an add-on XEP, especially since the different crypto-methods will have different ways to do that.

  5. Ge0rG

    Sounds like one XEP that defines the wire format to be signed, ECAPS style, and a different XEP per encryption protocol for the signature.

  6. jonas’

    Ge0rG, I was reminded more of jet

  7. MattJ

    I think a choice of encryption protocols may be counterproductive

  8. jonas’

    I think agility on that is required though

  9. MattJ

    Sure

  10. jonas’

    even if only to migrate from OMEMO -> whatever-follows-OMEMO

  11. jonas’

    (without rewriting all the protocols)

  12. MattJ

    But I'd prefer that someone chooses one way, specs that, and we can update it in the future if needed

  13. jonas’

    and the issue of OMEMO having no key to authenticate the account (as opposed to the device) remains.

  14. jonas’

    so OX would be the more natural choice for that

  15. jonas’

    but "nobody" uses that

  16. Ge0rG

    Who needs account keys anyway?!

  17. jonas’

    Ge0rG, wasn’t SEX based on account keys?

  18. southerntofu

    Ge0rG, i was precisely proposing the mechanism to expose the signature be standardized as part of the XEP, then we can have extensions to describe how to achieve such signatures with this or that kind of keys

  19. southerntofu

    jonas’, SEX?

  20. MattJ

    I see no advantage to that approach

  21. southerntofu

    MattJ, letting client devs know there are or is going to be signatures to valide the migration requests so they're less easily forged?

  22. Ge0rG

    southerntofu: not the signature but the hash of the data to be signed?

  23. Ge0rG

    jonas’: SEX was as sarcastic as my remark about account keys

  24. MattJ

    southerntofu, and this is actionable for devs how? The spec already says further verification methods may exist in the future. Right now we can only guess how they may work.

  25. MattJ

    Also I should say that my thoughts for crypto are not to protect from malicious servers, but to work around the scenario where the original server is no longer available

  26. MattJ

    I see that as a common enough scenario that we should try to solve it if we can

  27. jonas’

    #blabber.im

  28. MattJ

    Indeed, and the many before it

  29. MattJ

    duckduckgo, fastmail, ...

  30. MattJ

    Both had XMPP services with thousands of users that they just decided to shut down

  31. MattJ

    Neither actively wanted to prevent people migrating away

  32. southerntofu

    <new-jid>foo@bar</new-jid><signatures><SIG_TYPE>... defined in new extensions ...</SIG_TYPE></signatures>

  33. southerntofu

    maybe something like this?

  34. southerntofu

    where we agree `<new-jid>foo@bar</new-jid>` is what should be signed by the clients, but then the specific format can be further spceified

  35. MattJ

    <omemo-sig xmlns="urn:xmpp:moved-omemo-sig:1">...defined in new extensions...</omemo-sig>

  36. Ge0rG

    MattJ: shouldn't the OMEMO key be the primary identity of the user then, and the JID becomes a mere ephemeral routing token?

  37. southerntofu

    sure but maybe not just OMEMO though.. (i think PGP is very well suited for such cases)

  38. MattJ

    Ge0rG, yes, sounds like a great plan.....

  39. southerntofu

    Ge0rG, yes precisely

  40. MattJ

    <ox-sig xmlns="urn:xmpp:moved-ox-sig:1">...defined in new extension...</ox-sig>

  41. southerntofu

    i mean if you loose your keys you can still reestablish trust through other channels, but once you have keys exchanged it makes sense that keys are your identity

  42. Ge0rG

    So now we have invented a cryptographic identity based overlay network on top of xmpp.

  43. southerntofu

    looks good

  44. southerntofu

    MattJ, do you think standardizing these OMEMO/OX extensions would be troublesome?

  45. Ge0rG

    Now we can replace the server side roster with a client side list of trusted keys and their respective meta data and ephemeral JIDs, and we have a new secure chat system that has nothing to do with Jabber

  46. MattJ

    southerntofu, not if you can figure out what to sign, how, with what key, and how recipients can verify it

  47. MattJ

    Just do it

  48. MattJ

    But there are no changes required to the current spec in this regard, it already allows for such extension, that's all I'm saying

  49. southerntofu

    ok i'll reread OMEMO spec :)

  50. MattJ

    I don't consider myself a crypto person, but I see no way to reliably do this with OMEMO

  51. rom1dep

    There's already https://xmpp.org/extensions/xep-0415.html if we want P2P 🙂

  52. southerntofu

    > Libraries can use an Ed25519 key pair as their internal IdentityKey. In this case, the IdentityKey can create EdDSA-compatible signatures directly, and has to be converted first to perform X25519.

  53. southerntofu

    from OMEMO spec... sounds like OMEMO signatures are already well specified :)

  54. jonas’

    southerntofu, I think the best way forward would be to write something down in XEP form

  55. jonas’

    <editor-hat>I am happy to assist with any issues around the process</editor-hat>

  56. southerntofu

    thanks jonas’ i think i'll first try to craft a signature using my own OMEMO keys and verify it, just to see how it works

  57. emus

    MattJ: If there is a way I can help with this let ne know https://xmpp.org/extensions/inbox/moved2.html

  58. MattJ

    Thanks

  59. southerntofu

    MattJ, here's a PoC for signatures using OMEMO keys, using gajim keys https://tildegit.org/southerntofu/omemo-signatures

  60. MattJ

    So how would it work? One of your devices signs the moved statement, and the recipients just check for any of their stored fingerprints for that user matching the signing key?

  61. southerntofu

    yes, the embedded signature(s) would also contain the corresponding public key, so if you have 10 keys for someone you don't have to try them all to find the correct one.. but that's the idea

  62. MattJ

    Right

  63. MattJ

    I guess this can also be implemented server-side... technically :)

  64. southerntofu

    sure thing

  65. southerntofu

    personally i find it more appropriate client-side so we can have a confirmation process before migrating, letting users know about it

  66. southerntofu

    but that's just a personal opinion :)

  67. southerntofu

    https://ttm.sh/FOS.txt <-- could look like this

  68. southerntofu

    also multiple signatures can be chained from different device keys

  69. southerntofu

    (the signature/key is bogus in this example i linked)

  70. southerntofu

    how would account migration handle existing message archives and published content on PubSub?

  71. MattJ

    They are in the XEP-0227 file

  72. MattJ

    Or they will be, when my update is approved and merged

  73. southerntofu

    yes i can see that, but the JIDs have changed, so if i query your microblog on your new address, even if data has been moved, the server will return nothing because the data is archived for your old JID... am i correct?

  74. pep.

    no because PEP is on the account, so it'll be imported to the new account

  75. pep.

    There should be no mention of a JID there I guess

  76. pep.

    pubsub though is different

  77. pep.

    Dunno how that's handled

  78. pep.

    If that's handled.

  79. southerntofu

    https://xmpp.org/extensions/xep-0277.html#example-2 <-- correct

  80. southerntofu

    at least when publishing there's no JID involved

  81. pep.

    yeah that's microblog, generally used on PEP (except Movim and Libervia use it on PubSub as well..)

  82. pep.

    And hmm, wait you're not quoting the appropriate block

  83. pep.

    https://github.com/xsf/xeps/pull/1064/files#diff-f94da706aed4fca9036ff0b2875918fe0a7021efbc004e76825e10c74463df0aR344

  84. pep.

    right well 227 doesn't mention pubsub at all does it

  85. pep.

    "out of scope"

  86. Zash

    PEP is part of MattJ pending update

  87. pep.

    Yeah

  88. southerntofu

    so consider me not nowledgeable about such things but very curious about changing JIDs and how that can break user expectations

  89. pep.

    But not generic PubSub data right. Though I guess that could easily be reused..

  90. southerntofu

    i expect migration to be "transparent" to me as an end-user so that i retain history and such.. maybe that was obvious idk :)

  91. Zash

    I sense some confusion.

  92. pep.

    I sense that some more "non-goals" should be added to Moved2 :P

  93. Zash

    If the data has been moved (= imported and exported) then it *would* be available at the new JID. Or why do you think not?

  94. pep.

    But that can be a problem for modernxmpp

  95. pep.

    Zash, that might be true of the person moving

  96. Zash

    Mechanisms for export and import are undefined as of yet, AFAIK, unless MattJ sneaked it into an update I haven't seen yet.

  97. pep.

    That won't be true of the contacts

  98. Zash

    Which leads to the Moved stuff magically creating that association.

  99. Zash

    And PEP stuff being presence based will magically start working again once you Moved all the roster relations.

  100. Zash

    Explicit subscriptions can be passed through the export file

  101. Zash

    Explicit (PEP) subscriptions can be passed through the export file

  102. pep.

    Tbh, it feels like we don't have the same expectations. As much as I would like it to be, it doesn't seem to me XMPP is identity based atm, that is you'd have one identity that can stay the same whether you're foo@bar or baz@qxx.

  103. pep.

    (talking to southerntofu)

  104. pep.

    Things might go in this direction sometimes but I feel it's just a coincidence

  105. MattJ

    I am absolutely not working on cryptographic identity for XMPP

  106. MattJ

    Maybe someone can build that out of these blocks, possibly combined with others

  107. MattJ

    To me that is a complex problem, while we have 5000 real users about to lose their XMPP accounts in less than a week

  108. pep.

    You honestly think you'd be able to migrate them in less than a week? :/

  109. MattJ

    Well I had planned to work on jabber.org this week, but I hit a roadblock

  110. MattJ

    So while I'm waiting I may as well try

  111. southerntofu

    Zash, i was/am concerned that some of that migrated data refers to specific JIDs and so i'm wondering if it would be possible or desirable to do something about that server-side so the move is transparent to the client

  112. southerntofu

    (which is not a question about cryptographic identity :))

  113. southerntofu

    but apparently at least for microblogging that's not a problem

  114. southerntofu

    MattJ, any way we / others can help with anything?

  115. MattJ

    My current plan is to write a .ceb (Conversations/Blabber backup file format) -> XEP-0227 converter

  116. Zash

    Wait what

  117. Zash

    MattJ, did you see that Gajim (I think) import export work?

  118. MattJ

    No

  119. Zash

    I think it was NIH'd XEP-0227 extensions

  120. Zash

    → https://logs.xmpp.org/xsf/2020-12-27?p=h

  121. Zash

    Cross-MUC links whenq

  122. Zash

    Cross-MUC links when?

  123. qy

    as in sharing quotes between mucs?

  124. qy

    or linking to a specific message in a muc?

  125. Zash

    Referencing specific messages in other MUC

  126. Zash

    Quotes optional

  127. southerntofu

    Zash, interesting conversation, shows there is interest for the question

  128. Zash

    Tho upon re-reading, this was exports from the client, not from the account/server.

  129. Zash

    Quite some overlap however, that would benefit from a shared format like XEP-0227

  130. qy

    hm. entirely clientside implementation possible

  131. qy

    wait, xmpp has message ids right?

  132. qy

    if so, yes

  133. qy

    if not, no

  134. Zash

    What is?

  135. qy

    referencing specific messages

  136. southerntofu

    Matt, sounds like a plan, good luck with that.. i just took a look at BackupExportService in conversations and it looks hairy... doing a manual SQL export oO

  137. Zash

    It's possible

  138. Zash

    There's even XEPs for it IIRC

  139. qy

    oh

  140. Zash

    Just, as always, client implementations 🙂

  141. qy

    yet again, xmpp is held back by it's clients

  142. southerntofu

    Zash, yes it was about client interop, which is really good.. like you said if you don't have something like XEP-0227 then both c2c and s2s migrations are "impossible"

  143. pep.

    227 doesn't do anything about MUC affiliations etc. right?

  144. Zash

    xmpp:xsf@muc.xmpp.org?stanza-id=2020-12-27-f1637f8fabdf49c3 or something something

  145. pep.

    Not like it can

  146. southerntofu

    it's the same UX expectation, that one should be able to just swap client/server and everything should be more or less transparent

  147. Zash

    pep., nah, just bookmarks

  148. pep.

    So there's a bunch of channels you wouldn't be able to rejoin

  149. Zash

    category of things that would be easier if we had implemented MIX already

  150. southerntofu

    pep., probably MUC servers should also interpret the Moved request

  151. pep.

    It's not designed for them currently, but yeah maybe

  152. Zash

    Probably doable with some dance similar to what you'd do for presence subscriptions?

  153. pep.

    hmm, yeah maybe you can try to join the first time with a moved tag in it

  154. pep.

    MUC checks PEP and comes back to you

  155. pep.

    Might take some time though..

  156. Zash

    Magic registration-esque request?

  157. MattJ

    Yeah, I think it needs something like that

  158. MattJ

    But first things first...

  159. southerntofu

    pep., that makes sense to join with a Moved, but what if your old server has closed already by the time MUC server implements Moved?

  160. pep.

    That's not in the requirements for Moved2 :x

  161. Zash

    "First things fist, but not necessarily in that order"

  162. pep.

    So yeah..

  163. southerntofu

    pep., i'm not interesting in the requirements already defined or whether something should fit in this specific XEP or not, i'm interesting in the actual consequences in terms of UX and what we can do about it :P

  164. pep.

    It's not possible in this case, without cryptostuff

  165. pep.

    As you could have guessed

  166. pep.

    Then you need to teach MUCs OMEMO ><

  167. pep.

    You're gonna get some backlash I say :P

  168. southerntofu

    idk.. is there some kind of stanza for s2s announcements that can be archived server-side, so that when the server implements Moved it can retrospectively interpret Moved requests?

  169. pep.

    MUCs don't have to be link to any of your contacts' server

  170. southerntofu

    instead of making migration a synchronous process

  171. pep.

    Look at joinjabber.org

  172. southerntofu

    yes, but you didn't answer my question: is there a way with current default settings to have the MUC server save a Moved request for later processing? or would such requests be discarded because the server doesn't understand them?

  173. southerntofu

    like is there a special s2s namespace specifically for that kind of server requests that other servers may not understand yet but may wish to treat later?

  174. pep.

    Currently it would just discard anything it doesn't understand

  175. pep.

    That's what you do in XMPP

  176. pep.

    I don't think there is such a thing?

  177. MattJ

    Otherwise it has to store stuff it doesn't know from strangers for... how long?

  178. MattJ

    Sounds open to abuse

  179. southerntofu

    idk could be a per-server quota of like 1MB or something, or only accept such announcements from servers you already have trustworthy s2s relationships with, or..

  180. southerntofu

    but ok that's not an option unfortunately

  181. pep.

    MUC PEP? But it's not like you can publish on it yourself