From 4a0ac549f203468090440c971478d77a941d3215 Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Mon, 21 Aug 2017 14:21:13 +0200 Subject: [PATCH 1/2] Add hash-used element --- xep-0300.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/xep-0300.xml b/xep-0300.xml index aba2df22..00779ac5 100644 --- a/xep-0300.xml +++ b/xep-0300.xml @@ -24,6 +24,12 @@ &mwild; &ksmith; &tobias; + + 0.5.2 + 2017-08-21 + ps +

Add hash-used element

+
0.5.1 2017-03-17 @@ -93,6 +99,8 @@

An XMPP protocol can include more than one instance of the <hash/> element, as long as each one has a different value for the 'algo' attribute:

2AfMGH8O7UNPTvUVAM9aK13mpCY= 2XarmwTlNxDAMkvymloX3S5+VbylNrJt/l5QyPa+YoU=]]> +

In certain scenarios it makes sense to communicate the hash algorithm that is used prior to the calculation of the hash value.

+ ]]>

The value of the 'algo' attribute MUST be one of the values from the &ianahashes; maintained by &IANA;, or one of the values defined in the following table.

@@ -393,6 +401,14 @@ + + + + + + + + ]]> From 79ea21477e3ea529a1a0663996f09eff27c49951 Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Wed, 23 Aug 2017 18:50:49 +0200 Subject: [PATCH 2/2] Use hash-used element in 0234. --- xep-0234.xml | 17 ++++++++++++++--- xep-0300.xml | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/xep-0234.xml b/xep-0234.xml index 79ddd7e5..9ad2b7c1 100644 --- a/xep-0234.xml +++ b/xep-0234.xml @@ -24,6 +24,12 @@ NOT_YET_ASSIGNED &stpeter; &lance; + + 0.18.2 + 2017-08.21 + ps +

Make use of <hash-used/> from XEP-0300.

+
0.18.1 2017-05-20 @@ -354,7 +360,12 @@
- + + + + + + @@ -785,7 +796,7 @@ a=file-range:1024-*]]>

At any time during the lifetime of the file transfer session, the File Sender can communicate the checksum of the file to the File Receiver.

This can be done in the session-initiate message if the File Sender already knows the checksum, as shown above in Example 3.

-

After the session-initiate message, this can also be done by sending a session-info message containing a <checksum/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:5' namespace. The <checksum/> element SHOULD contain 'creator' and 'name' attributes sufficient to identitfy the content the checksum belongs to. Additionally, the <checksum/> element MUST contain a <file/> element which MUST contain at least one <hash/> element qualified by the 'urn:xmpp:hashes:2' namespace. Each <hash/> element contains a checksum of the file data produced in accordance with the hashing function specified by the 'algo' attribute, which MUST be one of the functions listed in the &ianahashes;.

+

After the session-initiate message, this can also be done by sending a session-info message containing a <checksum/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:5' namespace. In such a case however, the session-initiate message MUST contain a <hash-used/> element. The <checksum/> element SHOULD contain 'creator' and 'name' attributes sufficient to identitfy the content the checksum belongs to. Additionally, the <checksum/> element MUST contain a <file/> element which MUST contain at least one <hash/> or <hash-used/> element qualified by the 'urn:xmpp:hashes:2' namespace. Each <hash/> element contains a checksum of the file data produced in accordance with the hashing function specified by the 'algo' attribute, which MUST be one of the functions listed in the &ianahashes;.

-

Thanks to Diana Cionoiu, Olivier Crête, Viktor Fast, Philipp Hancke, Waqas Hussain, Justin Karneges, Steffen Larsen, Yann Leboulanger, Marcus Lundblad, Robert McQueen, Joe Maissel, Glenn Maynard, Ali Sabil, Sjoerd Simons, Will Thompson, Matthew Wild, and Jiří Zárevúcky for their feedback.

+

Thanks to Diana Cionoiu, Olivier Crête, Viktor Fast, Philipp Hancke, Waqas Hussain, Justin Karneges, Steffen Larsen, Yann Leboulanger, Marcus Lundblad, Robert McQueen, Joe Maissel, Glenn Maynard, Ali Sabil, Sjoerd Simons, Will Thompson, Matthew Wild, Paul Schaub and Jiří Zárevúcky for their feedback.

diff --git a/xep-0300.xml b/xep-0300.xml index 00779ac5..83a367c1 100644 --- a/xep-0300.xml +++ b/xep-0300.xml @@ -415,7 +415,7 @@

Thanks to Dave Cridland, Waqas Hussain, Glenn Maynard, Remko - Tronçon, and Christian Schudt for their input.

+ Tronçon, Paul Schaub and Christian Schudt for their input.

hash A hash of the file content, using the <hash/> element defined in &xep0300; and qualifed by the 'urn:xmpp:hashes:2' namespace. Multiple hashes MAY be included for hash agility.REQUIRED when offering a file, otherwise OPTIONALSee <hash-used/>
hash-usedAlternatively to a <hash/> element, the initiator can also include a <hash-used/> element. This avoids the need to read the file twice to calculate the hash.Either a <hash/> or a <hash-used/> element MUST be included when offering a file.
media-type