No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0290.xml 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Encapsulated Digital Signatures in XMPP</title>
  10. <abstract>This document provides a technical specification for Encapsulated Digital
  11. Signatures in the Extensible Messaging and Presence Protocol (XMPP).</abstract>
  12. &LEGALNOTICE;
  13. <number>0290</number>
  14. <status>Deferred</status>
  15. <type>Standards Track</type>
  16. <sig>Standards</sig>
  17. <approver>Council</approver>
  18. <dependencies>
  19. <spec>XMPP Core</spec>
  20. <spec>XEP-0001</spec>
  21. </dependencies>
  22. <supersedes/>
  23. <supersededby/>
  24. <shortname>N/A</shortname>
  25. &kdz;
  26. <revision>
  27. <version>0.2</version>
  28. <date>2011-01-28</date>
  29. <initials>kdz</initials>
  30. <remark>
  31. <p>Merge manifest and schema-desc objects.</p>
  32. </remark>
  33. </revision>
  34. <revision>
  35. <version>0.1</version>
  36. <date>2011-01-26</date>
  37. <initials>psa</initials>
  38. <remark>
  39. <p>Initial published version.</p>
  40. </remark>
  41. </revision>
  42. <revision>
  43. <version>0.0.1</version>
  44. <date>2010-11-29</date>
  45. <initials>kdz</initials>
  46. <remark>
  47. <p>Proto-XEP draft.</p>
  48. </remark>
  49. </revision>
  50. </header>
  51. <section1 topic="Introduction" anchor="intro">
  52. <p class="box"><em>This document is one of two proposals for digital signatures in XMPP. It
  53. is expected that only one of these proposals be progressed beyond Experimental on
  54. the Standards Track.</em></p>
  55. <p>This document provides a technical specification for Encapsulated Digital Signatures in
  56. Extensible Messaging and Presence Protocol (&xmpp;).</p>
  57. <p>XMPP Digital Signatures may be used to provide signer authentication, data integrity,
  58. non-repudiation, and other security services.</p>
  59. <p>This extension is intended to be highly flexible, supporting a wide range of
  60. applications. The extension not only supports signing by the originator, but by other
  61. entities which handle XMPP stanzas. Multiple entities may independently sign a
  62. stanza.</p>
  63. <p>A signed manifest approach is used to allow selective signing (only select elements may
  64. be included in the manifest) and to allow flexibility in handling verification
  65. errors.</p>
  66. <p>This extension is intended to support <em>optimistic signing</em>.</p>
  67. <p>This document offers an encapsulated signature approach based upon &w3xmlsig; (XMLDSIG).
  68. Implementations of this extension not required to fully implement the XML DSIG
  69. specification, they may implement only the minimal subset necessary to support this
  70. extension.</p>
  71. <p>It is noted that a number of object-level XMPP digital signature extensions have been
  72. specified over the years. These include &rfc3923; (XMPP E2E), &xep0116; (XMPP PGP), and
  73. &xep0285;. The limited applicability of encapsulating signature approaches in XMPP is
  74. discussed in &xep0274;.</p>
  75. </section1>
  76. <section1 topic="Signing XMPP Stanzas" anchor="stanza">
  77. <p>The process that a sending agent follows for securing stanzas is very similar regardless
  78. of the form of stanza (i.e., &lt;iq/&gt;, &lt;message/&gt;, or &lt;presence/&gt;).</p>
  79. <p>The signer begins with the cleartext version of the &lt;message/&gt; stanza "S":</p>
  80. <example><![CDATA[
  81. <message from='juliet@capulet.net/balcony'
  82. id='183ef129'
  83. to='romeo@montague.net'>
  84. <thread>8996aef0-061d-012d-347a-549a200771aa</thread>
  85. <body>Wherefore art thou, Romeo?</body>
  86. </message>
  87. ]]></example>
  88. <p>This is modified prior to signing as follows:</p>
  89. <ul>
  90. <li>Default attribute values are added. (Namespace declarations are not modified.)</li>
  91. <li>Each child element of the stanza is augmented by a <tt>id</tt> attribute qualified
  92. in the <tt>urn:xmpp:dsig:0</tt> namespace. As these attributes are used to identify
  93. the element within a manifest, they must be sufficient unique.</li>
  94. </ul>
  95. <example><![CDATA[
  96. <message from='juliet@capulet.net'
  97. id='183ef129'
  98. to='romeo@montague.net'
  99. type='chat'>
  100. <thread xmlns:d="urn:xmpp:dsig:0" d:id="xxxx-1">8996aef0-061d-012d-347a-549a200771aa</thread>
  101. <body xmlns:d="urn:xmpp:dsig:0" d:id="xxxx-2">Wherefore art thou, Romeo?</body>
  102. </message>
  103. ]]></example>
  104. <p>The signer builds a stanza description object containing a signer element, the stanza
  105. element, and a timestamp element. The signer element value is the bare JID of the
  106. signing entity. When the signing entity is a service entity, the JID may only contain
  107. service domain. The stanza-desc element is the stanza prepared above with each of its
  108. child elements replaced by an reference element. The reference element references the
  109. child element via a "urn:xmpp:dsig:ref:0" URI with an anchor of the value of child
  110. element's <tt>d:id</tt>. The value of the reference element is the digest value produced
  111. by the digest method after the specified transforms are applied.</p>
  112. <example><![CDATA[
  113. <stanza-desc id="stanza-desc" xmlns="urn:xmpp:dsig:0">
  114. <signer>juliet@capulet.net</signer>
  115. <Transforms><Transform Algorithm="urn:xmpp:dsig:transform:0"/></Transform>
  116. <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
  117. <message from='juliet@capulet.net'
  118. id='183ef129'
  119. to='romeo@montague.net'
  120. type='chat'>
  121. <reference URI='urn:xmpp:dsig:ref:0#xxxx-1'>...</reference>
  122. <reference URI='urn:xmpp:dsig:ref:0#xxxx-2'>...</reference>
  123. </message>
  124. <timestamp>2010-11-11T13:33:00.123Z</timestamp>
  125. </stanza-desc>
  126. ]]></example>
  127. <p>The signer then builds a SignedInfo element.</p>
  128. <example><![CDATA[
  129. <SignedInfo>
  130. <CanonicalizationMethod Algorithm="urn:xmpp:dsig:transform:0"/>
  131. <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/
  132. <Reference URI="#stanza-desc">
  133. <Transforms>
  134. <Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"/>
  135. </Transform>
  136. <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
  137. <DigestValue>...</DigestValue>
  138. </Reference>
  139. </SignedInfo>
  140. ]]></example>
  141. <p>And then produces a Signature element:</p>
  142. <example><![CDATA[
  143. <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
  144. <SignedInfo>
  145. <CanonicalizationMethod Algorithm="http://www.w3.org/2006/12/xml-c14n11"/>
  146. <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/
  147. <Reference URI="#stanza-desc">
  148. <Transforms>
  149. <Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"/>
  150. </Transform>
  151. <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
  152. <DigestValue>...</DigestValue>
  153. </Reference>
  154. </SignedInfo>
  155. <SignatureValue/>
  156. <Object>
  157. <stanza-desc id="stanza-desc" xmlns="urn:xmpp:dsig:0">
  158. <signer>juliet@capulet.net</signer>
  159. <Transforms><Transform Algorithm="urn:xmpp:dsig:transform:0"/></Transform>
  160. <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
  161. <message from='juliet@capulet.net'
  162. id='183ef129'
  163. to='romeo@montague.net'
  164. type='chat'>
  165. <reference URI='urn:xmpp:dsig:ref:0#xxxx-1'>...</reference>
  166. <reference URI='urn:xmpp:dsig:ref:0#xxxx-2'>...</reference>
  167. </message>
  168. <timestamp>2010-11-11T13:33:00.123Z</timestamp>
  169. </stanza-desc>
  170. </Object>
  171. </Signature>
  172. ]]></example>
  173. <p>The signer than computes the SignatureValue element, processing the Signature element as
  174. a detached signature, and replaces the empty Signature element with it. Finally, the
  175. signer inserts the Signature element into stanza and forwards the stanza as it normally
  176. would.</p>
  177. <example><![CDATA[
  178. <message from='juliet@capulet.net'
  179. id='183ef129'
  180. to='romeo@montague.net'
  181. type='chat'>
  182. <thread xmlns:d="urn:xmpp:dsig:0" d:id="xxxx-1">8996aef0-061d-012d-347a-549a200771aa</thread>
  183. <body xmlns:d="urn:xmpp:dsig:0" d:id="xxxx-2">Wherefore art thou, Romeo?</body>
  184. <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
  185. <SignedInfo>
  186. <CanonicalizationMethod Algorithm="http://www.w3.org/2006/12/xml-c14n11"/>
  187. <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/
  188. <Reference URI="#stanza-desc">
  189. <Transforms>
  190. <Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"/>
  191. </Transform>
  192. <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
  193. <DigestValue>...</DigestValue>
  194. </Reference>
  195. </SignedInfo>
  196. <SignatureValue>...</SignatureValue>
  197. <Object>
  198. <stanza-desc id="stanza-desc" xmlns="urn:xmpp:dsig:0">
  199. <signer>juliet@capulet.net</signer>
  200. <Transforms><Transform Algorithm="urn:xmpp:dsig:transform:0"/></Transform>
  201. <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
  202. <message from='juliet@capulet.net'
  203. id='183ef129'
  204. to='romeo@montague.net'
  205. type='chat'>
  206. <reference URI='urn:xmpp:dsig:ref:0#xxxx-1'>...</reference>
  207. <reference URI='urn:xmpp:dsig:ref:0#xxxx-2'>...</reference>
  208. </message>
  209. <timestamp>2010-11-11T13:33:00.123Z</timestamp>
  210. </stanza-desc>
  211. </Object>
  212. </Signature>
  213. </message>
  214. ]]></example>
  215. </section1>
  216. <section1 topic="Transformation Algorithm" anchor="transform">
  217. <p>For referenced elements of a stanza, the referenced element is normalized (omitting
  218. comments), as detailed in &w3canon;, as a document subset of a document containing a
  219. stream element containing the appropriate jabber:client stanza element containing the
  220. stanza with the referenced elements. Note that jabber:client stanzas are used when
  221. constructing this document even when a server is signing a stanza to be sent to another
  222. server.</p>
  223. <p>For the stanza in Example 2, the input document would be:</p>
  224. <example><![CDATA[
  225. <stream:stream xmlns='jabber:client" xmlns:stream='http://etherx.jabber.org/streams'>
  226. <message from='juliet@capulet.net'
  227. id='183ef129'
  228. to='romeo@montague.net'
  229. type='chat'>
  230. <thread xmlns:d="urn:xmpp:dsig:0" d:id="xxxx-1">8996aef0-061d-012d-347a-549a200771aa</thread>
  231. <body xmlns:d="urn:xmpp:dsig:0" d:id="xxxx-2">Wherefore art thou, Romeo?</body>
  232. </message>
  233. </stream:stream>
  234. ]]></example>
  235. <p>The canonical form of element referenced by <tt>urn:xmpp:dsig:ref:0#xxx-1</tt> would
  236. be:</p>
  237. <example><![CDATA[<thread xmlns="jabber:client" xmlns:d="urn:xmpp:dsig:0" d:id="xxxx-1">8996aef0-061d-012d-347a-549a200771aa</thread>]]></example>
  238. </section1>
  239. <section1 topic="Stanza Element References" anchor="references">
  240. <p>The URI 'uri:xmpp:dsig:ref:0#xxxx" refers to the child element of the stanza which
  241. contains the 'uri:xmpp:dsig:0' 'id' attribute with the value "xxxx".</p>
  242. </section1>
  243. <section1 topic="Inclusion and Checking of Timestamps" anchor="timestamps">
  244. <p>Timestamps are included to help prevent replay attacks. All timestamps MUST conform to
  245. &rfc3339; and be presented as UTC with no offset, always including the seconds and
  246. fractions of a second to three digits (resulting in a datetime 24 characters in length).
  247. Absent a local adjustment to the sending agent's perceived time or the underlying clock
  248. time, the sending agent MUST ensure that the timestamps it sends to the receiver
  249. increase monotonically (if necessary by incrementing the seconds fraction in the
  250. timestamp if the clock returns the same time for multiple requests). The following rules
  251. apply to the receiving application:</p>
  252. <ul style="symbols">
  253. <li>It MUST verify that the timestamp received is within five minutes of the current
  254. time, except as described below for offline messages.</li>
  255. <li>If the foregoing check fails, the timestamp SHOULD be presented to the receiving
  256. entity (human or application) marked with descriptive text indicating "old
  257. timestamp" or "future timestamp" and the receiving entity MAY return a stanza error
  258. to the sender (except as precluded in the protocol).</li>
  259. </ul>
  260. <p>The foregoing timestamp checks assume that the recipient is online when the message is
  261. received. However, if the recipient is offline then the server will probably store the
  262. message for delivery when the recipient is next online (offline storage does not apply
  263. to &lt;iq/&gt; or &lt;presence/&gt; stanzas, only &lt;message/&gt; stanzas). As
  264. described in &xep0160;, when sending an offline message to the recipient, the server
  265. SHOULD include delayed delivery data as specified in &xep0203; so that the recipient
  266. knows that this is an offline message and also knows the original time of receipt at the
  267. server. In this case, the recipient SHOULD verify that the timestamp received in the
  268. encrypted message is within five minutes of the time stamped by the recipient's server
  269. in the &lt;delay/&gt; element.</p>
  270. </section1>
  271. <section1 topic="Mandatory-to-Implement Cryptographic Algorithms" anchor="mti">
  272. <p>All implementations MUST support the following algorithms. Implementations MAY support
  273. other algorithms as well.</p>
  274. <ul>
  275. <li>TBD</li>
  276. </ul>
  277. </section1>
  278. <section1 topic="Certificates" anchor="certs">
  279. <p>To participate in end-to-end signing using the methods defined in this document, a client
  280. needs to possess an X.509 certificate. It is expected that many clients will generate
  281. their own (self-signed) certificates rather than obtain a certificate issued by a
  282. certification authority (CA). In any case the certificate MUST include an XMPP address
  283. that is represented using the ASN.1 Object Identifier "id-on-xmppAddr" as specified in
  284. Section 5.1.1 of RFC 3920bis.</p>
  285. </section1>
  286. <section1 topic="Security Considerations" anchor="security">
  287. <p>TBD.</p>
  288. </section1>
  289. <section1 topic="XMPP Registrar Considerations" anchor="reg">
  290. <section2 topic="XML Namespace Name for Signed Data in XMPP" anchor="ns">
  291. <p>A URN sub-namespace of signed content for the Extensible Messaging and Presence
  292. Protocol (XMPP) is defined as follows.</p>
  293. <dl>
  294. <di>
  295. <dt>URI:</dt>
  296. <dd>urn:xmpp:dsig</dd>
  297. </di>
  298. <di>
  299. <dt>Specification:</dt>
  300. <dd>ProtoXEP</dd>
  301. </di>
  302. <di>
  303. <dt>Description:</dt>
  304. <dd>This is an XML namespace name of signed content for the Extensible Messaging
  305. and Presence Protocol as defined by ProtoXEP.</dd>
  306. </di>
  307. <di>
  308. <dt>Registrant Contact:</dt>
  309. <dd>XSF</dd>
  310. </di>
  311. </dl>
  312. </section2>
  313. </section1>
  314. </xep>