TOC |
|
This document defines a method of end-to-end object encryption for the Extensible Messaging and Presence Protocol (XMPP). The protocol defined herein is a simplified version of the protocol defined in RFC 3923.
This Internet-Draft is submitted to IETF in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work in progress.”
The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html.
This Internet-Draft will expire on September 3, 2010.
Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the BSD License.
1.
Introduction
2.
Terminology
3.
Securing XMPP Stanzas
3.1.
Example of Securing Messages
4.
Handling of Inbound Stanzas
5.
Inclusion and Checking of Timestamps
6.
Mandatory-to-Implement Cryptographic Algorithms
7.
Certificates
8.
Security Considerations
9.
IANA Considerations
9.1.
XML Namespace Name for e2e Data in XMPP
10.
References
10.1.
Normative References
10.2.
Informative References
Appendix A.
Schema for urn:ietf:params:xml:ns:xmpp-objenc
§
Authors' Addresses
TOC |
End-to-end encryption of traffic sent over the Extensible Messaging and Presence Protocol [XMPP‑CORE] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.) is a desirable goal. Requirements and a threat analysis for XMPP encryption are provided in [E2E‑REQ] (Saint-Andre, P., “Requirements for End-to-End Encryption in the Extensible Messaging and Presence Protocol (XMPP),” June 2009.). Many possible approaches to meet those (or similar) requirements have been proposed over the years, including methods based on PGP, S/MIME, SIGMA, and TLS.
The S/MIME approach defined in RFC 3923 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 an encrypted 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). Therefore this document explores the possibility of an approach that is similar to but simpler than RFC 3923, but that retains the same basic object encryption model.
TOC |
This document inherits terminology defined in [XMPP‑CORE] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.).
The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14, RFC 2119 (Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.) [TERMS].
TOC |
The process a sending agent follows for securing stanzas is very similar regardless of the form of stanza (i.e., <iq/>, <message/>, or <presence/>).
HMAC-SHA256( SHA256(R), UTF8-encode(N+S') )
TOC |
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@montegue.net' type='chat'> <thread>8996aef0-061d-012d-347a-549a200771aa</thread> <body>Wherefore art thou, Romeo?</body> </message>
The Message Authentication Code is constructed from (line endings are included only for the sake of readability):
2010-02-28T18:00:00Z<message xmlns='jabber:client' from='juliet@capulet.net/balcony' id='183ef129' to='romeo@montegue.net' type='chat'><thread> 8996aef0-061d-012d-347a-549a200771aa</thread> <body>Wherefore art thou, Romeo?</body></message>
The sender then performs the steps from above, and sends the following:
<message xmlns='jabber:client' from='juliet@capulet.net/balcony' id='6410ed123' to='romeo@montegue.net' type='chat'> <thread>460f0da0-0628-012d-347b-549a200771aa</thread> <e2e xmlns='urn:ietf:params:xml:ns:xmpp-objenc' stamp='2010-02-28T18:00:00Z'> oOb/huFlvC17+XxZdye4BAj4jN2yWiSQZts7BctqZB+wo1tCfHE0w BMQlof4\nC7KLn6+ktILqX6k5/IgQrwGF0hxKjFk44R01RcVmzlUS 0HaSEIQVQk/3r33c\n3/NKzN8Cq+yzZKfP/p3KkpHMixCUTEe7B38 Eu9h5hfs8PgXkb/GAdw7Ea/qW\nQgRjYcNl7jcplYY/FQQTEEfQoc fKCbm/RaOsRSMnqGjkqGGt6+yQGWtvzSS2\nHD4/EHGV62IGz/sQH 5cAvloA9LqfiNh/oEm/UD2iLTAVj1BBS+WJZqMRznAJ\nNM4gF8vF nDdLAMyeMZedlrHCS4lp6PzeblDD0Jk2HQ== </e2e> </message>
NOTE: The sender SHOULD include a <thread/> with each chat to maintain conversation continuity.
TOC |
Several scenarios are possible when an entity receives an encrypted stanza:
- Case #1:
- The receiving application does not understand the protocol.
- Case #2:
- The receiving application understands the protocol and is able to decrypt the payload.
- Case #3:
- The receiving application understands the protocol and is able to decrypt the payload, but the timestamps fail the checks specified under Checking of Timestamps (Inclusion and Checking of Timestamps).
- Case #4:
- The receiving application understands the protocol but is unable to decrypt the payload.
In Case #1, the receiving application MUST do one and only one of the following: (1) ignore the <e2e/> extension, (2) ignore the entire stanza, or (3) return a <service-unavailable/> error to the sender, as described in [XMPP‑CORE] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.).
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 return a <not-acceptable/> error to the sender (as described in [XMPP‑CORE] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.)), optionally supplemented by an application-specific error condition element <bad-timestamp/> as shown below:
<message from='romeo@example.net/orchard' type='chat'> <e2e xmlns='urn:ietf:params:xml:ns:xmpp-objenc'> XML-character-data-here </e2e> <error type='modify'> <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <bad-timestamp xmlns='urn:ietf:params:xml:xmpp-e2e'/> </error> </message>
In Case #4, the receiving application SHOULD return a <bad-request/> error to the sender (as described in [XMPP‑CORE] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.)), optionally supplemented by an application-specific error condition element <decryption-failed/> as shown below:
<message from='romeo@example.net/orchard' type='chat'> <e2e xmlns='urn:ietf:params:xml:ns:xmpp-objenc'> XML-character-data-here </e2e> <error type='modify'> <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <decryption-failed xmlns='urn:ietf:params:xml:xmpp-e2e'/> </error> </message>
In addition to returning an error 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 decrypted).
TOC |
Timestamps are included to help prevent replay attacks. All timestamps MUST conform to [DATETIME] (Klyne, G. and C. Newman, “Date and Time on the Internet: Timestamps,” July 2002.) and be presented as UTC with no offset, including fractions of a second as appropriate. 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 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 [OFFLINE] (Saint-Andre, P., “Best Practices for Handling Offline Messages,” January 2006.), when sending an offline message to the recipient, the server SHOULD include delayed delivery data as specified in [DELAY] (Saint-Andre, P., “Delayed Delivery,” September 2009.) 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.
TOC |
All implementations MUST support the following algorithms. Implementations MAY support other algorithms as well.
TOC |
To participate in end-to-end encryption 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 [XMPP‑CORE] (Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.).
TOC |
To follow.
TOC |
TOC |
A URN sub-namespace of signed and encrypted content for the Extensible Messaging and Presence Protocol (XMPP) is defined as follows.
- URI:
- urn:ietf:params:xml:ns:xmpp-objenc
- Specification:
- RFC XXXX
- Description:
- This is an XML namespace name of signed and encrypted content for the Extensible Messaging and Presence Protocol as defined by RFC XXXX.
- Registrant Contact:
- IESG, <iesg@ietf.org>
TOC |
TOC |
[CMS-AES] | Schaad, J., “Use of the Advanced Encryption Standard (AES) Encryption Algorithm in Cryptographic Message Syntax (CMS),” RFC 3565, July 2003 (TXT). |
[CMS-ALG] | Housley, R., “Cryptographic Message Syntax (CMS) Algorithms,” RFC 3370, August 2002 (TXT). |
[DATETIME] | Klyne, G. and C. Newman, “Date and Time on the Internet: Timestamps,” RFC 3339, July 2002 (TXT). |
[E2E-REQ] | Saint-Andre, P., “Requirements for End-to-End Encryption in the Extensible Messaging and Presence Protocol (XMPP),” draft-saintandre-xmpp-e2e-requirements-01 (work in progress), June 2009 (TXT). |
[TERMS] | Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” BCP 14, RFC 2119, March 1997. |
[X509-ALGO] | Jonsson, J. and B. Kaliski, “Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1,” RFC 3447, February 2003 (TXT). |
[XMPP-CORE] | Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Core,” RFC 3920, October 2004 (TXT). |
TOC |
[DELAY] | Saint-Andre, P., “Delayed Delivery,” XSF XEP 0203, September 2009. |
[HMAC] | “The Keyed-Hash Message Authentication Code (HMAC): Federal Information Processing Standards Publication 198.” |
[OFFLINE] | Saint-Andre, P., “Best Practices for Handling Offline Messages,” XSF XEP 0160, January 2006. |
TOC |
The following XML schema is descriptive, not normative.
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:ietf:params:xml:ns:xmpp-objenc' xmlns='urn:ietf:params:xml:ns:xmpp-objenc' elementFormDefault='qualified'> <xs:element name='e2e' type='xs:string'/> <xs:element name='decryption-failed' type='empty'/> <xs:element name='bad-timestamp' type='empty'/> <xs:simpleType name='empty'> <xs:restriction base='xs:string'> <xs:enumeration value=''/> </xs:restriction> </xs:simpleType> </xs:schema>
TOC |
Matthew Miller | |
Cisco | |
Email: | mamille2@cisco.com |
Peter Saint-Andre | |
Cisco | |
Email: | psaintan@cisco.com |