[Standards] Proposed XMPP Extension: Message Fastening

Marvin W xmpp at larma.de
Thu Dec 12 14:29:55 UTC 2019


On 12/12/19 2:53 PM, Philipp Hörist wrote:
> This is a pretty substantial feature so to fallback to a "Download the 
> whole archive" approach to make it work is not a good solution for me 
> and will probably lead to fastening not working with full stanza encryption
> 
> The solution for me is to separate metadata and content

I totally agree we should make sure encryption is fully considered in 
the design of Fastening (although some features will never work on 
encrypted messages).

However I don't think your suggested solution will serve this purpose. 
One reason I understood why we put elements inside the <apply-to> is 
that this way, servers know which part of the messages is to be fastened 
and can strip out all the parts of the message not required for the client.

So with your example but encrypted and useless metadata added:

<message>
   <apply-to-metadata id="origin-id-1" />
   <encrypted this="is opaque" />
   <useless meta="data" />
</message>

Servers would be able to fasten the message to the correct referenced 
message, however they can not strip the useless metadata as it's not 
clear what is important and what is not. Example for useless metadata 
would be a store hint.

I think I like this model more:

<message id="origin-id-1">
   [...]
</message>

<message id="apply-1">
   <apply-to id="origin-id-1">
     <external name="encrypted" />
   </apply-to>
   <encrypted this="is opaque" />
   <useless meta="data" />
</message>

Which the server can "merge" to:

<message id="origin-id-1">
   [...]
   <applied id="apply-1">
     <encrypted this="is opaque" />
   </applied>
</message>

It would even allow subsequent edits to replace without leaking anything 
other that one message replaces another:

<message id="apply-2">
   <apply-to id="origin-id-1" replaces="apply-1">
     <external name="encrypted" />
   </apply-to>
   <encrypted this="is opaque 2" />
   <useless meta="data" />
</message>

Resulting in

<message id="origin-id-1">
   [...]
   <applied id="apply-1" /> <!-- Skip content, it was replaced -->
   <applied id="apply-2" replaces="apply-1">
     <encrypted this="is opaque 2" />
   </applied>
</message>

(Stuff is going to be a bit more complicated as message IDs and archive 
IDs mismatch...)
(I am putting the <applied> directly in message here, but it would in 
practice be outside the <forwarded> element in a MAM message)

Marvin


More information about the Standards mailing list