XEP-0300: specify use of Base64; bump ns version to :2

This commit is contained in:
Tobias Markmann 2017-01-25 00:18:28 +01:00 committed by Sam Whited
parent aed9f02d2e
commit 2f21fbef22
1 changed files with 46 additions and 21 deletions

View File

@ -24,6 +24,12 @@
&mwild;
&ksmith;
&tobias;
<revision>
<version>0.5</version>
<date>2017-01-24</date>
<initials>tobias</initials>
<remark><p>Explicitly specify encoding format. Namespace version bump to urn:xmpp:hashes:2.</p></remark>
</revision>
<revision>
<version>0.4</version>
<date>2016-05-16</date>
@ -77,15 +83,35 @@
<section1 topic='XML Format' anchor='format'>
<p>This document defines a new XML element that can be used in any XMPP protocol extension. An example follows.</p>
<code><![CDATA[
<hash xmlns='urn:xmpp:hashes:1' algo='sha-256'>2XarmwTlNxDAMkvymloX3S5+VbylNrJt/l5QyPa+YoU=</hash>
]]></code>
<code><![CDATA[<hash xmlns='urn:xmpp:hashes:2' algo='sha-256'>2XarmwTlNxDAMkvymloX3S5+VbylNrJt/l5QyPa+YoU=</hash>åå]]></code>
<p>An XMPP protocol can include more than one instance of the &lt;hash/&gt; element, as long as each one has a different value for the 'algo' attribute:</p>
<code><![CDATA[
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>2AfMGH8O7UNPTvUVAM9aK13mpCY=</hash>
<hash xmlns='urn:xmpp:hashes:1' algo='sha-256'>2XarmwTlNxDAMkvymloX3S5+VbylNrJt/l5QyPa+YoU=</hash>
]]></code>
<p>The value of the 'algo' attribute MUST be one of the values from the &ianahashes; maintained by &IANA;.</p>
<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>
<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>
<table caption='Additional Hash Function Textual Names'>
<tr>
<th>Hash Function Name</th>
<th>Reference</th>
</tr>
<tr>
<td>"sha3-256"</td>
<td><span class='ref'><link url='http://dx.doi.org/10.6028/NIST.FIPS.202'>FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions</link></span> <note>FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions &lt;<link url='http://dx.doi.org/10.6028/NIST.FIPS.202'>http://dx.doi.org/10.6028/NIST.FIPS.202</link>&gt;.</note></td>
</tr>
<tr>
<td>"sha3-512"</td>
<td><span class='ref'><link url='http://dx.doi.org/10.6028/NIST.FIPS.202'>FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions</link></span> <note>FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions &lt;<link url='http://dx.doi.org/10.6028/NIST.FIPS.202'>http://dx.doi.org/10.6028/NIST.FIPS.202</link>&gt;.</note></td>
</tr>
<tr>
<td>"blake2b-256"</td>
<td>&rfc7693;</td>
</tr>
<tr>
<td>"blake2b-512"</td>
<td>&rfc7693;</td>
</tr>
</table>
<p>The CDATA of the &lt;hash/&gt; element MUST conform to the base64Binary datatype <note>See &lt;<link url='http://www.w3.org/TR/xmlschema-2/#base64Binary'>http://www.w3.org/TR/xmlschema-2/#base64Binary</link>&gt;.</note> and thus be encoded in accordance with Section 6.8 of &rfc2045;, which recommends that base64 data should have lines limited to at most 76 characters in length. However, any whitespace characters (e.g., '\r' and '\n') MUST be ignored.</p>
</section1>
<section1 topic='Hash Functions' anchor='hashes'>
@ -145,45 +171,44 @@
<tr>
<td>SHA-1</td>
<td>160 bits</td>
<td>MAY</td>
<td>SHOULD NOT</td>
</tr>
<tr>
<td>SHA-256</td>
<td>256 bits</td>
<td>SHOULD</td>
<td>MUST</td>
</tr>
<tr>
<td>SHA-512</td>
<td>512 bits</td>
<td>MAY</td>
<td>SHOULD</td>
</tr>
<tr>
<td>SHA3-256</td>
<td>256 bits</td>
<td>SHOULD</td>
<td>MUST</td>
</tr>
<tr>
<td>SHA3-512</td>
<td>512 bits</td>
<td>MAY</td>
<td>SHOULD</td>
</tr>
<tr>
<td>BLAKE2b256</td>
<td>256 bits</td>
<td>SHOULD</td>
<td>MUST</td>
</tr>
<tr>
<td>BLAKE2b512</td>
<td>512 bits</td>
<td>MAY</td>
<td>SHOULD</td>
</tr>
</table>
<p>The current plan is to move SHA-1 to a SHOULD NOT, SHA-256, SHA3-256 and BLAKE2b256 to MUST, and SHA-512, SHA3-512, and BLAKE2b512 to SHOULD by the end of 2016.</p>
<p>These recommendations ought to be reviewed yearly by the &COUNCIL;.</p>
</section1>
<!-- http://dx.doi.org/10.6028/NIST.FIPS.202 -->
<section1 topic='Determining Support' anchor='disco'>
<p>If an entity supports the protocol defined herein, it MUST report that by including a &xep0030; feature of "urn:xmpp:hashes:1" in response to disco#info requests, along with one service discovery feature for each algorithm it supports:</p>
<p>If an entity supports the protocol defined herein, it MUST report that by including a &xep0030; feature of "urn:xmpp:hashes:2" in response to disco#info requests, along with one service discovery feature for each algorithm it supports:</p>
<example caption="Service discovery information request"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='uw72g176'
@ -198,7 +223,7 @@
to='romeo@montague.lit/orchard'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<feature var='urn:xmpp:hashes:1'/>
<feature var='urn:xmpp:hashes:2'/>
<feature var='urn:xmpp:hash-function-text-names:sha-256'/>
<feature var='urn:xmpp:hash-function-text-names:sha3-256'/>
</query>
@ -254,7 +279,7 @@
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<p>This specification defines the following XML namespace:</p>
<ul>
<li>urn:xmpp:hashes:1</li>
<li>urn:xmpp:hashes:2</li>
</ul>
<p>The &REGISTRAR; shall include the foregoing namespace in its registry at &NAMESPACES;, as governed by &xep0053;.</p>
</section2>
@ -348,8 +373,8 @@
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:hashes:1'
xmlns='urn:xmpp:hashes:1'
targetNamespace='urn:xmpp:hashes:2'
xmlns='urn:xmpp:hashes:2'
elementFormDefault='qualified'>
<xs:element name='hash'>