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

  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>
  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=''
  82. id='183ef129'
  83. to=''>
  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=''
  97. id='183ef129'
  98. to=''
  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></signer>
  115. <Transforms><Transform Algorithm="urn:xmpp:dsig:transform:0"/></Transform>
  116. <DigestMethod Algorithm=""/>
  117. <message from=''
  118. id='183ef129'
  119. to=''
  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=""/
  132. <Reference URI="#stanza-desc">
  133. <Transforms>
  134. <Transform Algorithm=""/>
  135. </Transform>
  136. <DigestMethod Algorithm=""/>
  137. <DigestValue>...</DigestValue>
  138. </Reference>
  139. </SignedInfo>
  140. ]]></example>
  141. <p>And then produces a Signature element:</p>
  142. <example><![CDATA[
  143. <Signature xmlns="">
  144. <SignedInfo>
  145. <CanonicalizationMethod Algorithm=""/>
  146. <SignatureMethod Algorithm=""/
  147. <Reference URI="#stanza-desc">
  148. <Transforms>
  149. <Transform Algorithm=""/>
  150. </Transform>
  151. <DigestMethod Algorithm=""/>
  152. <DigestValue>...</DigestValue>
  153. </Reference>
  154. </SignedInfo>
  155. <SignatureValue/>
  156. <Object>
  157. <stanza-desc id="stanza-desc" xmlns="urn:xmpp:dsig:0">
  158. <signer></signer>
  159. <Transforms><Transform Algorithm="urn:xmpp:dsig:transform:0"/></Transform>
  160. <DigestMethod Algorithm=""/>
  161. <message from=''
  162. id='183ef129'
  163. to=''
  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=''
  179. id='183ef129'
  180. to=''
  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="">
  185. <SignedInfo>
  186. <CanonicalizationMethod Algorithm=""/>
  187. <SignatureMethod Algorithm=""/
  188. <Reference URI="#stanza-desc">
  189. <Transforms>
  190. <Transform Algorithm=""/>
  191. </Transform>
  192. <DigestMethod Algorithm=""/>
  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></signer>
  200. <Transforms><Transform Algorithm="urn:xmpp:dsig:transform:0"/></Transform>
  201. <DigestMethod Algorithm=""/>
  202. <message from=''
  203. id='183ef129'
  204. to=''
  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=''>
  226. <message from=''
  227. id='183ef129'
  228. to=''
  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>