Abstract: | This document provides a technical specification for Digital Signatures in the Extensible Messaging and Presence Protocol (XMPP). |
Author: | Kurt Zeilenga |
Copyright: | © 1999 - 2010 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Experimental |
Type: | Standards Track |
Version: | 0.1 |
Last Updated: | 2010-09-15 |
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
1. Introduction
2. Signing XMPP Stanzas
2.1. Example of Signing Messages
2.2. Example of Securing IQs
3. Interaction with Stanza Semantics
4. Handling of Inbound Stanzas
5. Inclusion and Checking of Timestamps
6. Mandatory-to-Implement Cryptographic Algorithms
7. Certificates
8. Security Considerations
9. XMPP Registrar Considerations
9.1. XML Namespace Name for Signed Data in XMPP
10. Acknowledgements
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
This document provides a technical specification for Digital Signatures in Extensible Messaging and Presence Protocol (XMPP [1]) based upon End-to-End Object Encryption (E2EEncrypt [2]) "work in progress".
The S/MIME approach defined in RFC 3923 [3] has never been implemented in XMPP clients to the best of our knowledge, but has some attractive features, especially the ability to store-and-forward a signed message at a user's server if the user is not online when the message is received (in the XMPP community this is called "offline storage" and the message is referred to as an "offline message"). The authors surmise that RFC 3923 has not been implemented mainly because it adds several new dependencies to XMPP clients, especially MIME (along with the CPIM and MSGFMT media types). This document explores the possibility of an approach that is similar to but simpler than RFC 3923.
The process that a sending agent follows for securing stanzas is very similar regardless of the form of stanza (i.e., <iq/>, <message/>, or <presence/>).
The sender begins with the cleartext version of the <message/> stanza "S":
<message xmlns='jabber:client' from='juliet@capulet.net/balcony' id='183ef129' to='romeo@montague.net' type='chat'> <thread>8996aef0-061d-012d-347a-549a200771aa</thread> <body>Wherefore art thou, Romeo?</body> </message>
The sender then performs the steps 1 through 4 from above to generate:
<plain xmlns="urn:xmpp:signed:0" timestamp="2010-06-29T02:15:21.012Z"> PG1lc3NhZ2UgeG1sbnM9ImphYmJlcjpjbGllbnQiIGZyb209Imp1bGlldEBjYXB 1bGV0Lm5ldC9iYWxjb255IiB0bz0icm9tZW9AbW9udGVndWUubmV0IiB0eXBlPS JjaGF0Ij48dGhyZWFkPmM2MzczODI0LWEzMDctNDBkZC04ZmUwLWJhZDZlNzI5O WFkMDwvdGhyZWFkPjxib2R5PldoZXJlZm9yZSBhcnQgdGhvdSwgUm9tZW8/PC9i b2R5PjwvbWVzc2FnZT4= </plain>
And then performs steps 5 through 9 steps, causing the following to be sent:
<message xmlns='jabber:client' from='juliet@capulet.net/balcony' id='6410ed123' to='romeo@montague.net' type='chat'> <signed xmlns="urn:xmpp:signed:0"> <signature algorithm="RSA-SHA1"> DxbxIziY1C1Ytcxkj0IFLsfmDLMv96JMlMAQZ7jh49IbsOIPsxI2LyLmqhKH/994UXDJKQLHvLJz gAmw8V2b+zmyZeItJzSmB+HHiLFVXkD2Dd4JfetsafsfIcB7uNWg0gAeiKrTHfFgiyEC/2WxwOj3 JUMRyQ9ykEPIzS0GZ/k= </signature> <data> PHBsYWluIHhtbG5zPSJ1cm46eG1wcDpzaWduZWQ6MCIgdGltZXN0YW1wPSIyMDEwLTA2LTI5VDAy OjE1OjIxLjAxMloiPgogIFBHMWxjM05oWjJVZ2VHMXNibk05SW1waFltSmxjanBqYkdsbGJuUWlJ R1p5YjIwOUltcDFiR2xsZEVCallYQgogIDFiR1YwTG01bGRDOWlZV3hqYjI1NUlpQjBiejBpY205 dFpXOUFiVzl1ZEdWbmRXVXVibVYwSWlCMGVYQmxQUwogIEpqYUdGMElqNDhkR2h5WldGa1BtTTJN emN6T0RJMExXRXpNRGN0TkRCa1pDMDRabVV3TFdKaFpEWmxOekk1TwogIFdGa01Ed3ZkR2h5WldG a1BqeGliMlI1UGxkb1pYSmxabTl5WlNCaGNuUWdkR2h2ZFN3Z1VtOXRaVzgvUEM5aQogIGIyUjVQ and2YldWemMyRm5aVDQ9CjwvcGxhaW4+Cg== </data> </signed> </message>
To be added....
The following limitations and caveats apply:
Several scenarios are possible when an entity receives an encrypted stanza:
In Case #1, the receiving application MUST do one and only one of the following: (1) ignore the <signed/> extension, (2) ignore the entire stanza, or (3), except where precluded by the protocol (rfc3920bis [6]), return a <service-unavailable/> error to the sender.
In Case #2, the receiving application MUST NOT return a stanza error to the sender, since this is the success case.
In Case #3, the receiving application MAY, except where precluded by the protocol, return a <not-acceptable/> error to the sender, optionally supplemented by an application-specific error condition element of <bad-timestamp/> as shown below:
<message from='romeo@example.net/orchard' id='6410ed123' to='juliet@capulet.net/balcony' type='error'> <signed xmlns='urn:xmpp:signed:0'> XML-character-data-here </signed> <error type='modify'> <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <bad-timestamp xmlns='urn:xmpp:signed:0'/> </error> </message>
In Case #4, the receiving application SHOULD, except as precluded by the protocol, return a <bad-request/> error to the sender, optionally supplemented by an application-specific error condition element of <bad-signature/> as shown below:
<message from='romeo@example.net/orchard' id='6410ed123' to='juliet@capulet.net/balcony' type='error'> <e2e xmlns='urn:xmpp:signed:0'> XML-character-data-here </e2e> <error type='modify'> <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <bad-signature xmlns='urn:ietf:params:xml:xmpp-signed:0'/> </error> </message>
Additionally in Case #4, the receiving application SHOULD NOT present the stanza to the intended recipient (human or application) and SHOULD provide some explicit alternate processing of the stanza (which may be to display a message informing the recipient that it has received a stanza that cannot be verified).
Timestamps are included to help prevent replay attacks. All timestamps MUST conform to DATETIME [7] and be presented as UTC with no offset, always including the seconds and fractions of a second to three digits (resulting in a datetime 24 characters in length). Absent a local adjustment to the sending agent's perceived time or the underlying clock time, the sending agent MUST ensure that the timestamps it sends to the receiver increase monotonically (if necessary by incrementing the seconds fraction in the timestamp if the clock returns the same time for multiple requests). The following rules apply to the receiving application:
The foregoing timestamp checks assume that the recipient is online when the message is received. However, if the recipient is offline then the server will probably store the message for delivery when the recipient is next online (offline storage does not apply to <iq/> or <presence/> stanzas, only <message/> stanzas). As described in Best Practices for Handling Offline Messages [8], when sending an offline message to the recipient, the server SHOULD include delayed delivery data as specified in Delayed Delivery [9] so that the recipient knows that this is an offline message and also knows the original time of receipt at the server. In this case, the recipient SHOULD verify that the timestamp received in the encrypted message is within five minutes of the time stamped by the recipient's server in the <delay/> element.
All implementations MUST support the following algorithms. Implementations MAY support other algorithms as well.
To participate in end-to-end signing using the methods defined in this document, a client needs to possess an X.509 certificate. It is expected that many clients will generate their own (self-signed) certificates rather than obtain a certificate issued by a certification authority (CA). In any case the certificate MUST include an XMPP address that is represented using the ASN.1 Object Identifier "id-on-xmppAddr" as specified in Section 5.1.1 of RFC 3920bis.
TBD.
A URN sub-namespace of signed content for the Extensible Messaging and Presence Protocol (XMPP) is defined as follows.
This document borrows ideas and text from End-to-End Object Encryption "work in progress" by Matthew Miller and Peter Saint-Andre.
Series: XEP
Number: 0285
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.1
Last Updated: 2010-09-15
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0001
Supersedes: None
Superseded By: None
Short Name: N/A
Source Control:
HTML
RSS
This document in other formats:
XML
PDF
Email:
Kurt.Zeilenga@Isode.COM
JabberID:
Kurt.Zeilenga@Isode.COM
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. Extensible Messaging and Presence Protocol (XMPP) <http://xmpp.org/>.
2. End-to-End Object Encryption for the Extensible Messaging and Presence Protocol (XMPP), Miller, M. and P. Saint-Andre, work in progress <http://datatracker.ietf.org/doc/draft-miller-3923bis>.
3. RFC 3923: End-to-End Signing and Object Encryption for the Extensible Messaging and Presence Protocol (XMPP) <http://tools.ietf.org/html/rfc3923>.
4. RFC 3269: UTF-8, a transformation format of ISO 10646 <http://tools.ietf.org/html/rfc3269>.
5. RFC 4648: The Base16, Base32, and Base64 Data <http://tools.ietf.org/html/rfc4648>.
6. rfc3920bis: proposed revisions to Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/draft-ietf-xmpp-3920bis>. (work in progress)
7. RFC 3339: Date and Time on the Internet Timestamps <http://tools.ietf.org/html/rfc3339>.
8. XEP-0160: Best Practices for Handling Offline Messages <http://xmpp.org/extensions/xep-0160.html>.
9. XEP-0203: Delayed Delivery <http://xmpp.org/extensions/xep-0203.html>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Initial published version.
(psa)Proto-XEP draft.
(kdz)END