mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-24 18:22:24 -05:00
Merge branch 'hashUsed' of https://github.com/vanitasvitae/xeps into feature/xep-0234,xep-0300
This commit is contained in:
commit
65d92b69ce
15
xep-0234.xml
15
xep-0234.xml
@ -24,6 +24,12 @@
|
|||||||
<shortname>NOT_YET_ASSIGNED</shortname>
|
<shortname>NOT_YET_ASSIGNED</shortname>
|
||||||
&stpeter;
|
&stpeter;
|
||||||
&lance;
|
&lance;
|
||||||
|
<revision>
|
||||||
|
<version>0.18.3</version>
|
||||||
|
<date>2017-08-24</date>
|
||||||
|
<initials>ps</initials>
|
||||||
|
<remark><p>Make use of <hash-used/> from XEP-0300.</p></remark>
|
||||||
|
</revision>
|
||||||
<revision>
|
<revision>
|
||||||
<version>0.18.2</version>
|
<version>0.18.2</version>
|
||||||
<date>2017-08-23</date>
|
<date>2017-08-23</date>
|
||||||
@ -365,7 +371,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>hash</td>
|
<td>hash</td>
|
||||||
<td>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.</td>
|
<td>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.</td>
|
||||||
<td>REQUIRED when offering a file, otherwise OPTIONAL</td>
|
<td>See <hash-used/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>hash-used</td>
|
||||||
|
<td>Alternatively 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.</td>
|
||||||
|
<td>Either a <hash/> or a <hash-used/> element MUST be included when offering a file.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>media-type</td>
|
<td>media-type</td>
|
||||||
@ -796,7 +807,7 @@ a=file-range:1024-*]]></code>
|
|||||||
<section2 topic='Checksum' anchor='hash'>
|
<section2 topic='Checksum' anchor='hash'>
|
||||||
<p>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.</p>
|
<p>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.</p>
|
||||||
<p>This can be done in the session-initiate message if the File Sender already knows the checksum, as shown above in Example 3.</p>
|
<p>This can be done in the session-initiate message if the File Sender already knows the checksum, as shown above in Example 3.</p>
|
||||||
<p>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;.</p>
|
<p>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;.</p>
|
||||||
<example caption="Initiator sends checksum in session-info"><![CDATA[
|
<example caption="Initiator sends checksum in session-info"><![CDATA[
|
||||||
<iq from='romeo@montague.example/dr4hcr0st3lup4c'
|
<iq from='romeo@montague.example/dr4hcr0st3lup4c'
|
||||||
id='kqh401b5'
|
id='kqh401b5'
|
||||||
|
18
xep-0300.xml
18
xep-0300.xml
@ -24,6 +24,12 @@
|
|||||||
&mwild;
|
&mwild;
|
||||||
&ksmith;
|
&ksmith;
|
||||||
&tobias;
|
&tobias;
|
||||||
|
<revision>
|
||||||
|
<version>0.5.2</version>
|
||||||
|
<date>2017-08-21</date>
|
||||||
|
<initials>ps</initials>
|
||||||
|
<remark><p>Add hash-used element</p></remark>
|
||||||
|
</revision>
|
||||||
<revision>
|
<revision>
|
||||||
<version>0.5.1</version>
|
<version>0.5.1</version>
|
||||||
<date>2017-03-17</date>
|
<date>2017-03-17</date>
|
||||||
@ -93,6 +99,8 @@
|
|||||||
<p>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:</p>
|
<p>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:</p>
|
||||||
<code><![CDATA[<hash xmlns='urn:xmpp:hashes:2' algo='sha-1'>2AfMGH8O7UNPTvUVAM9aK13mpCY=</hash>
|
<code><![CDATA[<hash xmlns='urn:xmpp:hashes:2' algo='sha-1'>2AfMGH8O7UNPTvUVAM9aK13mpCY=</hash>
|
||||||
<hash xmlns='urn:xmpp:hashes:2' algo='sha-256'>2XarmwTlNxDAMkvymloX3S5+VbylNrJt/l5QyPa+YoU=</hash>]]></code>
|
<hash xmlns='urn:xmpp:hashes:2' algo='sha-256'>2XarmwTlNxDAMkvymloX3S5+VbylNrJt/l5QyPa+YoU=</hash>]]></code>
|
||||||
|
<p>In certain scenarios it makes sense to communicate the hash algorithm that is used prior to the calculation of the hash value.</p>
|
||||||
|
<code><![CDATA[<hash-used xmlns='urn:xmpp:hashes:2' algo='sha-256'/>]]></code>
|
||||||
<p>The value of the 'algo' attribute MUST be one of the values from the &ianahashes; maintained by &IANA;, or one of the values
|
<p>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.</p>
|
defined in the following table.</p>
|
||||||
<table caption='Additional Hash Function Textual Names'>
|
<table caption='Additional Hash Function Textual Names'>
|
||||||
@ -393,13 +401,21 @@
|
|||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name='hash-used'>
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:extension base='empty'>
|
||||||
|
<xs:attribute name='algo' type='xs:NCName' use='required'/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
]]></code>
|
]]></code>
|
||||||
</section1>
|
</section1>
|
||||||
|
|
||||||
<section1 topic='Acknowledgements' anchor='ack'>
|
<section1 topic='Acknowledgements' anchor='ack'>
|
||||||
<p>Thanks to Dave Cridland, Waqas Hussain, Glenn Maynard, Remko
|
<p>Thanks to Dave Cridland, Waqas Hussain, Glenn Maynard, Remko
|
||||||
Tronçon, and Christian Schudt for their input.</p>
|
Tronçon, Paul Schaub and Christian Schudt for their input.</p>
|
||||||
</section1>
|
</section1>
|
||||||
|
|
||||||
</xep>
|
</xep>
|
||||||
|
Loading…
Reference in New Issue
Block a user