git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@1362 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2007-11-08 17:47:17 +00:00
parent 9c135ff9c1
commit 10f45766e7
1 changed files with 38 additions and 39 deletions

View File

@ -28,10 +28,10 @@
&stpeter;
&remko;
<revision>
<version>1.5pre5</version>
<date>2007-08-29</date>
<version>1.5pre6</version>
<date>2007-11-08</date>
<initials>jjh/psa</initials>
<remark><p>To avoid confusion, renamed the hash attribute to the algo attribute; required inclusion of the algo attribute in non-legacy mode; removed schema default for algo attribute; to help prevent a race condition and ensure backward compatibility, specified that the disco#info request is sent to node#ver; clarified meaning of node attribute; further specified security considerations; clarified handling of the legacy format to assist developers.</p></remark>
<remark><p>Required inclusion of the hash attribute in non-legacy mode; removed schema default for hash attribute; clarified meaning of node attribute; further specified security considerations; clarified handling of the legacy format to assist developers.</p></remark>
</revision>
<revision>
<version>1.4</version>
@ -126,8 +126,8 @@
<code><![CDATA[
<presence from='romeo@montague.lit/orchard'>
<c xmlns='http://jabber.org/protocol/caps'
algo='sha-1'
node='http://exodus.jabberstudio.org/;0.9.1'
hash='sha-1'
node='http://code.google.com/p/exodus/#0.9.1'
ver='8RovUdtOmiAjzj+xI7SK5BCw3A8='/>
</presence>
]]></code>
@ -138,11 +138,9 @@
id='disco1'
to='romeo@montague.lit/orchard'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='http://exodus.jabberstudio.org/;0.9.1#8RovUdtOmiAjzj+xI7SK5BCw3A8='/>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></code>
<p>(Note: The disco#info request is sent to a service discovery node formed of the caps 'node' attribute and the caps 'ver' attribute to help prevent a race condition; see <link url='#discover'>Discovering Capabilities</link>.)</p>
<p>The response is:</p>
<code><![CDATA[
<iq from='romeo@montague.lit/orchard'
@ -161,8 +159,8 @@
<code><![CDATA[
<presence from='benvolio@capulet.lit/230193'>
<c xmlns='http://jabber.org/protocol/caps'
algo='sha-1'
node='http://psi-im.org/;0.11'
hash='sha-1'
node='http://psi-im.org/#0.11'
ver='8RovUdtOmiAjzj+xI7SK5BCw3A8='/>
</presence>
]]></code>
@ -171,8 +169,8 @@
<code><![CDATA[
<presence from='nurse@capulet.lit/chamber'>
<c xmlns='http://jabber.org/protocol/caps'
algo='sha-1'
node='http://psi-im.org/;0.10'
hash='sha-1'
node='http://psi-im.org/#0.10'
ver='uCoVCteRe3ty2wU2gHxkMaA7xhs='/>
</presence>
]]></code>
@ -180,7 +178,7 @@
<code><![CDATA[
<presence from='bard@shakespeare.lit/globe'>
<c xmlns='http://jabber.org/protocol/caps'
algo='sha-1'
hash='sha-1'
node='http://www.chatopus.com/;2.2'
ver='zHyEOgxTrkpSdGcQKH8EFPLsriY='/>
</presence>
@ -222,16 +220,16 @@
<th>Definition</th>
<th>Inclusion</th>
</tr>
<tr>
<td>algo</td>
<td>The hashing algorithm used in generated the 'ver' attribute (see &ianahashes;). The value SHOULD be "sha-1".</td>
<td>REQUIRED</td>
</tr>
<tr>
<td>ext</td>
<td>A set of nametokens specifying additional feature bundles; this attribute is deprecated (see the <link url='#legacy'>Legacy Format</link> section of this document).</td>
<td>DEPRECATED</td>
</tr>
<tr>
<td>hash</td>
<td>The hashing algorithm used in generated the 'ver' attribute (see &ianahashes;). The value SHOULD be "sha-1".</td>
<td>REQUIRED</td>
</tr>
<tr>
<td>node</td>
<td>A unique identifier for the software underlying the entity, typically a URL at the website of the project or company that produces the software. *</td>
@ -243,7 +241,7 @@
<td>REQUIRED</td>
</tr>
</table>
<p>* Note: It is RECOMMENDED for the value of the 'node' attribute to identify both the software product and the released version in the form "ProductURL;SoftwareVersion", such as "http://psi-im.org/;0.11" <note>This enables a processing application to strip off everything after the ";" character and thereby determine a unique string for the generating application, which it could maintain in a list of known products or (if the string is a URL) which it could use to find more detailed information about the generating application.</note>. In any case, the value of the 'node' attribute MUST NOT include the "#" character, which is used as a separator character in the <link url='#discover'>Discovering Capabilities</link> use case.</p>
<p>* Note: It is RECOMMENDED for the value of the 'node' attribute to identify both the software product and the released version in the form "ProductURL;SoftwareVersion", such as "http://psi-im.org/#0.11" <note>This enables a processing application to strip off everything after the "#" character and thereby determine a unique string for the generating application, which it could maintain in a list of known products or (if the string is a URL) which it could use to find more detailed information about the generating application.</note>.</p>
<p>** Note: Before version 1.4 of this specification, the 'ver' attribute was used to specify the released version of the software; while the values of the 'ver' attribute that result from use of the algorithm specified herein are backward-compatible, applications SHOULD appropriately handle the <link url='#legacy'>Legacy Format</link>.</p>
</section1>
@ -277,8 +275,8 @@
<example caption='Annotated presence sent'><![CDATA[
<presence>
<c xmlns='http://jabber.org/protocol/caps'
algo='sha-1'
node='http://exodus.jabberstudio.org/;0.9.1'
hash='sha-1'
node='http://code.google.com/p/exodus/#0.9.1'
ver='8RovUdtOmiAjzj+xI7SK5BCw3A8='/>
</presence>
]]></example>
@ -292,18 +290,11 @@
id='disco1'
to='romeo@montague.lit/orchard'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='http://exodus.jabberstudio.org/;0.9.1#8RovUdtOmiAjzj+xI7SK5BCw3A8='/>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
<p>The disco#info request is sent to a service discovery node whose value is generated as follows:</p>
<ol>
<li>The value of the caps 'node' attribute.</li>
<li>The "#" character.</li>
<li>The value of the caps 'ver' attribute.</li>
</ol>
<p>Inclusion of the service discovery 'node' attribute (which is not to be confused with the entity capabilities 'node' attribute) helps to prevent a race condition, namely: if the user sends presence but changes capabilities (e.g., by enabling a plugin) before the contact requests the user's service discovery information.</p>
<p>The disco#info request is sent to the full JID (&FULLJID;) of the entity that generated the caps information.</p>
<p>The responding entity then returns all of the capabilities it supports.</p>
@ -330,7 +321,7 @@
<example caption='Stream feature element including capabilities'><![CDATA[
<stream:features>
<c xmlns='http://jabber.org/protocol/caps'
algo='sha-1'
hash='sha-1'
node='http://jabberd.org/entity'
ver='ItBTI0XLDFvVxZ72NQElAzKS9sU='>
</stream:features>
@ -347,8 +338,7 @@
<iq from='juliet@capulet.lit/balcony'
to='capulet.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='http://exodus.jabberstudio.org/;0.9.1#8RovUdtOmiAjzj+xI7SK5BCw3A8='/>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
<iq from='capulet.lit'
@ -374,7 +364,7 @@
<section1 topic='Security Considerations' anchor='security'>
<p>Use of the protocol specified in this document might make some client-specific forms of attack slightly easier, since the attacker could more easily determine the type of client being used. However, since most clients respond to Service Discovery and Software Version requests without performing access control checks, there is no new vulnerability. Entities that wish to restrict access to capabilities information SHOULD use &xep0016; to define appropriate communications blocking (e.g., an entity MAY choose to allow IQ requests only from "trusted" entities, such as those with whom it has a subscription of "both").</p>
<p>Adherence to the algorithm defined in the <link url='#ver'>Generation of ver Attribute</link> section of this document for both generation and checking of the 'ver' attribute helps to guard against poisoning of entity capabilities information by malicious or improperly implemented entities.</p>
<p>If the value of the 'ver' attribute is a hash as defined herein (i.e., if the 'ver' attribute is not generated according to the legacy format), inclusion of the 'algo' attribute is required. Knowing explicitly that the value of the 'ver' attribute is a hash enables the recipient to avoid spurious notification of invalid hashes.</p>
<p>If the value of the 'ver' attribute is a hash as defined herein (i.e., if the 'ver' attribute is not generated according to the legacy format), inclusion of the 'hash' attribute is required. Knowing explicitly that the value of the 'ver' attribute is a hash enables the recipient to avoid spurious notification of invalid hashes.</p>
<p>The 'name' attribute of the service discovery &lt;identity/&gt; element is not included in the hash generation method. The primary reason for excluding it is that it is human-readable text and therefore may be provided in different localized versions. As a result, its inclusion would needlessly multiply the number of possible hash values and thus the time and resources required to validate values of the 'ver' attribute.</p>
</section1>
@ -409,8 +399,8 @@
<xs:complexType>
<xs:simpleContent>
<xs:extension base='empty'>
<xs:attribute name='algo' type='xs:NMTOKEN' use='required'/>
<xs:attribute name='ext' type='xs:NMTOKENS' use='optional'/>
<xs:attribute name='hash' type='xs:NMTOKEN' use='required'/>
<xs:attribute name='node' type='xs:string' use='required'/>
<xs:attribute name='ver' type='xs:string' use='required'/>
</xs:extension>
@ -429,13 +419,22 @@
</section1>
<section1 topic='Legacy Format' anchor='legacy'>
<p>Before Version 1.4 of this specification, the 'ver' attribute was generated differently, the 'ext' attribute was used more extensively, and the 'algo' attribute was absent. For historical purposes, Version 1.3 of this specification is archived at &lt;<link url='http://www.xmpp.org/extensions/attic/xep-0115-1.3.html'>http://www.xmpp.org/extensions/attic/xep-0115-1.3.html</link>&gt;. For backward-compatibility with the legacy format, the 'node' attribute is REQUIRED and the 'ext' attribute MAY be included.</p>
<p>An application can determine if the legacy format is in use by checking for the presence of the 'algo' attribute, which is REQUIRED in the current format.</p>
<p>In the legacy format, the value of the 'ver' attribute is not a hash of the service discovery identity and supported features. Therefore, a processing entity cannot validate the identity and features by checking the hash. If the processing entity supports the legacy format, it SHOULD check the 'node', 'ver', and 'ext' combinations as specified in the archived version 1.3 of this specification, and MAY cache the results. If not, the processing entity SHOULD ignore the 'ver' value entirely (since it cannot be verified) and SHOULD NOT cache it.</p>
<p>Before Version 1.4 of this specification, the 'ver' attribute was generated differently, the 'ext' attribute was used more extensively, and the 'hash' attribute was absent. For historical purposes, Version 1.3 of this specification is archived at &lt;<link url='http://www.xmpp.org/extensions/attic/xep-0115-1.3.html'>http://www.xmpp.org/extensions/attic/xep-0115-1.3.html</link>&gt;. For backward-compatibility with the legacy format, the 'node' attribute is REQUIRED and the 'ext' attribute MAY be included.</p>
<p>An application can determine if the legacy format is in use by checking for the presence of the 'hash' attribute, which is REQUIRED in the current format.</p>
<p>If an application supports the legacy format, it SHOULD proceed as follows:</p>
<ul>
<li>When receiving caps information from a legacy entity, an application SHOULD check the 'node', 'ver', and 'ext' combinations as specified in the archived version 1.3 of this specification, and MAY cache the results.</li>
<li>When sending a disco#info request to a legacy entity, an application SHOULD send the request to the entity's JID with a service discovery node of "node#ver".</li>
</ul>
<p>If an application does not support the legacy format, it SHUOLD proceed as follows:</p>
<ul>
<li>When receiving caps information from a legacy entity, an application SHOULD ignore the 'ver' value entirely (since it cannot be verified) and SHOULD NOT cache it, since the application cannot validate the identity and features by checking the hash.</li>
<li>When sending a disco#info request to a legacy entity, an application SHOULD send the request to the entity's JID without a service discovery node of "node#ver".</li>
</ul>
</section1>
<section1 topic='Acknowledgements' anchor='ack'>
<p>Thanks to Rachel Blackman, Dave Cridland, Richard Dobson, Sergei Golovan, Justin Karneges, Jacek Konieczny, Ian Paterson, Kevin Smith, Tomasz Sterna, Michal Vaner, and Matt Yacobucci for comments and suggestions.</p>
<p>Thanks to Rachel Blackman, Dave Cridland, Richard Dobson, Olivier Goffart, Sergei Golovan, Justin Karneges, Jacek Konieczny, Ian Paterson, Kevin Smith, Tomasz Sterna, Michal Vaner, and Matt Yacobucci for comments and suggestions.</p>
</section1>
</xep>