[Standards] XEP-0234: Denote used hash function in session-initiate

Paul Schaub vanitasvitae at riseup.net
Thu Aug 17 20:23:53 UTC 2017


Hi!

I stumbled across another inconvenience in the Jingle File Transfer XEP:

The session-initiate MIGHT contain a hash-element which contains the
checksum of the file. Alternatively the hash-element can also be sent at
a later point to prevent the sender from having to read the file
multiple times (one time to calculate the hash and a second time to
actually send the file).

Unfortunately this means, that in case of a session-initiate WITHOUT
hash-element, the receiver is forced to read the data twice. Once to
receive it and a second time to calculate the hash, once the postponed
hash-element arrived. This is due to hash-agility of XEP-0300. When
receiving the file, the recipient sometimes doesn't not know, which hash
algorithm the sender uses to calculate the checksum.

So to comply with the XEP, the receiver currently has two options. He
might either calculate the hash with every supported hash function at
once (which might be one or two, but can also be ~15, note that XEP-0300
recommends 9 different functions), or just process the data twice.

I propose the following change: The session-initiate MUST contain a
reference to the hash algorithm used to calculate the checksum. The
actual hash-value can still be send afterwards, but now the receiver can
calculate the hash on the fly.

What do you think?

Greetings vv


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://mail.jabber.org/pipermail/standards/attachments/20170817/420b74ca/attachment.sig>


More information about the Standards mailing list