draft-ietf-xmpp-core-22.txt   draft-ietf-xmpp-core-23.txt 
XMPP Working Group P. Saint-Andre (ed.) XMPP Working Group P. Saint-Andre, Ed.
Internet-Draft Jabber Software Foundation Internet-Draft Jabber Software Foundation
Expires: July 20, 2004 January 20, 2004 Expires: October 11, 2004 April 12, 2004
Extensible Messaging and Presence Protocol (XMPP): Core Extensible Messaging and Presence Protocol (XMPP): Core
draft-ietf-xmpp-core-22 draft-ietf-xmpp-core-23
Status of this Memo Status of this Memo
This document is an Internet-Draft and is in full conformance with This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC2026. all provisions of Section 10 of RFC2026.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that other Task Force (IETF), its areas, and its working groups. Note that other
groups may also distribute working documents as Internet-Drafts. groups may also distribute working documents as Internet-Drafts.
skipping to change at page 1, line 30 skipping to change at page 1, line 30
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at http:// The list of current Internet-Drafts can be accessed at http://
www.ietf.org/ietf/1id-abstracts.txt. www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on July 20, 2004. This Internet-Draft will expire on October 11, 2004.
Copyright Notice Copyright Notice
Copyright (C) The Internet Society (2004). All Rights Reserved. Copyright (C) The Internet Society (2004). All Rights Reserved.
Abstract Abstract
This memo defines the core features of the Extensible Messaging and This memo defines the core features of the Extensible Messaging and
Presence Protocol (XMPP), a protocol for streaming Extensible Markup Presence Protocol (XMPP), a protocol for streaming Extensible Markup
Language (XML) elements in order to exchange structured information Language (XML) elements in order to exchange structured information
in close to real time between any two network endpoints. While XMPP in close to real time between any two network endpoints. While XMPP
provides a generalized, extensible framework for exchanging XML data, provides a generalized, extensible framework for exchanging XML data,
it is used mainly for the purpose of building instant messaging and it is used mainly for the purpose of building instant messaging and
presence applications that meet the requirements of RFC 2779. presence applications that meet the requirements of RFC 2779.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Generalized Architecture . . . . . . . . . . . . . . . . . . . 4 2. Generalized Architecture . . . . . . . . . . . . . . . . . . . 4
3. Addressing Scheme . . . . . . . . . . . . . . . . . . . . . . 6 3. Addressing Scheme . . . . . . . . . . . . . . . . . . . . . . 5
4. XML Streams . . . . . . . . . . . . . . . . . . . . . . . . . 8 4. XML Streams . . . . . . . . . . . . . . . . . . . . . . . . . 8
5. Use of TLS . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5. Use of TLS . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6. Use of SASL . . . . . . . . . . . . . . . . . . . . . . . . . 26 6. Use of SASL . . . . . . . . . . . . . . . . . . . . . . . . . 26
7. Resource Binding . . . . . . . . . . . . . . . . . . . . . . . 37 7. Resource Binding . . . . . . . . . . . . . . . . . . . . . . . 36
8. Server Dialback . . . . . . . . . . . . . . . . . . . . . . . 39 8. Server Dialback . . . . . . . . . . . . . . . . . . . . . . . 39
9. XML Stanzas . . . . . . . . . . . . . . . . . . . . . . . . . 46 9. XML Stanzas . . . . . . . . . . . . . . . . . . . . . . . . . 47
10. Server Rules for Handling XML Stanzas . . . . . . . . . . . . 55 10. Server Rules for Handling XML Stanzas . . . . . . . . . . . . 56
11. XML Usage within XMPP . . . . . . . . . . . . . . . . . . . . 57 11. XML Usage within XMPP . . . . . . . . . . . . . . . . . . . . 58
12. Core Compliance Requirements . . . . . . . . . . . . . . . . . 60 12. Core Compliance Requirements . . . . . . . . . . . . . . . . . 60
13. Internationalization Considerations . . . . . . . . . . . . . 61 13. Internationalization Considerations . . . . . . . . . . . . . 61
14. Security Considerations . . . . . . . . . . . . . . . . . . . 62 14. Security Considerations . . . . . . . . . . . . . . . . . . . 62
15. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 67 15. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 67
Normative References . . . . . . . . . . . . . . . . . . . . . 69 Normative References . . . . . . . . . . . . . . . . . . . . . 69
Informative References . . . . . . . . . . . . . . . . . . . . 71 Informative References . . . . . . . . . . . . . . . . . . . . 71
Author's Address . . . . . . . . . . . . . . . . . . . . . . . 72 Author's Address . . . . . . . . . . . . . . . . . . . . . . . 72
A. Nodeprep . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 A. Nodeprep . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
B. Resourceprep . . . . . . . . . . . . . . . . . . . . . . . . . 74 B. Resourceprep . . . . . . . . . . . . . . . . . . . . . . . . . 74
C. XML Schemas . . . . . . . . . . . . . . . . . . . . . . . . . 76 C. XML Schemas . . . . . . . . . . . . . . . . . . . . . . . . . 75
D. Differences Between Core Jabber Protocol and XMPP . . . . . . 84 D. Differences Between Core Jabber Protocols and XMPP . . . . . . 84
E. Revision History . . . . . . . . . . . . . . . . . . . . . . . 85 Intellectual Property and Copyright Statements . . . . . . . . 86
Intellectual Property and Copyright Statements . . . . . . . . 95
1. Introduction 1. Introduction
1.1 Overview 1.1 Overview
The Extensible Messaging and Presence Protocol (XMPP) is an open XML The Extensible Messaging and Presence Protocol (XMPP) is an open XML
[XML] protocol for near-real-time messaging, presence, and [XML] protocol for near-real-time messaging, presence, and
request-response services. The basic syntax and semantics were request-response services. The basic syntax and semantics were
developed originally within the Jabber open-source community, mainly developed originally within the Jabber open-source community, mainly
in 1999. In 2002, the XMPP WG was chartered with developing an in 1999. In 2002, the XMPP WG was chartered with developing an
adaptation of the Jabber protocol that would be suitable as an IETF adaptation of the Jabber protocol that would be suitable as an IETF
instant messaging (IM) and presence technology. As a result of work instant messaging (IM) and presence technology. As a result of work
by the XMPP WG, the current memo defines the core features of XMPP; by the XMPP WG, the current memo defines the core features of XMPP;
the extensions required to provide the instant messaging and presence
functionality defined in RFC 2779 [IMP-REQS] are specified in
Extensible Messaging and Presence Protocol (XMPP): Instant Messaging Extensible Messaging and Presence Protocol (XMPP): Instant Messaging
and Presence [XMPP-IM] defines the extensions required to provide the and Presence [XMPP-IM].
instant messaging and presence functionality defined in RFC 2779
[IMP-REQS].
1.2 Terminology 1.2 Terminology
The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL", The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
"SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in RFC "OPTIONAL" in this document are to be interpreted as described in RFC
2119 [TERMS]. 2119 [TERMS].
1.3 Contributors 1.3 Contributors
skipping to change at page 4, line 13 skipping to change at page 4, line 13
Shchepin, Jean-Louis Seguineau, Iain Shigeoka, Greg Troxel, and David Shchepin, Jean-Louis Seguineau, Iain Shigeoka, Greg Troxel, and David
Waite. Thanks also to members of the XMPP Working Group and the IETF Waite. Thanks also to members of the XMPP Working Group and the IETF
community for comments and feedback provided throughout the life of community for comments and feedback provided throughout the life of
this memo. this memo.
2. Generalized Architecture 2. Generalized Architecture
2.1 Overview 2.1 Overview
Although XMPP is not wedded to any specific network architecture, to Although XMPP is not wedded to any specific network architecture, to
date it usually has been implemented via a typical client-server date it usually has been implemented via a client-server architecture
architecture, wherein a client utilizing XMPP accesses a server over wherein a client utilizing XMPP accesses a server over a [TCP]
a TCP [TCP] connection. connection, and servers also communicate with each other over TCP
connections.
The following diagram provides a high-level overview of this The following diagram provides a high-level overview of this
architecture (where "-" represents communications that use XMPP and architecture (where "-" represents communications that use XMPP and
"=" represents communications that use any other protocol). "=" represents communications that use any other protocol).
C1 - S1 - S2 - C3 C1----S1---S2---C3
/ \ |
C2 - G1 = FN1 = FC1 C2----+--G1===FN1===FC1
The symbols are as follows: The symbols are as follows:
o C1, C2, C3 -- XMPP clients o C1, C2, C3 = XMPP clients
o S1, S2 = XMPP servers
o S1, S2 -- XMPP servers o G1 = A gateway that translates between XMPP and the protocol(s)
o G1 -- A gateway that translates between XMPP and the protocol(s)
used on a foreign (non-XMPP) messaging network used on a foreign (non-XMPP) messaging network
o FN1 = A foreign messaging network
o FN1 -- A foreign messaging network o FC1 = A client on a foreign messaging network
o FC1 -- A client on a foreign messaging network
2.2 Server 2.2 Server
A server acts as an intelligent abstraction layer for XMPP A server acts as an intelligent abstraction layer for XMPP
communications. Its primary responsibilities are: communications. Its primary responsibilities are:
o to manage connections from or sessions for other entities, in the o to manage connections from or sessions for other entities, in the
form of XML streams (Section 4) to and from authorized clients, form of XML streams (Section 4) to and from authorized clients,
servers, and other entities servers, and other entities
o to route appropriately-addressed XML stanzas (Section 9) among o to route appropriately-addressed XML stanzas (Section 9) among
such entities over XML streams such entities over XML streams
Most XMPP-compliant servers also assume responsibility for the Most XMPP-compliant servers also assume responsibility for the
storage of data that is used by clients (e.g., contact lists for storage of data that is used by clients (e.g., contact lists for
users of XMPP-based instant messaging and presence applications); in users of XMPP-based instant messaging and presence applications); in
this case, the XML data is processed directly by the server itself on this case, the XML data is processed directly by the server itself on
behalf of the client and is not routed to another entity. behalf of the client and is not routed to another entity.
2.3 Client 2.3 Client
skipping to change at page 5, line 13 skipping to change at page 5, line 9
Most XMPP-compliant servers also assume responsibility for the Most XMPP-compliant servers also assume responsibility for the
storage of data that is used by clients (e.g., contact lists for storage of data that is used by clients (e.g., contact lists for
users of XMPP-based instant messaging and presence applications); in users of XMPP-based instant messaging and presence applications); in
this case, the XML data is processed directly by the server itself on this case, the XML data is processed directly by the server itself on
behalf of the client and is not routed to another entity. behalf of the client and is not routed to another entity.
2.3 Client 2.3 Client
Most clients connect directly to a server over a [TCP] connection and Most clients connect directly to a server over a [TCP] connection and
use XMPP to take full advantage of the functionality provided by a use XMPP to take full advantage of the functionality provided by a
server and any associated services. Although there is no necessary server and any associated services. Multiple resources (e.g.,
coupling of an XML stream to a TCP connection (e.g., a client could devices or locations) MAY connect simultaneously to a server on
connect via HTTP [HTTP] polling or some other mechanism), this behalf of each authorized client, with each resource differentiated
specification defines a binding of XMPP to TCP only. Multiple by the resource identifier of an XMPP address (e.g., <node@domain/
resources (e.g., devices or locations) MAY connect simultaneously to home> vs. <node@domain/work>) as defined under Addressing Scheme
a server on behalf of each authorized client, with each resource (Section 3). The RECOMMENDED port for connections between a client
differentiated by the resource identifier of an XMPP address (e.g., and a server is 5222, as registered with the IANA (see Port Numbers
<node@domain/home> vs. <node@domain/work>) as defined under (Section 15.9)).
Addressing Scheme (Section 3). The RECOMMENDED port for connections
between a client and a server is 5222, as registered with the IANA
(see Port Numbers (Section 15.9)).
2.4 Gateway 2.4 Gateway
A gateway is a special-purpose server-side service whose primary A gateway is a special-purpose server-side service whose primary
function is to translate XMPP into the protocol used by a foreign function is to translate XMPP into the protocol used by a foreign
(non-XMPP) messaging system, as well as to translate the return data (non-XMPP) messaging system, as well as to translate the return data
back into XMPP. Examples are gateways to Internet Relay Chat (IRC), back into XMPP. Examples are gateways to email (see [SMTP]),
Short Message Service (SMS), SIMPLE, SMTP, and legacy instant Internet Relay Chat (see [IRC]), SIMPLE (see [SIMPLE]), Short Message
messaging networks such as AIM, ICQ, MSN Messenger, and Yahoo! Service (SMS), and legacy instant messaging services such as AIM,
Instant Messenger. Communications between gateways and servers, and ICQ, MSN Messenger, and Yahoo! Instant Messenger. Communications
between gateways and the foreign messaging system, are not defined in between gateways and servers, and between gateways and the foreign
this document. messaging system, are not defined in this document.
2.5 Network 2.5 Network
Because each server is identified by a network address and because Because each server is identified by a network address and because
server-to-server communications are a straightforward extension of server-to-server communications are a straightforward extension of
the client-to-server protocol, in practice the system consists of a the client-to-server protocol, in practice the system consists of a
network of servers that inter-communicate. Thus user-a@domain1 is network of servers that inter-communicate. Thus, for example,
able to exchange messages, presence, and other information with <juliet@example.com> is able to exchange messages, presence, and
user-b@domain2. This pattern is familiar from messaging protocols other information with <romeo@example.net>. This pattern is familiar
(such as SMTP) that make use of network addressing standards. from messaging protocols (such as [SMTP]) that make use of network
Communications between any two servers are OPTIONAL. If enabled, addressing standards. Communications between any two servers are
such communications SHOULD occur over XML streams that are bound to OPTIONAL. If enabled, such communications SHOULD occur over XML
[TCP] connections. The RECOMMENDED port for connections between streams that are bound to [TCP] connections. The RECOMMENDED port
servers is 5269, as registered with the IANA (see Port Numbers for connections between servers is 5269, as registered with the IANA
(Section 15.9)). (see Port Numbers (Section 15.9)).
3. Addressing Scheme 3. Addressing Scheme
3.1 Overview 3.1 Overview
An entity is anything that can be considered a network endpoint An entity is anything that can be considered a network endpoint
(i.e., an ID on the network) and that can communicate using XMPP. (i.e., an ID on the network) and that can communicate using XMPP.
All such entities are uniquely addressable in a form that is All such entities are uniquely addressable in a form that is
consistent with RFC 2396 [URI]. For historical reasons, the address consistent with RFC 2396 [URI]. For historical reasons, the address
of an XMPP entity is called a Jabber Identifier or JID. A valid JID of an XMPP entity is called a Jabber Identifier or JID. A valid JID
skipping to change at page 9, line 7 skipping to change at page 8, line 46
4.1 Overview 4.1 Overview
Two fundamental concepts make possible the rapid, asynchronous Two fundamental concepts make possible the rapid, asynchronous
exchange of relatively small payloads of structured information exchange of relatively small payloads of structured information
between presence-aware entities: XML streams and XML stanzas. These between presence-aware entities: XML streams and XML stanzas. These
terms are defined as follows: terms are defined as follows:
Definition of XML Stream: An XML stream is a container for the Definition of XML Stream: An XML stream is a container for the
exchange of XML elements between any two entities over a network. exchange of XML elements between any two entities over a network.
An XML stream is negotiated from an initiating entity (usually a The start of an XML stream is denoted unambiguously by an opening
client or server) to a receiving entity (usually a server), XML <stream> tag (with appropriate attributes and namespace
normally over a [TCP] connection, and corresponds to the
initiating entity's "session" with the receiving entity. The
start of the XML stream is denoted unambiguously by an opening XML
<stream> tag (with appropriate attributes and namespace
declarations), while the end of the XML stream is denoted declarations), while the end of the XML stream is denoted
unambiguously by a closing XML </stream> tag. An XML stream is unambiguously by a closing XML </stream> tag. During the life of
unidirectional; in order to enable bidirectional information the stream, the entity that initiated it can send an unbounded
exchange, the initiating entity and receiving entity MUST number of XML elements over the stream, either elements used to
negotiate one stream in each direction (the "initial stream" and negotiate the stream (e.g., to negotiate use of TLS (Section 5) or
the "response stream"), normally over the same TCP connection. use of SASL (Section 6)) or XML stanzas (as defined herein,
<message/>, <presence/>, or <iq/> elements qualified by the
default namespace). The "initial stream" is negotiated from the
initiating entity (usually a client or server) to the receiving
entity (usually a server), and can be seen as corresponding to the
initiating entity's "session" with the receiving entity. The
initial stream enables unidirectional communication from the
initiating entity to the receiving entity; in order to enable
information exchange from the receiving entity to the initiating
entity, the receiving entity MUST negotiate a stream in the
opposite direction (the "response stream").
Definition of XML Stanza: An XML stanza is a discrete semantic unit Definition of XML Stanza: An XML stanza is a discrete semantic unit
of structured information that is sent from one entity to another of structured information that is sent from one entity to another
over an XML stream. An XML stanza exists at the direct child over an XML stream. An XML stanza exists at the direct child
level of the root <stream/> element and is said to be level of the root <stream/> element and is said to be
well-balanced if it matches production [43] content of [XML]. The well-balanced if it matches production [43] content of [XML]. The
start of any XML stanza is denoted unambiguously by the element start of any XML stanza is denoted unambiguously by the element
start tag at depth=1 of the XML stream (e.g., <presence>), and the start tag at depth=1 of the XML stream (e.g., <presence>), and the
end of any XML stanza is denoted unambiguously by the end of any XML stanza is denoted unambiguously by the
corresponding close tag at depth=1 (e.g., </presence>). An XML corresponding close tag at depth=1 (e.g., </presence>). An XML
stanza MAY contain child elements (with accompanying attributes, stanza MAY contain child elements (with accompanying attributes,
elements, and CDATA) as necessary in order to convey the desired elements, and XML character data) as necessary in order to convey
information. The only defined XML stanzas are <message/>, the desired information. The only XML stanzas defined herein are
<presence/>, and <iq/> as defined under XML Stanzas (Section 9); the <message/>, <presence/>, and <iq/> elements qualified by the
an XML element sent for the purpose of Transport Layer Security default namespace for the stream, as described under XML Stanzas
(TLS) negotiation (Section 5), Simple Authentication and Security (Section 9); an XML element sent for the purpose of Transport
Layer (SASL) negotiation (Section 6), or server dialback (Section Layer Security (TLS) negotiation (Section 5), Simple
8) is not considered to be an XML stanza. Authentication and Security Layer (SASL) negotiation (Section 6),
or server dialback (Section 8) is not considered to be an XML
stanza.
Consider the example of a client's session with a server. In order Consider the example of a client's session with a server. In order
to connect to a server, a client MUST initiate an XML stream by to connect to a server, a client MUST initiate an XML stream by
sending an opening <stream> tag to the server, optionally preceded by sending an opening <stream> tag to the server, optionally preceded by
a text declaration specifying the XML version and the character a text declaration specifying the XML version and the character
encoding supported (see Inclusion of Text Declaration (Section 11.4); encoding supported (see Inclusion of Text Declaration (Section 11.4);
see also Character Encoding (Section 11.5)). Subject to local see also Character Encoding (Section 11.5)). Subject to local
policies and service provisioning, the server SHOULD then reply with policies and service provisioning, the server SHOULD then reply with
a second XML stream back to the client, again optionally preceded by a second XML stream back to the client, again optionally preceded by
a text declaration. Once the client has completed SASL negotiation a text declaration. Once the client has completed SASL negotiation
(Section 6), the client MAY send an unbounded number of XML stanzas (Section 6), the client MAY send an unbounded number of XML stanzas
over the stream to any recipient on the network. When the client over the stream to any recipient on the network. When the client
desires to close the stream, it simply sends a closing </stream> tag desires to close the stream, it simply sends a closing </stream> tag
to the server (alternatively, the stream may be closed by the to the server (alternatively, the stream may be closed by the
server), after which both the client and server SHOULD close the server), after which both the client and server SHOULD terminate the
underlying TCP connection as well. underlying connection (usually a TCP connection) as well.
Those who are accustomed to thinking of XML in a document-centric Those who are accustomed to thinking of XML in a document-centric
manner may wish to view a client's session with a server as manner may wish to view a client's session with a server as
consisting of two open-ended XML documents: one from the client to consisting of two open-ended XML documents: one from the client to
the server and one from the server to the client. From this the server and one from the server to the client. From this
perspective, the root <stream/> element can be considered the perspective, the root <stream/> element can be considered the
document entity for each "document", and the two "documents" are document entity for each "document", and the two "documents" are
built up through the accumulation of XML stanzas sent over the two built up through the accumulation of XML stanzas sent over the two
XML streams. However, this perspective is a convenience only, and XML streams. However, this perspective is a convenience only, and
XMPP does not deal in documents but in XML streams and XML stanzas. XMPP does not deal in documents but in XML streams and XML stanzas.
skipping to change at page 10, line 39 skipping to change at page 10, line 39
|--------------------| |--------------------|
| <iq to='bar'> | | <iq to='bar'> |
| <query/> | | <query/> |
| </iq> | | </iq> |
|--------------------| |--------------------|
| ... | | ... |
|--------------------| |--------------------|
| </stream> | | </stream> |
|--------------------| |--------------------|
4.2 Stream Attributes 4.2 Binding to TCP
Although there is no necessary coupling of an XML stream to a [TCP]
connection (e.g., two entities could connect to each other via
another mechanism such as polling over [HTTP]), this specification
defines a binding of XMPP to TCP only. In the context of
client-to-server communications, a server MUST allow a client to
share a single TCP connection for XML stanzas sent from client to
server and from server to client. In the context of server-to-server
communications, a server MUST use one TCP connection for XML stanzas
sent from the server to the peer and another TCP connection
(initiated by the peer) for stanzas from the peer to the server, for
a total of two TCP connections.
4.3 Stream Security
When negotiating XML streams in XMPP 1.0, TLS SHOULD be used as
defined under Use of TLS (Section 5) and SASL MUST be used as defined
under Use of SASL (Section 6). The "initial stream" (i.e., the
stream from the initiating entity to the receiving entity) and the
"response stream" (i.e., the stream from the receiving entity to the
initiating entity) MUST be secured separately, although security in
both directions MAY be established via mechanisms that provide mutual
authentication. An entity SHOULD NOT attempt to send XML Stanzas
(Section 9) over the stream before the stream has been authenticated,
but if it does then the other entity MUST NOT accept such stanzas and
SHOULD return a <not-authorized/> stream error and then terminate
both the XML stream and the underlying TCP connection; note well that
this applies to XML stanzas only (i.e., <message/>, <presence/>, and
<iq/> elements scoped by the default namespace) and not to XML
elements used for stream negotiation (e.g., elements used to
negotiate use of TLS (Section 5) or Use of SASL (Section 6)).
4.4 Stream Attributes
The attributes of the stream element are as follows: The attributes of the stream element are as follows:
o to -- The 'to' attribute SHOULD be used only in the XML stream o to -- The 'to' attribute SHOULD be used only in the XML stream
header from the initiating entity to the receiving entity, and header from the initiating entity to the receiving entity, and
MUST be set to a hostname serviced by the receiving entity. There MUST be set to a hostname serviced by the receiving entity. There
SHOULD be no 'to' attribute set in the XML stream header by which SHOULD NOT be a 'to' attribute set in the XML stream header by
the receiving entity replies to the initiating entity; however, if which the receiving entity replies to the initiating entity;
a 'to' attribute is included, it SHOULD be silently ignored by the however, if a 'to' attribute is included, it SHOULD be silently
initiating entity. ignored by the initiating entity.
o from -- The 'from' attribute SHOULD be used only in the XML stream o from -- The 'from' attribute SHOULD be used only in the XML stream
header from the receiving entity to the initiating entity, and header from the receiving entity to the initiating entity, and
MUST be set to a hostname serviced by the receiving entity that is MUST be set to a hostname serviced by the receiving entity that is
granting access to the initiating entity. There SHOULD be no granting access to the initiating entity. There SHOULD NOT be a
'from' attribute on the XML stream header sent from the initiating 'from' attribute on the XML stream header sent from the initiating
entity to the receiving entity; however, if a 'from' attribute is entity to the receiving entity; however, if a 'from' attribute is
included, it SHOULD be silently ignored by the receiving entity. included, it SHOULD be silently ignored by the receiving entity.
o id -- The 'id' attribute SHOULD be used only in the XML stream o id -- The 'id' attribute SHOULD be used only in the XML stream
header from the receiving entity to the initiating entity. This header from the receiving entity to the initiating entity. This
attribute is a unique identifier created by the receiving entity attribute is a unique identifier created by the receiving entity
to function as a session key for the initiating entity's streams to function as a session key for the initiating entity's streams
with the receiving entity, and MUST be unique within the receiving with the receiving entity, and MUST be unique within the receiving
application (normally a server). Note well that the stream ID may application (normally a server). Note well that the stream ID may
be security-critical and therefore MUST be both unpredictable and be security-critical and therefore MUST be both unpredictable and
nonrepeating (see [RANDOM] for recommendations regarding nonrepeating (see [RANDOM] for recommendations regarding
randomness for security purposes). There SHOULD be no 'id' randomness for security purposes). There SHOULD NOT be an 'id'
attribute on the XML stream header sent from the initiating entity attribute on the XML stream header sent from the initiating entity
to the receiving entity; however, if an 'id' attribute is to the receiving entity; however, if an 'id' attribute is
included, it SHOULD be silently ignored by the receiving entity. included, it SHOULD be silently ignored by the receiving entity.
o xml:lang -- An 'xml:lang' attribute (as defined in Section 2.12 of o xml:lang -- An 'xml:lang' attribute (as defined in Section 2.12 of
[XML]) SHOULD be included by the initiating entity on the header [XML]) SHOULD be included by the initiating entity on the header
for the initial stream to specify the default language of any for the initial stream to specify the default language of any
human-readable XML character data it sends over that stream. If human-readable XML character data it sends over that stream. If
the attribute is included, the receiving entity SHOULD remember the attribute is included, the receiving entity SHOULD remember
that value as the default for both the initial stream and the that value as the default for both the initial stream and the
response stream; if the attribute is not included, the receiving response stream; if the attribute is not included, the receiving
entity SHOULD use a configurable default value for both streams, entity SHOULD use a configurable default value for both streams,
which it MUST communicate in the header for the response stream. which it MUST communicate in the header for the response stream.
For all stanzas sent over the initial stream, if the initiating For all stanzas sent over the initial stream, if the initiating
skipping to change at page 11, line 41 skipping to change at page 12, line 22
entity SHOULD use a configurable default value for both streams, entity SHOULD use a configurable default value for both streams,
which it MUST communicate in the header for the response stream. which it MUST communicate in the header for the response stream.
For all stanzas sent over the initial stream, if the initiating For all stanzas sent over the initial stream, if the initiating
entity does not include an 'xml:lang' attribute, the receiving entity does not include an 'xml:lang' attribute, the receiving
entity SHOULD apply the default value; if the initiating entity entity SHOULD apply the default value; if the initiating entity
does include an 'xml:lang' attribute, the receiving entity MUST does include an 'xml:lang' attribute, the receiving entity MUST
NOT modify or delete it (see also xml:lang (Section 9.1.5)). The NOT modify or delete it (see also xml:lang (Section 9.1.5)). The
value of the 'xml:lang' attribute MUST be an NMTOKEN (as defined value of the 'xml:lang' attribute MUST be an NMTOKEN (as defined
in Section 2.3 of [XML]) and MUST conform to the format defined in in Section 2.3 of [XML]) and MUST conform to the format defined in
RFC 3066 [LANGTAGS]. RFC 3066 [LANGTAGS].
o version -- The presence of the version attribute set to a value of o version -- The presence of the version attribute set to a value of
"1.0" signals support for the stream-related protocols (including at least "1.0" signals support for the stream-related protocols
stream features) defined in this specification. Detailed rules (including stream features) defined in this specification.
regarding generation and handling of this attribute are defined Detailed rules regarding generation and handling of this attribute
below. are defined below.
We can summarize as follows: We can summarize as follows:
| initiating to receiving | receiving to initiating | initiating to receiving | receiving to initiating
---------+---------------------------+----------------------- ---------+---------------------------+-----------------------
to | hostname of receiver | silently ignored to | hostname of receiver | silently ignored
from | silently ignored | hostname of receiver from | silently ignored | hostname of receiver
id | silently ignored | session key id | silently ignored | session key
xml:lang | default language | default language xml:lang | default language | default language
version | signals XMPP 1.0 support | signals XMPP 1.0 support version | signals XMPP 1.0 support | signals XMPP 1.0 support
4.2.1 Version Support 4.4.1 Version Support
The version of XMPP specified herein is "1.0"; in particular, this The version of XMPP specified herein is "1.0"; in particular, this
encapsulates the stream-related protocols (Use of TLS (Section 5), encapsulates the stream-related protocols (Use of TLS (Section 5),
Use of SASL (Section 6), and Stream Errors (Section 4.6)) as well as Use of SASL (Section 6), and Stream Errors (Section 4.7)) as well as
the semantics of the three defined XML stanza types (<message/>, the semantics of the three defined XML stanza types (<message/>,
<presence/>, and <iq/>). The numbering scheme for XMPP versions is <presence/>, and <iq/>). The numbering scheme for XMPP versions is
"<major>.<minor>". The major and minor numbers MUST be treated as "<major>.<minor>". The major and minor numbers MUST be treated as
separate integers and each number MAY be incremented higher than a separate integers and each number MAY be incremented higher than a
single digit. Thus, "XMPP 2.4" would be a lower version than "XMPP single digit. Thus, "XMPP 2.4" would be a lower version than "XMPP
2.13", which in turn would be lower than "XMPP 12.3". Leading zeros 2.13", which in turn would be lower than "XMPP 12.3". Leading zeros
(e.g., "XMPP 6.01") MUST be ignored by recipients and MUST NOT be (e.g., "XMPP 6.01") MUST be ignored by recipients and MUST NOT be
sent. sent.
The major version number should be incremented only if the stream and The major version number should be incremented only if the stream and
stanza formats or required actions have changed so dramatically that stanza formats or required actions have changed so dramatically that
an older version entity would not be able to interoperate with a an older version entity would not be able to interoperate with a
newer version entity if it simply ignored the elements and attributes newer version entity if it simply ignored the elements and attributes
it did not understand and took the actions specified in the older it did not understand and took the actions specified in the older
specification. The minor version number indicates new capabilities, specification. The minor version number indicates new capabilities,
and MUST be ignored by an entity with a smaller minor version number, and MUST be ignored by an entity with a smaller minor version number,
but used for informational purposes by the node with the larger minor but used for informational purposes by the entity with the larger
version number. For example, a minor version number might indicate minor version number. For example, a minor version number might
the ability to process a newly defined value of the 'type' attribute indicate the ability to process a newly defined value of the 'type'
for message, presence, or IQ stanzas; the node with the larger minor attribute for message, presence, or IQ stanzas; the entity with the
version number would simply note that its correspondent would not be larger minor version number would simply note that its correspondent
able to understand that value of the 'type' attribute and therefore would not be able to understand that value of the 'type' attribute
would not send it. and therefore would not send it.
The following rules apply to the generation and handling by The following rules apply to the generation and handling by
implementations of the 'version' attribute within stream headers: implementations of the 'version' attribute within stream headers:
1. The initiating entity MUST set the value of the 'version' 1. The initiating entity MUST set the value of the 'version'
attribute on the initial stream header to the highest version attribute on the initial stream header to the highest version
number it supports (e.g., if the highest version number it number it supports (e.g., if the highest version number it
supports is that defined in this specification, it MUST set the supports is that defined in this specification, it MUST set the
value to "1.0"). value to "1.0").
2. The receiving entity MUST set the value of the 'version' 2. The receiving entity MUST set the value of the 'version'
attribute on the response stream header to either the value attribute on the response stream header to either the value
supplied by the initiating entity or highest version number supplied by the initiating entity or the highest version number
supported by the receiving entity, whichever is lower. The supported by the receiving entity, whichever is lower. The
receiving entity MUST perform a numeric comparison on the major receiving entity MUST perform a numeric comparison on the major
and minor version numbers, not a string match on and minor version numbers, not a string match on
"<major>.<minor>". "<major>.<minor>".
3. If the version number included in the response stream header is 3. If the version number included in the response stream header is
at least one major version lower than the version number included at least one major version lower than the version number included
in the initial stream header and newer version entities cannot in the initial stream header and newer version entities cannot
interoperate with older version entities as described above, the interoperate with older version entities as described above, the
initiating entity SHOULD generate an <unsupported-version/> initiating entity SHOULD generate an <unsupported-version/>
stream error and terminate the XML stream and underlying TCP stream error and terminate the XML stream and underlying TCP
connection. connection.
4. If either entity receives a stream header with no 'version' 4. If either entity receives a stream header with no 'version'
attribute, the entity MUST consider the version supported by the attribute, the entity MUST consider the version supported by the
other entity to be "0.0" and SHOULD NOT include a 'version' other entity to be "0.0" and SHOULD NOT include a 'version'
attribute in the stream header it sends in reply. attribute in the stream header it sends in reply.
4.3 Namespace Declarations 4.5 Namespace Declarations
The stream element MUST possess both a streams namespace declaration The stream element MUST possess both a streams namespace declaration
and a default namespace declaration (as "namespace declaration" is and a default namespace declaration (as "namespace declaration" is
defined in the XML namespaces specification [XML-NAMES]). For defined in the XML namespaces specification [XML-NAMES]). For
detailed information regarding the streams namespace and default detailed information regarding the streams namespace and default
namespace, see Namespace Names and Prefixes (Section 11.2). namespace, see Namespace Names and Prefixes (Section 11.2).
4.4 Stream Features 4.6 Stream Features
If the initiating entity includes the 'version' attribute set to a If the initiating entity includes the 'version' attribute set to a
value of "1.0" in the initial stream header, the receiving entity value of at least "1.0" in the initial stream header, the receiving
MUST send a <features/> child element (prefixed by the streams entity MUST send a <features/> child element (prefixed by the streams
namespace prefix) to the initiating entity in order to announce any namespace prefix) to the initiating entity in order to announce any
stream-level features that can be negotiated (or capabilities that stream-level features that can be negotiated (or capabilities that
otherwise need to be advertised). Currently this is used only to otherwise need to be advertised). Currently this is used only to
advertise Use of TLS (Section 5), Use of SASL (Section 6), and advertise Use of TLS (Section 5), Use of SASL (Section 6), and
Resource Binding (Section 7) as defined herein, and for Session Resource Binding (Section 7) as defined herein, and for Session
Establishment as defined in [XMPP-IM]; however, the stream features Establishment as defined in [XMPP-IM]; however, the stream features
functionality could be used to advertise other negotiable features in functionality could be used to advertise other negotiable features in
the future. If an entity does not understand or support some the future. If an entity does not understand or support some
features, it SHOULD silently ignore them. features, it SHOULD silently ignore them.
4.5 Stream Security 4.7 Stream Errors
When negotiating XML streams in XMPP 1.0, TLS SHOULD be used as
defined under Use of TLS (Section 5) and SASL MUST be used as defined
under Use of SASL (Section 6). If the initiating entity attempts to
send an XML Stanza (Section 9) before the stream has been
authenticated, the receiving entity SHOULD return a <not-authorized/>
stream error to the initiating entity and then terminate both the XML
stream and the underlying TCP connection.
4.6 Stream Errors
The root stream element MAY contain an <error/> child element that is The root stream element MAY contain an <error/> child element that is
prefixed by the streams namespace prefix. The error child MUST be prefixed by the streams namespace prefix. The error child MUST be
sent by a compliant entity (usually a server rather than a client) if sent by a compliant entity (usually a server rather than a client) if
it perceives that a stream-level error has occurred. it perceives that a stream-level error has occurred.
4.6.1 Rules 4.7.1 Rules
The following rules apply to stream-level errors: The following rules apply to stream-level errors:
o It is assumed that all stream-level errors are unrecoverable; o It is assumed that all stream-level errors are unrecoverable;
therefore, if an error occurs at the level of the stream, the therefore, if an error occurs at the level of the stream, the
entity that detects the error MUST send a stream error to the entity that detects the error MUST send a stream error to the
other entity, send a closing </stream> tag, and terminate the other entity, send a closing </stream> tag, and terminate the
underlying TCP connection. underlying TCP connection.
o If the error occurs while the stream is being set up, the o If the error occurs while the stream is being set up, the
receiving entity MUST still send the opening <stream> tag, include receiving entity MUST still send the opening <stream> tag, include
the <error/> element as a child of the stream element, send the the <error/> element as a child of the stream element, send the
closing </stream> tag, and terminate the underlying TCP closing </stream> tag, and terminate the underlying TCP
connection. In this case, if the initiating entity provides an connection. In this case, if the initiating entity provides an
unknown host in the 'to' attribute (or provides no 'to' attribute unknown host in the 'to' attribute (or provides no 'to' attribute
at all), the server SHOULD provide the server's authoritative at all), the server SHOULD provide the server's authoritative
hostname in the 'from' attribute of the stream header sent before hostname in the 'from' attribute of the stream header sent before
termination. termination.
skipping to change at page 14, line 35 skipping to change at page 14, line 47
o If the error occurs while the stream is being set up, the o If the error occurs while the stream is being set up, the
receiving entity MUST still send the opening <stream> tag, include receiving entity MUST still send the opening <stream> tag, include
the <error/> element as a child of the stream element, send the the <error/> element as a child of the stream element, send the
closing </stream> tag, and terminate the underlying TCP closing </stream> tag, and terminate the underlying TCP
connection. In this case, if the initiating entity provides an connection. In this case, if the initiating entity provides an
unknown host in the 'to' attribute (or provides no 'to' attribute unknown host in the 'to' attribute (or provides no 'to' attribute
at all), the server SHOULD provide the server's authoritative at all), the server SHOULD provide the server's authoritative
hostname in the 'from' attribute of the stream header sent before hostname in the 'from' attribute of the stream header sent before
termination. termination.
4.6.2 Syntax 4.7.2 Syntax
The syntax for stream errors is as follows: The syntax for stream errors is as follows:
<stream:error> <stream:error>
<defined-condition xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> <defined-condition xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
<text xmlns='urn:ietf:params:xml:ns:xmpp-streams'> <text xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
OPTIONAL descriptive text OPTIONAL descriptive text
</text> </text>
[OPTIONAL application-specific condition element] [OPTIONAL application-specific condition element]
</stream:error> </stream:error>
skipping to change at page 15, line 25 skipping to change at page 15, line 36
that namespace that namespace
The <text/> element is OPTIONAL. If included, it SHOULD be used only The <text/> element is OPTIONAL. If included, it SHOULD be used only
to provide descriptive or diagnostic information that supplements the to provide descriptive or diagnostic information that supplements the
meaning of a defined condition or application-specific condition. It meaning of a defined condition or application-specific condition. It
SHOULD NOT be interpreted programmatically by an application. It SHOULD NOT be interpreted programmatically by an application. It
SHOULD NOT be used as the error message presented to a user, but MAY SHOULD NOT be used as the error message presented to a user, but MAY
be shown in addition to the error message associated with the be shown in addition to the error message associated with the
included condition element (or elements). included condition element (or elements).
4.6.3 Defined Conditions 4.7.3 Defined Conditions
The following stream-level error conditions are defined: The following stream-level error conditions are defined:
o <bad-format/> -- the entity has sent XML that cannot be processed; o <bad-format/> -- the entity has sent XML that cannot be processed;
this error MAY be used rather than more specific XML-related this error MAY be used rather than more specific XML-related
errors such as <bad-namespace-prefix/>, <invalid-xml/>, errors such as <bad-namespace-prefix/>, <invalid-xml/>,
<restricted-xml/>, <unsupported-encoding/>, and <restricted-xml/>, <unsupported-encoding/>, and
<xml-not-well-formed/>, although the more specific errors are <xml-not-well-formed/>, although the more specific errors are
preferred. preferred.
o <bad-namespace-prefix/> -- the entity has sent a namespace prefix o <bad-namespace-prefix/> -- the entity has sent a namespace prefix
that is unsupported, or has sent no namespace prefix on an element that is unsupported, or has sent no namespace prefix on an element
that requires such a prefix (see XML Namespace Names and Prefixes that requires such a prefix (see XML Namespace Names and Prefixes
(Section 11.2)). (Section 11.2)).
o <conflict/> -- the server is closing the active stream for this o <conflict/> -- the server is closing the active stream for this
entity because a new stream has been initiated that conflicts with entity because a new stream has been initiated that conflicts with
the existing stream. the existing stream.
o <connection-timeout/> -- the entity has not generated any traffic o <connection-timeout/> -- the entity has not generated any traffic
over the stream for some period of time (configurable according to over the stream for some period of time (configurable according to
a local service policy). a local service policy).
o <host-gone/> -- the value of the 'to' attribute provided by the o <host-gone/> -- the value of the 'to' attribute provided by the
initiating entity in the stream header corresponds to a hostname initiating entity in the stream header corresponds to a hostname
that is no longer hosted by the server. that is no longer hosted by the server.
o <host-unknown/> -- the value of the 'to' attribute provided by the o <host-unknown/> -- the value of the 'to' attribute provided by the
initiating entity in the stream header does not correspond to a initiating entity in the stream header does not correspond to a
hostname that is hosted by the server. hostname that is hosted by the server.
o <improper-addressing/> -- a stanza sent between two servers lacks o <improper-addressing/> -- a stanza sent between two servers lacks
a 'to' or 'from' attribute (or the attribute has no value). a 'to' or 'from' attribute (or the attribute has no value).
o <internal-server-error/> -- the server has experienced a o <internal-server-error/> -- the server has experienced a
misconfiguration or an otherwise-undefined internal error that misconfiguration or an otherwise-undefined internal error that
prevents it from servicing the stream. prevents it from servicing the stream.
o <invalid-from/> -- the JID or hostname provided in a 'from' o <invalid-from/> -- the JID or hostname provided in a 'from'
address does not match an authorized JID or validated domain address does not match an authorized JID or validated domain
negotiated between servers via SASL or dialback, or between a negotiated between servers via SASL or dialback, or between a
client and a server via authentication and resource binding. client and a server via authentication and resource binding.
o <invalid-id/> -- the stream ID or dialback ID is invalid or does o <invalid-id/> -- the stream ID or dialback ID is invalid or does
not match an ID previously provided. not match an ID previously provided.
o <invalid-namespace/> -- the streams namespace name is something o <invalid-namespace/> -- the streams namespace name is something
other than "http://etherx.jabber.org/streams" or the dialback other than "http://etherx.jabber.org/streams" or the dialback
namespace name is something other than "jabber:server:dialback" namespace name is something other than "jabber:server:dialback"
(see XML Namespace Names and Prefixes (Section 11.2)). (see XML Namespace Names and Prefixes (Section 11.2)).
o <invalid-xml/> -- the entity has sent invalid XML over the stream o <invalid-xml/> -- the entity has sent invalid XML over the stream
to a server that performs validation (see Validation (Section to a server that performs validation (see Validation (Section
11.3)). 11.3)).
o <not-authorized/> -- the entity has attempted to send data before o <not-authorized/> -- the entity has attempted to send data before
the stream has been authenticated, or otherwise is not authorized the stream has been authenticated, or otherwise is not authorized
to perform an action related to stream negotiation; the receiving to perform an action related to stream negotiation; the receiving
entity MUST NOT process the offending stanza before sending the entity MUST NOT process the offending stanza before sending the
stream error. stream error.
o <policy-violation/> -- the entity has violated some local service o <policy-violation/> -- the entity has violated some local service
policy; the server MAY choose to specify the policy in the <text/> policy; the server MAY choose to specify the policy in the <text/>
element. element or an application-specific condition element.
o <remote-connection-failed/> -- the server is unable to properly o <remote-connection-failed/> -- the server is unable to properly
connect to a remote entity that is required for authentication or connect to a remote entity that is required for authentication or
authorization. authorization.
o <resource-constraint/> -- the server lacks the system resources o <resource-constraint/> -- the server lacks the system resources
necessary to service the stream. necessary to service the stream.
o <restricted-xml/> -- the entity has attempted to send restricted o <restricted-xml/> -- the entity has attempted to send restricted
XML features such as a comment, processing instruction, DTD, XML features such as a comment, processing instruction, DTD,
entity reference, or unescaped character (see Restrictions entity reference, or unescaped character (see Restrictions
(Section 11.1)). (Section 11.1)).
o <see-other-host/> -- the server will not provide service to the o <see-other-host/> -- the server will not provide service to the
initiating entity but is redirecting traffic to another host; the initiating entity but is redirecting traffic to another host; the
server SHOULD specify the alternate hostname or IP address (which server SHOULD specify the alternate hostname or IP address (which
MUST be a valid domain identifier) in the CDATA of the MUST be a valid domain identifier) as the XML character data of
<see-other-host/> element. the <see-other-host/> element.
o <system-shutdown/> -- the server is being shut down and all active o <system-shutdown/> -- the server is being shut down and all active
streams are being closed. streams are being closed.
o <undefined-condition/> -- the error condition is not one of those o <undefined-condition/> -- the error condition is not one of those
defined by the other conditions in this list; this error condition defined by the other conditions in this list; this error condition
SHOULD be used only in conjunction with an application-specific SHOULD be used only in conjunction with an application-specific
condition. condition.
o <unsupported-encoding/> -- the initiating entity has encoded the o <unsupported-encoding/> -- the initiating entity has encoded the
stream in an encoding that is not supported by the server (see stream in an encoding that is not supported by the server (see
Character Encoding (Section 11.5)). Character Encoding (Section 11.5)).
o <unsupported-stanza-type/> -- the initiating entity has sent a o <unsupported-stanza-type/> -- the initiating entity has sent a
first-level child of the stream that is not supported by the first-level child of the stream that is not supported by the
server. server.
o <unsupported-version/> -- the value of the 'version' attribute o <unsupported-version/> -- the value of the 'version' attribute
provided by the initiating entity in the stream header specifies a provided by the initiating entity in the stream header specifies a
version of XMPP that is not supported by the server; the server version of XMPP that is not supported by the server; the server
MAY specify the version(s) it supports in the <text/> element. MAY specify the version(s) it supports in the <text/> element.
o <xml-not-well-formed/> -- the initiating entity has sent XML that o <xml-not-well-formed/> -- the initiating entity has sent XML that
is not well-formed as defined by [XML]. is not well-formed as defined by [XML].
4.6.4 Application-Specific Conditions 4.7.4 Application-Specific Conditions
As noted, an application MAY provide application-specific stream As noted, an application MAY provide application-specific stream
error information by including a properly-namespaced child in the error information by including a properly-namespaced child in the
error element. The application-specific element SHOULD supplement or error element. The application-specific element SHOULD supplement or
further qualify a defined element. Thus the <error/> element will further qualify a defined element. Thus the <error/> element will
contain two or three child elements: contain two or three child elements:
<stream:error> <stream:error>
<xml-not-well-formed <xml-not-well-formed
xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
<text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'> <text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
Some special application diagnostic information! Some special application diagnostic information!
</text> </text>
<escape-your-data xmlns='application-ns'/> <escape-your-data xmlns='application-ns'/>
</stream:error> </stream:error>
</stream:stream> </stream:stream>
4.7 Simplified Stream Examples 4.8 Simplified Stream Examples
This section contains two simplified examples of a stream-based This section contains two simplified examples of a stream-based
"session" of a client on a server (where the "C" lines are sent from "session" of a client on a server (where the "C" lines are sent from
the client to the server, and the "S" lines are sent from the server the client to the server, and the "S" lines are sent from the server
to the client); these examples are included for the purpose of to the client); these examples are included for the purpose of
illustrating the concepts introduced thus far. illustrating the concepts introduced thus far.
A basic "session": A basic "session":
C: <?xml version='1.0'?> C: <?xml version='1.0'?>
skipping to change at page 19, line 46 skipping to change at page 20, line 8
both. Clients SHOULD use TLS to secure the streams prior to both. Clients SHOULD use TLS to secure the streams prior to
attempting to complete SASL negotiation (Section 6), and servers attempting to complete SASL negotiation (Section 6), and servers
SHOULD use TLS between two domains for the purpose of securing SHOULD use TLS between two domains for the purpose of securing
server-to-server communications. server-to-server communications.
The following rules apply: The following rules apply:
1. An initiating entity that complies with this specification MUST 1. An initiating entity that complies with this specification MUST
include the 'version' attribute set to a value of "1.0" in the include the 'version' attribute set to a value of "1.0" in the
initial stream header. initial stream header.
2. If the TLS negotiation occurs between two servers, 2. If the TLS negotiation occurs between two servers,
communications MUST NOT proceed until the Domain Name System communications MUST NOT proceed until the Domain Name System
(DNS) hostnames asserted by the servers have been resolved (see (DNS) hostnames asserted by the servers have been resolved (see
Server-to-Server Communications (Section 14.4)). Server-to-Server Communications (Section 14.4)).
3. When a receiving entity that complies with this specification 3. When a receiving entity that complies with this specification
receives an initial stream header that includes the 'version' receives an initial stream header that includes the 'version'
attribute set to a value of "1.0", after sending a stream header attribute set to a value of at least "1.0", after sending a
in reply (including the version flag) it MUST include a stream header in reply (including the version flag) it MUST
<starttls/> element (qualified by the include a <starttls/> element (qualified by the
'urn:ietf:params:xml:ns:xmpp-tls' namespace) along with the list 'urn:ietf:params:xml:ns:xmpp-tls' namespace) along with the list
of other stream features it supports. of other stream features it supports.
4. If the initiating entity chooses to use TLS, TLS negotiation 4. If the initiating entity chooses to use TLS, TLS negotiation
MUST be completed before proceeding to SASL negotiation; this MUST be completed before proceeding to SASL negotiation; this
order of negotiation is required in order to help safeguard order of negotiation is required in order to help safeguard
authentication information sent during SASL negotiation, as well authentication information sent during SASL negotiation, as well
as to make it possible to base the use of the SASL EXTERNAL as to make it possible to base the use of the SASL EXTERNAL
mechanism on a certificate provided during prior TLS mechanism on a certificate provided during prior TLS
negotiation. negotiation.
5. During TLS negotiation, an entity MUST NOT send any white space 5. During TLS negotiation, an entity MUST NOT send any white space
characters (matching production [3] content of [XML]) within the characters (matching production [3] content of [XML]) within the
root stream element as separators between elements (any white root stream element as separators between elements (any white
space characters shown in the TLS examples below are included space characters shown in the TLS examples below are included
for the sake of readability only); this prohibition helps to for the sake of readability only); this prohibition helps to
ensure proper security layer byte precision. ensure proper security layer byte precision.
6. The receiving entity MUST consider the TLS negotiation to have 6. The receiving entity MUST consider the TLS negotiation to have
begun immediately after sending the closing ">" character of the begun immediately after sending the closing ">" character of the
<proceed/> element. The initiating entity MUST consider the TLS <proceed/> element. The initiating entity MUST consider the TLS
negotiation to have begun immediately after receiving the negotiation to have begun immediately after receiving the
closing ">" character of the <proceed/> element from the closing ">" character of the <proceed/> element from the
receiving entity. receiving entity.
7. The initiating entity MUST validate the certificate presented by 7. The initiating entity MUST validate the certificate presented by
the receiving entity; see Certificate Validation (Section 14.2) the receiving entity; see Certificate Validation (Section 14.2)
regarding certificate validation procedures. regarding certificate validation procedures.
8. Certificates MUST be checked against the hostname as provided by 8. Certificates MUST be checked against the hostname as provided by
the initiating entity (e.g., a user), not the hostname as the initiating entity (e.g., a user), not the hostname as
resolved via the Domain Name System; e.g., if the user specifies resolved via the Domain Name System; e.g., if the user specifies
a hostname of "example.com" but a DNS SRV [SRV] lookup returned a hostname of "example.com" but a DNS SRV [SRV] lookup returned
"im.example.com", the certificate MUST be checked as "im.example.com", the certificate MUST be checked as
"example.com". If a JID for any kind of XMPP entity (e.g., "example.com". If a JID for any kind of XMPP entity (e.g.,
client or server) is represented in a certificate, it SHOULD be client or server) is represented in a certificate, it SHOULD be
encoded as a GeneralName entry of type otherName inside the encoded as a GeneralName entry of type otherName inside the
subjectAltName, along with a type-id whose value is "xmpp" (as subjectAltName, along with a type-id whose value is "xmpp" (as
these terms are profiled in [X509]). these terms are profiled in [X509]).
skipping to change at page 20, line 49 skipping to change at page 20, line 51
8. Certificates MUST be checked against the hostname as provided by 8. Certificates MUST be checked against the hostname as provided by
the initiating entity (e.g., a user), not the hostname as the initiating entity (e.g., a user), not the hostname as
resolved via the Domain Name System; e.g., if the user specifies resolved via the Domain Name System; e.g., if the user specifies
a hostname of "example.com" but a DNS SRV [SRV] lookup returned a hostname of "example.com" but a DNS SRV [SRV] lookup returned
"im.example.com", the certificate MUST be checked as "im.example.com", the certificate MUST be checked as
"example.com". If a JID for any kind of XMPP entity (e.g., "example.com". If a JID for any kind of XMPP entity (e.g.,
client or server) is represented in a certificate, it SHOULD be client or server) is represented in a certificate, it SHOULD be
encoded as a GeneralName entry of type otherName inside the encoded as a GeneralName entry of type otherName inside the
subjectAltName, along with a type-id whose value is "xmpp" (as subjectAltName, along with a type-id whose value is "xmpp" (as
these terms are profiled in [X509]). these terms are profiled in [X509]).
9. If the TLS negotiation is successful, the receiving entity MUST 9. If the TLS negotiation is successful, the receiving entity MUST
discard any knowledge obtained in an insecure manner from the discard any knowledge obtained in an insecure manner from the
initiating entity before TLS takes effect. initiating entity before TLS takes effect.
10. If the TLS negotiation is successful, the initiating entity MUST 10. If the TLS negotiation is successful, the initiating entity MUST
discard any knowledge obtained in an insecure manner from the discard any knowledge obtained in an insecure manner from the
receiving entity before TLS takes effect. receiving entity before TLS takes effect.
11. If the TLS negotiation is successful, the receiving entity MUST 11. If the TLS negotiation is successful, the receiving entity MUST
NOT offer the STARTTLS extension to the initiating entity along NOT offer the STARTTLS extension to the initiating entity along
with the other stream features that are offered when the stream with the other stream features that are offered when the stream
is restarted. is restarted.
12. If the TLS negotiation is successful, the initiating entity MUST 12. If the TLS negotiation is successful, the initiating entity MUST
continue with SASL negotiation. continue with SASL negotiation.
13. If the TLS negotiation results in failure, the receiving entity 13. If the TLS negotiation results in failure, the receiving entity
MUST terminate both the XML stream and the underlying TCP MUST terminate both the XML stream and the underlying TCP
connection. connection.
14. See Mandatory-to-Implement Technologies (Section 14.7) regarding 14. See Mandatory-to-Implement Technologies (Section 14.7) regarding
mechanisms that MUST be supported. mechanisms that MUST be supported.
5.2 Narrative 5.2 Narrative
When an initiating entity secures a stream with a receiving entity, When an initiating entity secures a stream with a receiving entity
the steps involved are as follows: using TLS, the steps involved are as follows:
1. The initiating entity opens a TCP connection and initiates the 1. The initiating entity opens a TCP connection and initiates the
stream by sending the opening XML stream header to the receiving stream by sending the opening XML stream header to the receiving
entity, including the 'version' attribute set to a value of entity, including the 'version' attribute set to a value of at
"1.0". least "1.0".
2. The receiving entity responds by opening a TCP connection and 2. The receiving entity responds by opening a TCP connection and
sending an XML stream header to the initiating entity, including sending an XML stream header to the initiating entity, including
the 'version' attribute set to a value of "1.0". the 'version' attribute set to a value of at least "1.0".
3. The receiving entity offers the STARTTLS extension to the 3. The receiving entity offers the STARTTLS extension to the
initiating entity by including it with the list of other initiating entity by including it with the list of other
supported stream features (if TLS is required for interaction supported stream features (if TLS is required for interaction
with the receiving entity, it SHOULD signal that fact by with the receiving entity, it SHOULD signal that fact by
including a <required/> element as a child of the <starttls/> including a <required/> element as a child of the <starttls/>
element). element).
4. The initiating entity issues the STARTTLS command (i.e., a 4. The initiating entity issues the STARTTLS command (i.e., a
<starttls/> element qualified by the <starttls/> element qualified by the
'urn:ietf:params:xml:ns:xmpp-tls' namespace) to instruct the 'urn:ietf:params:xml:ns:xmpp-tls' namespace) to instruct the
receiving entity that it wishes to begin a TLS negotiation to receiving entity that it wishes to begin a TLS negotiation to
secure the stream. secure the stream.
5. The receiving entity MUST reply with either a <proceed/> element 5. The receiving entity MUST reply with either a <proceed/> element
or a <failure/> element qualified by the or a <failure/> element qualified by the
'urn:ietf:params:xml:ns:xmpp-tls' namespace. If the failure case 'urn:ietf:params:xml:ns:xmpp-tls' namespace. If the failure case
occurs, the receiving entity MUST terminate both the XML stream occurs, the receiving entity MUST terminate both the XML stream
and the underlying TCP connection. If the proceed case occurs, and the underlying TCP connection. If the proceed case occurs,
the entities MUST attempt to complete the TLS negotiation over the entities MUST attempt to complete the TLS negotiation over
the TCP connection and MUST NOT send any further XML data until the TCP connection and MUST NOT send any further XML data until
the TLS negotiation is complete. the TLS negotiation is complete.
6. The initiating entity and receiving entity attempt to complete a 6. The initiating entity and receiving entity attempt to complete a
skipping to change at page 22, line 14 skipping to change at page 22, line 7
or a <failure/> element qualified by the or a <failure/> element qualified by the
'urn:ietf:params:xml:ns:xmpp-tls' namespace. If the failure case 'urn:ietf:params:xml:ns:xmpp-tls' namespace. If the failure case
occurs, the receiving entity MUST terminate both the XML stream occurs, the receiving entity MUST terminate both the XML stream
and the underlying TCP connection. If the proceed case occurs, and the underlying TCP connection. If the proceed case occurs,
the entities MUST attempt to complete the TLS negotiation over the entities MUST attempt to complete the TLS negotiation over
the TCP connection and MUST NOT send any further XML data until the TCP connection and MUST NOT send any further XML data until
the TLS negotiation is complete. the TLS negotiation is complete.
6. The initiating entity and receiving entity attempt to complete a 6. The initiating entity and receiving entity attempt to complete a
TLS negotiation in accordance with [TLS]. TLS negotiation in accordance with [TLS].
7. If the TLS negotiation is unsuccessful, the receiving entity MUST 7. If the TLS negotiation is unsuccessful, the receiving entity MUST
terminate the TCP connection (it is not necessary to send a terminate the TCP connection. If the TLS negotiation is
closing </stream> tag first, since the receiving entity and successful, the initiating entity MUST initiate a new stream by
initiating entity MUST consider the original stream to be closed sending an opening XML stream header to the receiving entity (it
upon sending or receiving the <success/> element). If the TLS is not necessary to send a closing </stream> tag first, since the
negotiation is successful, the initiating entity MUST initiate a receiving entity and initiating entity MUST consider the original
new stream by sending an opening XML stream header to the stream to be closed upon successful TLS negotiation).
receiving entity.
8. Upon receiving the new stream header from the initiating entity, 8. Upon receiving the new stream header from the initiating entity,
the receiving entity MUST respond by sending a new XML stream the receiving entity MUST respond by sending a new XML stream
header to the initiating entity along with the available features header to the initiating entity along with the available features
(but NOT including the STARTTLS feature). (but not including the STARTTLS feature).
5.3 Client-to-Server Example 5.3 Client-to-Server Example
The following example shows the data flow for a client securing a The following example shows the data flow for a client securing a
stream using STARTTLS (note: the alternate steps shown below are stream using STARTTLS (note: the alternate steps shown below are
provided to illustrate the protocol for failure cases; they are not provided to illustrate the protocol for failure cases; they are not
exhaustive and would not necessarily be triggered by the data sent in exhaustive and would not necessarily be triggered by the data sent in
the example). the example).
Step 1: Client initiates stream to server: Step 1: Client initiates stream to server:
skipping to change at page 23, line 46 skipping to change at page 23, line 43
Step 7: If TLS negotiation is successful, client initiates a new Step 7: If TLS negotiation is successful, client initiates a new
stream to server: stream to server:
<stream:stream <stream:stream
xmlns='jabber:client' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams' xmlns:stream='http://etherx.jabber.org/streams'
to='example.com' to='example.com'
version='1.0'> version='1.0'>
Step 7 (alt): If TLS negotiation is unsuccessful, Server2 closes TCP Step 7 (alt): If TLS negotiation is unsuccessful, server closes TCP
connection. connection.
Step 8: Server responds by sending a stream header to client along Step 8: Server responds by sending a stream header to client along
with any available stream features: with any available stream features:
<stream:stream <stream:stream
xmlns='jabber:client' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams' xmlns:stream='http://etherx.jabber.org/streams'
from='example.com' from='example.com'
id='c2s_234' id='c2s_234'
skipping to change at page 24, line 45 skipping to change at page 25, line 4
version='1.0'> version='1.0'>
Step 2: Server2 responds by sending a stream tag to Server1: Step 2: Server2 responds by sending a stream tag to Server1:
<stream:stream <stream:stream
xmlns='jabber:server' xmlns='jabber:server'
xmlns:stream='http://etherx.jabber.org/streams' xmlns:stream='http://etherx.jabber.org/streams'
from='example.com' from='example.com'
id='s2s_123' id='s2s_123'
version='1.0'> version='1.0'>
Step 3: Server2 sends the STARTTLS extension to Server1 along with Step 3: Server2 sends the STARTTLS extension to Server1 along with
authentication mechanisms and any other stream features: authentication mechanisms and any other stream features:
<stream:features> <stream:features>
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'>
<required/> <required/>
</starttls> </starttls>
<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
<mechanism>DIGEST-MD5</mechanism> <mechanism>DIGEST-MD5</mechanism>
<mechanism>KERBEROS_V4</mechanism> <mechanism>KERBEROS_V4</mechanism>
</mechanisms> </mechanisms>
</stream:features> </stream:features>
Step 4: Server1 sends the STARTTLS command to Server2: Step 4: Server1 sends the STARTTLS command to Server2:
skipping to change at page 25, line 36 skipping to change at page 25, line 43
Step 7: If TLS negotiation is successful, Server1 initiates a new Step 7: If TLS negotiation is successful, Server1 initiates a new
stream to Server2: stream to Server2:
<stream:stream <stream:stream
xmlns='jabber:server' xmlns='jabber:server'
xmlns:stream='http://etherx.jabber.org/streams' xmlns:stream='http://etherx.jabber.org/streams'
to='example.com' to='example.com'
version='1.0'> version='1.0'>
Step 7 (alt): If TLS negotiation is unsuccessful, server closes TCP Step 7 (alt): If TLS negotiation is unsuccessful, Server2 closes TCP
connection. connection.
Step 8: Server2 responds by sending a stream header to Server1 along Step 8: Server2 responds by sending a stream header to Server1 along
with any available stream features: with any available stream features:
<stream:stream <stream:stream
xmlns='jabber:server' xmlns='jabber:server'
xmlns:stream='http://etherx.jabber.org/streams' xmlns:stream='http://etherx.jabber.org/streams'
from='example.com' from='example.com'
id='s2s_234' id='s2s_234'
skipping to change at page 26, line 27 skipping to change at page 26, line 41
adding authentication support to connection-based protocols, and XMPP adding authentication support to connection-based protocols, and XMPP
uses a generic XML namespace profile for SASL that conforms to the uses a generic XML namespace profile for SASL that conforms to the
profiling requirements of [SASL]. profiling requirements of [SASL].
The following rules apply: The following rules apply:
1. If the SASL negotiation occurs between two servers, 1. If the SASL negotiation occurs between two servers,
communications MUST NOT proceed until the Domain Name System communications MUST NOT proceed until the Domain Name System
(DNS) hostnames asserted by the servers have been resolved (see (DNS) hostnames asserted by the servers have been resolved (see
Server-to-Server Communications (Section 14.4)). Server-to-Server Communications (Section 14.4)).
2. If the initiating entity is capable of SASL negotiation, it MUST 2. If the initiating entity is capable of SASL negotiation, it MUST
include the 'version' attribute set to a value of "1.0" in the include the 'version' attribute set to a value of at least "1.0"
initial stream header. in the initial stream header.
3. If the receiving entity is capable of SASL negotiation, it MUST 3. If the receiving entity is capable of SASL negotiation, it MUST
send one or more authentication mechanisms within a <mechanisms/ advertise one or more authentication mechanisms within a
> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' <mechanisms/> element qualified by the
namespace in reply to the opening stream tag received from the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace in reply to the
initiating entity (if the opening stream tag included the opening stream tag received from the initiating entity (if the
'version' attribute set to a value of "1.0"). opening stream tag included the 'version' attribute set to a
value of at least "1.0").
4. During SASL negotiation, an entity MUST NOT send any white space 4. During SASL negotiation, an entity MUST NOT send any white space
characters (matching production [3] content of [XML]) within the characters (matching production [3] content of [XML]) within the
root stream element as separators between elements (any white root stream element as separators between elements (any white
space characters shown in the SASL examples below are included space characters shown in the SASL examples below are included
for the sake of readability only); this prohibition helps to for the sake of readability only); this prohibition helps to
ensure proper security layer byte precision. ensure proper security layer byte precision.
5. Any XML character data contained within the XML elements used
5. Any character data contained within the XML elements used during during SASL negotiation MUST be encoded using base64, where the
SASL negotiation MUST be encoded using base64, where the
encoding adheres to the definition in Section 3 of RFC 3548 encoding adheres to the definition in Section 3 of RFC 3548
[BASE64]. [BASE64].
6. If provision of a "simple username" is supported by the selected 6. If provision of a "simple username" is supported by the selected
SASL mechanism (e.g., this is supported by the DIGEST-MD5 and SASL mechanism (e.g., this is supported by the DIGEST-MD5 and
CRAM-MD5 mechanisms but not by the EXTERNAL and GSSAPI CRAM-MD5 mechanisms but not by the EXTERNAL and GSSAPI
mechanisms), during authentication the initiating entity SHOULD mechanisms), during authentication the initiating entity SHOULD
provide as the simple username its sending domain (IP address or provide as the simple username its sending domain (IP address or
fully qualified domain name as contained in a domain identifier) fully qualified domain name as contained in a domain identifier)
in the case of server-to-server communications or its registered in the case of server-to-server communications or its registered
account name (user or node name as contained in an XMPP node account name (user or node name as contained in an XMPP node
identifer) in the case of client-to-server communications. identifer) in the case of client-to-server communications.
7. If the initiating entity wishes to act on behalf of another 7. If the initiating entity wishes to act on behalf of another
entity and the selected SASL mechanism supports transmission of entity and the selected SASL mechanism supports transmission of
an authorization identity, the initiating entity MUST provide an an authorization identity, the initiating entity MUST provide an
authorization identity during SASL negotiation. If the authorization identity during SASL negotiation. If the
initiating entity does not wish to act on behalf of another initiating entity does not wish to act on behalf of another
entity, it MUST NOT provide an authorization identity. As entity, it MUST NOT provide an authorization identity. As
specified in [SASL], the initiating entity MUST NOT provide an specified in [SASL], the initiating entity MUST NOT provide an
authorization identity unless the authorization identity is authorization identity unless the authorization identity is
different from the default authorization identity derived from different from the default authorization identity derived from
the authentication identity as described in [SASL]. If the authentication identity as described in [SASL]. If
skipping to change at page 27, line 27 skipping to change at page 27, line 35
initiating entity does not wish to act on behalf of another initiating entity does not wish to act on behalf of another
entity, it MUST NOT provide an authorization identity. As entity, it MUST NOT provide an authorization identity. As
specified in [SASL], the initiating entity MUST NOT provide an specified in [SASL], the initiating entity MUST NOT provide an
authorization identity unless the authorization identity is authorization identity unless the authorization identity is
different from the default authorization identity derived from different from the default authorization identity derived from
the authentication identity as described in [SASL]. If the authentication identity as described in [SASL]. If
provided, the value of the authorization identity MUST be of the provided, the value of the authorization identity MUST be of the
form <domain> (i.e., a domain identifier only) for servers and form <domain> (i.e., a domain identifier only) for servers and
of the form <node@domain> (i.e., node identifier and domain of the form <node@domain> (i.e., node identifier and domain
identifier) for clients. identifier) for clients.
8. Upon successful SASL negotiation that involves negotiation of a 8. Upon successful SASL negotiation that involves negotiation of a
security layer, the receiving entity MUST discard any knowledge security layer, the receiving entity MUST discard any knowledge
obtained from the initiating entity which was not obtained from obtained from the initiating entity which was not obtained from
the SASL negotiation itself. the SASL negotiation itself.
9. Upon successful SASL negotiation that involves negotiation of a 9. Upon successful SASL negotiation that involves negotiation of a
security layer, the initiating entity MUST discard any knowledge security layer, the initiating entity MUST discard any knowledge
obtained from the receiving entity which was not obtained from obtained from the receiving entity which was not obtained from
the SASL negotiation itself. the SASL negotiation itself.
10. See Mandatory-to-Implement Technologies (Section 14.7) regarding 10. See Mandatory-to-Implement Technologies (Section 14.7) regarding
mechanisms that MUST be supported. mechanisms that MUST be supported.
6.2 Narrative 6.2 Narrative
When an initiating entity authenticates with a receiving entity, the When an initiating entity authenticates with a receiving entity using
steps involved are as follows: SASL, the steps involved are as follows:
1. The initiating entity requests SASL authentication by including 1. The initiating entity requests SASL authentication by including
the 'version' attribute in the opening XML stream header sent to the 'version' attribute in the opening XML stream header sent to
the receiving entity, with the value set to "1.0". the receiving entity, with the value set to "1.0".
2. After sending an XML stream header in reply, the receiving entity 2. After sending an XML stream header in reply, the receiving entity
sends a list of available SASL authentication mechanisms; each of advertises a list of available SASL authentication mechanisms;
these is a <mechanism/> element included as a child within a each of these is a <mechanism/> element included as a child
<mechanisms/> container element qualified by the within a <mechanisms/> container element qualified by the
'urn:ietf:params:xml:ns:xmpp-sasl' namespace, which in turn is a 'urn:ietf:params:xml:ns:xmpp-sasl' namespace, which in turn is a
child of a <features/> element in the streams namespace. If Use child of a <features/> element in the streams namespace. If Use
of TLS (Section 5) needs to be established before a particular of TLS (Section 5) needs to be established before a particular
authentication mechanism may be used, the receiving entity MUST authentication mechanism may be used, the receiving entity MUST
NOT provide that mechanism in the list of available SASL NOT provide that mechanism in the list of available SASL
authentication mechanisms prior to TLS negotiation. If the authentication mechanisms prior to TLS negotiation. If the
initiating entity presents a valid certificate during prior TLS initiating entity presents a valid certificate during prior TLS
negotiation, the receiving entity SHOULD offer the SASL EXTERNAL negotiation, the receiving entity SHOULD offer the SASL EXTERNAL
mechanism to the initiating entity during SASL negotiation (refer mechanism to the initiating entity during SASL negotiation (refer
to [SASL]), although the EXTERNAL mechanism MAY be offered under to [SASL]), although the EXTERNAL mechanism MAY be offered under
skipping to change at page 28, line 18 skipping to change at page 28, line 23
child of a <features/> element in the streams namespace. If Use child of a <features/> element in the streams namespace. If Use
of TLS (Section 5) needs to be established before a particular of TLS (Section 5) needs to be established before a particular
authentication mechanism may be used, the receiving entity MUST authentication mechanism may be used, the receiving entity MUST
NOT provide that mechanism in the list of available SASL NOT provide that mechanism in the list of available SASL
authentication mechanisms prior to TLS negotiation. If the authentication mechanisms prior to TLS negotiation. If the
initiating entity presents a valid certificate during prior TLS initiating entity presents a valid certificate during prior TLS
negotiation, the receiving entity SHOULD offer the SASL EXTERNAL negotiation, the receiving entity SHOULD offer the SASL EXTERNAL
mechanism to the initiating entity during SASL negotiation (refer mechanism to the initiating entity during SASL negotiation (refer
to [SASL]), although the EXTERNAL mechanism MAY be offered under to [SASL]), although the EXTERNAL mechanism MAY be offered under
other circumstances as well. other circumstances as well.
3. The initiating entity selects a mechanism by sending an <auth/> 3. The initiating entity selects a mechanism by sending an <auth/>
element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl'
namespace to the receiving entity and including an appropriate namespace to the receiving entity and including an appropriate
value for the 'mechanism' attribute; this element MAY contain value for the 'mechanism' attribute. This element MAY contain
character data (in SASL terminology, the "initial response") if XML character data (in SASL terminology, the "initial response")
the mechanism supports or requires it. If the initiating entity if the mechanism supports or requires it; if the initiating
selects the EXTERNAL mechanism for authentication and presented a entity needs to send a zero-length initial response, it MUST
certificate during prior TLS negotiation, the authentication transmit the response as a single equals sign ("="), which
credentials SHOULD be taken from that certificate. indicates that the response is present but contains no data.
4. If necessary, the receiving entity challenges the initiating 4. If necessary, the receiving entity challenges the initiating
entity by sending a <challenge/> element qualified by the entity by sending a <challenge/> element qualified by the
'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the initiating 'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the initiating
entity; this element MAY contain character data (which MUST be entity; this element MAY contain XML character data (which MUST
computed in accordance with the definition of the SASL mechanism be computed in accordance with the definition of the SASL
chosen by the initiating entity). mechanism chosen by the initiating entity).
5. The initiating entity responds to the challenge by sending a 5. The initiating entity responds to the challenge by sending a
<response/> element qualified by the <response/> element qualified by the
'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the receiving 'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the receiving
entity; this element MAY contain character data (which MUST be entity; this element MAY contain XML character data (which MUST
computed in accordance with the definition of the SASL mechanism be computed in accordance with the definition of the SASL
chosen by the initiating entity). mechanism chosen by the initiating entity).
6. If necessary, the receiving entity sends more challenges and the 6. If necessary, the receiving entity sends more challenges and the
initiating entity sends more responses. initiating entity sends more responses.
This series of challenge/response pairs continues until one of three This series of challenge/response pairs continues until one of three
things happens: things happens:
1. The initiating entity aborts the handshake by sending an <abort/> 1. The initiating entity aborts the handshake by sending an <abort/>
element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl'
namespace to the receiving entity. Upon receiving an <abort/> namespace to the receiving entity. Upon receiving an <abort/>
element, the receiving entity SHOULD allow a configurable but element, the receiving entity SHOULD allow a configurable but
reasonable number of retries (at least 2), after which it MUST reasonable number of retries (at least 2), after which it MUST
terminate the TCP connection; this allows the initiating entity terminate the TCP connection; this enables the initiating entity
(e.g., an end-user client) to tolerate incorrectly-provided (e.g., an end-user client) to tolerate incorrectly-provided
credentials (e.g., a mistyped password) without being forced to credentials (e.g., a mistyped password) without being forced to
reconnect. reconnect.
2. The receiving entity reports failure of the handshake by sending 2. The receiving entity reports failure of the handshake by sending
a <failure/> element qualified by the a <failure/> element qualified by the
'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the initiating 'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the initiating
entity (the particular cause of failure SHOULD be communicated in entity (the particular cause of failure SHOULD be communicated in
an appropriate child element of the <failure/> element as defined an appropriate child element of the <failure/> element as defined
under SASL Errors (Section 6.4)). If the failure case occurs, under SASL Errors (Section 6.4)). If the failure case occurs,
the receiving entity SHOULD allow a configurable but reasonable the receiving entity SHOULD allow a configurable but reasonable
number of retries (at least 2), after which it MUST terminate the number of retries (at least 2), after which it MUST terminate the
TCP connection; this allows the initiating entity (e.g., an TCP connection; this enables the initiating entity (e.g., an
end-user client) to tolerate incorrectly-provided credentials end-user client) to tolerate incorrectly-provided credentials
(e.g., a mistyped password) without being forced to reconnect. (e.g., a mistyped password) without being forced to reconnect.
3. The receiving entity reports success of the handshake by sending 3. The receiving entity reports success of the handshake by sending
a <success/> element qualified by the a <success/> element qualified by the
'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the initiating 'urn:ietf:params:xml:ns:xmpp-sasl' namespace to the initiating
entity; this element MAY contain character data (in SASL entity; this element MAY contain XML character data (in SASL
terminology, "additional data with success") if required by the terminology, "additional data with success") if required by the
chosen SASL mechanism. Upon receiving the <success/> element, chosen SASL mechanism. Upon receiving the <success/> element,
the initiating entity MUST initiate a new stream by sending an the initiating entity MUST initiate a new stream by sending an
opening XML stream header to the receiving entity (it is not opening XML stream header to the receiving entity (it is not
necessary to send a closing </stream> tag first, since the necessary to send a closing </stream> tag first, since the
receiving entity and initiating entity MUST consider the original receiving entity and initiating entity MUST consider the original
stream to be closed upon sending or receiving the <success/> stream to be closed upon sending or receiving the <success/>
element). Upon receiving the new stream header from the element). Upon receiving the new stream header from the
initiating entity, the receiving entity MUST respond by sending a initiating entity, the receiving entity MUST respond by sending a
new XML stream header to the initiating entity, along with any new XML stream header to the initiating entity, along with any
skipping to change at page 30, line 11 skipping to change at page 30, line 5
information be supplied by a protocol definition: information be supplied by a protocol definition:
service name: "xmpp" service name: "xmpp"
initiation sequence: After the initiating entity provides an opening initiation sequence: After the initiating entity provides an opening
XML stream header and the receiving entity replies in kind, the XML stream header and the receiving entity replies in kind, the
receiving entity provides a list of acceptable authentication receiving entity provides a list of acceptable authentication
methods. The initiating entity chooses one method from the list methods. The initiating entity chooses one method from the list
and sends it to the receiving entity as the value of the and sends it to the receiving entity as the value of the
'mechanism' attribute possessed by an <auth/> element, optionally 'mechanism' attribute possessed by an <auth/> element, optionally
including an initial response to avoid a round trip. including an initial response to avoid a round trip.
exchange sequence: Challenges and responses are carried through the exchange sequence: Challenges and responses are carried through the
exchange of <challenge/> elements from receiving entity to exchange of <challenge/> elements from receiving entity to
initiating entity and <response/> elements from initiating entity initiating entity and <response/> elements from initiating entity
to receiving entity. The receiving entity reports failure by to receiving entity. The receiving entity reports failure by
sending a <failure/> element and success by sending a <success/> sending a <failure/> element and success by sending a <success/>
element; the initiating entity aborts the exchange by sending an element; the initiating entity aborts the exchange by sending an
<abort/> element. Upon successful negotiation, both sides <abort/> element. Upon successful negotiation, both sides
consider the original XML stream to be closed and new stream consider the original XML stream to be closed and new stream
headers are sent by both entities. headers are sent by both entities.
security layer negotiation: The security layer takes effect security layer negotiation: The security layer takes effect
immediately after sending the closing ">" character of the immediately after sending the closing ">" character of the
<success/> element for the receiving entity, and immediately after <success/> element for the receiving entity, and immediately after
receiving the closing ">" character of the <success/> element for receiving the closing ">" character of the <success/> element for
the initiating entity. The order of layers is first [TCP], then the initiating entity. The order of layers is first [TCP], then
[TLS], then [SASL], then XMPP. [TLS], then [SASL], then XMPP.
use of the authorization identity: The authorization identity may be use of the authorization identity: The authorization identity may be
used by xmpp to denote the <node@domain> of a client or the used by xmpp to denote the non-default <node@domain> of a client
sending <domain> of a server. or the sending <domain> of a server.
6.4 SASL Errors 6.4 SASL Errors
The following SASL-related error conditions are defined: The following SASL-related error conditions are defined:
o <aborted/> -- The receiving entity acknowledges an <abort/> o <aborted/> -- The receiving entity acknowledges an <abort/>
element sent by the initiating entity; sent in reply to the element sent by the initiating entity; sent in reply to the
<abort/> element. <abort/> element.
o <incorrect-encoding/> -- The data provided by the initiating o <incorrect-encoding/> -- The data provided by the initiating
entity could not be processed because the [BASE64] encoding is entity could not be processed because the [BASE64] encoding is
incorrect (e.g., because the encoding does not adhere to the the incorrect (e.g., because the encoding does not adhere to the
definition in Section 3 of [BASE64]); sent in reply to a definition in Section 3 of [BASE64]); sent in reply to a
<response/> element or an <auth/> element with initial challenge <response/> element or an <auth/> element with initial response
data. data.
o <invalid-authzid/> -- The authzid provided by the initiating o <invalid-authzid/> -- The authzid provided by the initiating
entity is invalid, either because it is incorrectly formatted or entity is invalid, either because it is incorrectly formatted or
because the initiating entity does not have permissions to because the initiating entity does not have permissions to
authorize that ID; sent in reply to a <response/> element or an authorize that ID; sent in reply to a <response/> element or an
<auth/> element with initial challenge data. <auth/> element with initial response data.
o <invalid-mechanism/> -- The initiating entity did not provide a o <invalid-mechanism/> -- The initiating entity did not provide a
mechanism or requested a mechanism that is not supported by the mechanism or requested a mechanism that is not supported by the
receiving entity; sent in reply to an <auth/> element. receiving entity; sent in reply to an <auth/> element.
o <mechanism-too-weak/> -- The mechanism requested by the initiating o <mechanism-too-weak/> -- The mechanism requested by the initiating
entity is weaker than server policy permits for that initiating entity is weaker than server policy permits for that initiating
entity; sent in reply to a <response/> element or an <auth/> entity; sent in reply to a <response/> element or an <auth/>
element with initial challenge data. element with initial response data.
o <not-authorized/> -- The authentication failed because the o <not-authorized/> -- The authentication failed because the
initiating entity did not provide valid credentials (this includes initiating entity did not provide valid credentials (this includes
but is not limited to the case of an unknown username); sent in but is not limited to the case of an unknown username); sent in
reply to a <response/> element or an <auth/> element with initial reply to a <response/> element or an <auth/> element with initial
challenge data. response data.
o <temporary-auth-failure/> -- The authentication failed because of o <temporary-auth-failure/> -- The authentication failed because of
a temporary error condition within the receiving entity; sent in a temporary error condition within the receiving entity; sent in
reply to an <auth/> element or <response/> element. reply to an <auth/> element or <response/> element.
6.5 Client-to-Server Example 6.5 Client-to-Server Example
The following example shows the data flow for a client authenticating The following example shows the data flow for a client authenticating
with a server using SASL, normally after successful TLS negotiation with a server using SASL, normally after successful TLS negotiation
(note: the alternate steps shown below are provided to illustrate the (note: the alternate steps shown below are provided to illustrate the
protocol for failure cases; they are not exhaustive and would not protocol for failure cases; they are not exhaustive and would not
skipping to change at page 35, line 9 skipping to change at page 34, line 45
</stream:features> </stream:features>
Step 4: Server1 selects an authentication mechanism: Step 4: Server1 selects an authentication mechanism:
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl'
mechanism='DIGEST-MD5'/> mechanism='DIGEST-MD5'/>
Step 5: Server2 sends a [BASE64] encoded challenge to Server1: Step 5: Server2 sends a [BASE64] encoded challenge to Server1:
<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
dXNlcm5hbWU9ImV4YW1wbGUuY29tIixyZWFsbT0ic29tZXJlYWxtIixub25j cmVhbG09InNvbWVyZWFsbSIsbm9uY2U9Ik9BNk1HOXRFUUdtMmhoIixxb3A9
ZT0iT0E2TUc5dEVRR20yaGgiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxh ImF1dGgiLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz
bGdvcml0aG09bWQ1LXNlc3MK
</challenge> </challenge>
The decoded challenge is: The decoded challenge is:
username="example.com",realm="somerealm",\ realm="somerealm",nonce="OA6MG9tEQGm2hh",\
nonce="OA6MG9tEQGm2hh",qop="auth",\ qop="auth",charset=utf-8,algorithm=md5-sess
charset=utf-8,algorithm=md5-sess
Step 5 (alt): Server2 returns error to Server1: Step 5 (alt): Server2 returns error to Server1:
<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
<incorrect-encoding/> <incorrect-encoding/>
</failure> </failure>
</stream:stream> </stream:stream>
Step 6: Server1 sends a [BASE64] encoded response to the challenge: Step 6: Server1 sends a [BASE64] encoded response to the challenge:
<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
dXNlcm5hbWU9ImV4YW1wbGUuY29tIixyZWFsbT0ic29tZXJlYWxtIixub25j dXNlcm5hbWU9ImV4YW1wbGUub3JnIixyZWFsbT0ic29tZXJlYWxtIixub25j
ZT0iT0E2TUc5dEVRR20yaGgiLGNub25jZT0iT0E2TUhYaDZWcVRyUmsiLG5j ZT0iT0E2TUc5dEVRR20yaGgiLGNub25jZT0iT0E2TUhYaDZWcVRyUmsiLG5j
PTAwMDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvZXhhbXBsZS5j PTAwMDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvZXhhbXBsZS5v
b20iLHJlc3BvbnNlPWQzODhkYWQ5MGQ0YmJkNzYwYTE1MjMyMWYyMTQzYWY3 cmciLHJlc3BvbnNlPWQzODhkYWQ5MGQ0YmJkNzYwYTE1MjMyMWYyMTQzYWY3
LGNoYXJzZXQ9dXRmLTgK LGNoYXJzZXQ9dXRmLTgK
</response> </response>
The decoded response is: The decoded response is:
username="example.com",realm="somerealm",\ username="example.org",realm="somerealm",\
nonce="OA6MG9tEQGm2hh",cnonce="OA6MHXh6VqTrRk",\ nonce="OA6MG9tEQGm2hh",cnonce="OA6MHXh6VqTrRk",\
nc=00000001,qop=auth,digest-uri="xmpp/example.com",\ nc=00000001,qop=auth,digest-uri="xmpp/example.org",\
response=d388dad90d4bbd760a152321f2143af7,charset=utf-8 response=d388dad90d4bbd760a152321f2143af7,charset=utf-8
Step 7: Server2 sends another [BASE64] encoded challenge to Server1: Step 7: Server2 sends another [BASE64] encoded challenge to Server1:
<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
cnNwYXV0aD1lYTQwZjYwMzM1YzQyN2I1NTI3Yjg0ZGJhYmNkZmZmZAo= cnNwYXV0aD1lYTQwZjYwMzM1YzQyN2I1NTI3Yjg0ZGJhYmNkZmZmZAo=
</challenge> </challenge>
The decoded challenge is: The decoded challenge is:
skipping to change at page 38, line 12 skipping to change at page 37, line 47
<iq type='set' id='bind_1'> <iq type='set' id='bind_1'>
<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/> <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
</iq> </iq>
A server that supports resource binding MUST be able to generate a A server that supports resource binding MUST be able to generate a
resource identifier on behalf of a client. A resource identifier resource identifier on behalf of a client. A resource identifier
generated by the server MUST be unique for that <node@domain>. generated by the server MUST be unique for that <node@domain>.
If the client wishes to specify the resource identifier, it sends an If the client wishes to specify the resource identifier, it sends an
IQ stanza of type "set" that contains the desired resource identifier IQ stanza of type "set" that contains the desired resource identifier
as the CDATA of a <resource/> element that is a child of the <bind/> as the XML character data of a <resource/> element that is a child of
element: the <bind/> element:
Client binds a resource: Client binds a resource:
<iq type='set' id='bind_2'> <iq type='set' id='bind_2'>
<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
<resource>someresource</resource> <resource>someresource</resource>
</bind> </bind>
</iq> </iq>
Once the server has generated a resource identifier for the client or Once the server has generated a resource identifier for the client or
skipping to change at page 38, line 49 skipping to change at page 38, line 39
server generates; in this case, the server SHOULD NOT return a stanza server generates; in this case, the server SHOULD NOT return a stanza
error (e.g., <forbidden/>) to the client but instead SHOULD error (e.g., <forbidden/>) to the client but instead SHOULD
communicate the generated resource identifier to the client in the IQ communicate the generated resource identifier to the client in the IQ
result as shown above. result as shown above.
When a client supplies a resource identifier, the following stanza When a client supplies a resource identifier, the following stanza
error conditions are possible (see Stanza Errors (Section 9.3)): error conditions are possible (see Stanza Errors (Section 9.3)):
o The provided resource identifier cannot be processed by the server o The provided resource identifier cannot be processed by the server
in accordance with Resourceprep (Appendix B). in accordance with Resourceprep (Appendix B).
o The client is not allowed to bind a resource to the stream (e.g., o The client is not allowed to bind a resource to the stream (e.g.,
because the client has reached a limit on the number of connected because the node or user has reached a limit on the number of
resources allowed). connected resources allowed).
o The provided resource identifier is already in use but the server o The provided resource identifier is already in use but the server
does not allow binding of multiple connected resources with the does not allow binding of multiple connected resources with the
same identifier. same identifier.
The protocol for these error conditions is shown below. The protocol for these error conditions is shown below.
Resource identifier cannot be processed: Resource identifier cannot be processed:
<iq type='error' id='bind_2'> <iq type='error' id='bind_2'>
<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
skipping to change at page 39, line 45 skipping to change at page 39, line 38
<iq type='error' id='bind_2'> <iq type='error' id='bind_2'>
<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
<resource>someresource</resource> <resource>someresource</resource>
</bind> </bind>
<error type='cancel'> <error type='cancel'>
<conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error> </error>
</iq> </iq>
If, before completing the resource binding step, the client attempts
to send an XML stanza other than an IQ stanza with a <bind/> child
qualified by the 'urn:ietf:params:xml:ns:xmpp-bind' namespace, the
server MUST NOT process the stanza and SHOULD return a
<not-authorized/> stanza error to the client.
8. Server Dialback 8. Server Dialback
8.1 Overview 8.1 Overview
The Jabber protocols from which XMPP was adapted include a "server The Jabber protocols from which XMPP was adapted include a "server
dialback" method for protecting against domain spoofing, thus making dialback" method for protecting against domain spoofing, thus making
it more difficult to spoof XML stanzas (see Server-to-Server it more difficult to spoof XML stanzas. Server dialback is not a
Communications (Section 14.4) regarding this method's security security mechanism, and results in weak verification of server
characteristics). Server dialback also makes it easier to deploy identities only (see Server-to-Server Communications (Section 14.4)
systems in which outbound messages and inbound messages are handled regarding this method's security characteristics). Domains requiring
by different machines for the same domain. Server dialback is not a robust security SHOULD use TLS and SASL; see Server-to-Server
security mechanism, and domains requiring robust security SHOULD use Communications (Section 14.4) for details. If SASL is used for
TLS and SASL; see Server-to-Server Communications (Section 14.4) for server-to-server authentication, dialback SHOULD NOT be used since it
details. is unnecessary. Documentation of dialback is included mainly for the
sake of backward-compatibility with existing implementations and
deployments.
The server dialback method is made possible by the existence of the The server dialback method is made possible by the existence of the
Domain Name System (DNS), since one server can (normally) discover Domain Name System (DNS), since one server can (normally) discover
the authoritative server for a given domain. Because dialback depends the authoritative server for a given domain. Because dialback
on DNS, inter-domain communications MUST NOT proceed until the Domain depends on DNS, inter-domain communications MUST NOT proceed until
Name System (DNS) hostnames asserted by the servers have been the Domain Name System (DNS) hostnames asserted by the servers have
resolved (see Server-to-Server Communications (Section 14.4)). been resolved (see Server-to-Server Communications (Section 14.4)).
Server dialback is uni-directional, and results in (weak)
verification of identities for one stream in one direction. Because
server dialback is not an authentication mechanism, mutual
authentication is not possible via dialback. Therefore server
dialback MUST be completed in each direction in order to enable
bi-directional communications between two domains.
The method for generating and verifying the keys used in server The method for generating and verifying the keys used in server
dialback MUST take into account the hostnames being used, the stream dialback MUST take into account the hostnames being used, the stream
ID generated by the receiving server, and a secret known by the ID generated by the receiving server, and a secret known by the
authoritative server's network. The stream ID is security-critical in authoritative server's network. The stream ID is security-critical
server dialback and therefore MUST be both unpredictable and in server dialback and therefore MUST be both unpredictable and
non-repeating (see [RANDOM] for recommendations regarding randomness non-repeating (see [RANDOM] for recommendations regarding randomness
for security purposes). for security purposes).
Any error that occurs during dialback negotiation MUST be considered Any error that occurs during dialback negotiation MUST be considered
a stream error, resulting in termination of the stream and of the a stream error, resulting in termination of the stream and of the
underlying TCP connection. The possible error conditions are underlying TCP connection. The possible error conditions are
specified in the protocol description below. specified in the protocol description below.
The following terminology applies: The following terminology applies:
skipping to change at page 43, line 29 skipping to change at page 44, line 12
<host-unknown/> stream error condition and terminate both the <host-unknown/> stream error condition and terminate both the
XML stream and the underlying TCP connection. If the value of XML stream and the underlying TCP connection. If the value of
the 'from' address matches a domain with which Receiving Server the 'from' address matches a domain with which Receiving Server
already has an established connection, then Receiving Server already has an established connection, then Receiving Server
MUST maintain the existing connection until it validates whether MUST maintain the existing connection until it validates whether
the new connection is legitimate; additionally, Receiving Server the new connection is legitimate; additionally, Receiving Server
MAY choose to generate a <not-authorized/> stream error MAY choose to generate a <not-authorized/> stream error
condition for the new connection and then terminate both the XML condition for the new connection and then terminate both the XML
stream and the underlying TCP connection related to the new stream and the underlying TCP connection related to the new
request. request.
5. Receiving Server establishes a TCP connection back to the domain 5. Receiving Server establishes a TCP connection back to the domain
name asserted by Originating Server, as a result of which it name asserted by Originating Server, as a result of which it
connects to Authoritative Server. (Note: As an optimization, an connects to Authoritative Server. (Note: As an optimization, an
implementation MAY reuse an existing trusted connection here implementation MAY reuse an existing connection here.)
rather than opening a new TCP connection.)
6. Receiving Server sends Authoritative Server a stream header: 6. Receiving Server sends Authoritative Server a stream header:
<stream:stream <stream:stream
xmlns:stream='http://etherx.jabber.org/streams' xmlns:stream='http://etherx.jabber.org/streams'
xmlns='jabber:server' xmlns='jabber:server'
xmlns:db='jabber:server:dialback'> xmlns:db='jabber:server:dialback'>
Note: The 'to' and 'from' attributes are OPTIONAL on the root Note: The 'to' and 'from' attributes are OPTIONAL on the root
stream element. If the namespace name is incorrect, then stream element. If the namespace name is incorrect, then
Authoritative Server MUST generate an <invalid-namespace/> Authoritative Server MUST generate an <invalid-namespace/>
skipping to change at page 44, line 16 skipping to change at page 44, line 44
id='1251A342B...'> id='1251A342B...'>
Note: If the namespace name is incorrect, then Receiving Server Note: If the namespace name is incorrect, then Receiving Server
MUST generate an <invalid-namespace/> stream error condition and MUST generate an <invalid-namespace/> stream error condition and
terminate both the XML stream and the underlying TCP connection terminate both the XML stream and the underlying TCP connection
between it and Authoritative Server. If a stream error occurs between it and Authoritative Server. If a stream error occurs
between Receiving Server and Authoritative Server, then between Receiving Server and Authoritative Server, then
Receiving Server MUST generate a <remote-connection-failed/> Receiving Server MUST generate a <remote-connection-failed/>
stream error condition and terminate both the XML stream and the stream error condition and terminate both the XML stream and the
underlying TCP connection between it and Originating Server. underlying TCP connection between it and Originating Server.
8. Receiving Server sends Authoritative Server a request for
8. Receiving Server sends Authoritative Server a stanza requesting verification of a key:
that Authoritative Server verify a key:
<db:verify <db:verify
from='Receiving Server' from='Receiving Server'
to='Originating Server' to='Originating Server'
id='457F9224A0...'> id='457F9224A0...'>
98AF014EDC0... 98AF014EDC0...
</db:verify> </db:verify>
Note: Passed here are the hostnames, the original identifier Note: Passed here are the hostnames, the original identifier
from Receiving Server's stream header to Originating Server in from Receiving Server's stream header to Originating Server in
Step 3, and the key that Originating Server sent to Receiving Step 3, and the key that Originating Server sent to Receiving
Server in Step 4. Based on this information as well as shared Server in Step 4. Based on this information as well as shared
secret information within the Authoritative Server's network, secret information within the Authoritative Server's network,
the key is verified. Any verifiable method MAY be used to the key is verified. Any verifiable method MAY be used to
generate the key. If the value of the 'to' address does not generate the key. If the value of the 'to' address does not
match a hostname recognized by Authoritative Server, then match a hostname recognized by Authoritative Server, then
Authoritative Server MUST generate a <host-unknown/> stream Authoritative Server MUST generate a <host-unknown/> stream
error condition and terminate both the XML stream and the error condition and terminate both the XML stream and the
underlying TCP connection. If the value of the 'from' address underlying TCP connection. If the value of the 'from' address
does not match the hostname represented by Receiving Server when does not match the hostname represented by Receiving Server when
opening the TCP connection (or any validated domain), then opening the TCP connection (or any validated domain thereof,
such as a validated subdomain of Receiving Server's hostname or
another validated domain hosted by Receiving Server), then
Authoritative Server MUST generate an <invalid-from/> stream Authoritative Server MUST generate an <invalid-from/> stream
error condition and terminate both the XML stream and the error condition and terminate both the XML stream and the
underlying TCP connection. underlying TCP connection.
9. Authoritative Server verifies whether the key was valid or
9. Authoritative Server sends a stanza back to Receiving Server invalid:
verifying whether the key was valid or invalid:
<db:verify <db:verify
from='Originating Server' from='Originating Server'
to='Receiving Server' to='Receiving Server'
type='valid' type='valid'
id='457F9224A0...'/> id='457F9224A0...'/>
or or
<db:verify <db:verify
from='Originating Server' from='Originating Server'
to='Receiving Server' to='Receiving Server'
type='invalid' type='invalid'
id='457F9224A0...'/> id='457F9224A0...'/>
Note: If the ID does not match that provided by Receiving Server Note: If the ID does not match that provided by Receiving Server
in Step 3, then Receiving Server MUST generate an <invalid-id/> in Step 3, then Receiving Server MUST generate an <invalid-id/>
skipping to change at page 45, line 21 skipping to change at page 46, line 7
Note: If the ID does not match that provided by Receiving Server Note: If the ID does not match that provided by Receiving Server
in Step 3, then Receiving Server MUST generate an <invalid-id/> in Step 3, then Receiving Server MUST generate an <invalid-id/>
stream error condition and terminate both the XML stream and the stream error condition and terminate both the XML stream and the
underlying TCP connection. If the value of the 'to' address underlying TCP connection. If the value of the 'to' address
does not match a hostname recognized by Receiving Server, then does not match a hostname recognized by Receiving Server, then
Receiving Server MUST generate a <host-unknown/> stream error Receiving Server MUST generate a <host-unknown/> stream error
condition and terminate both the XML stream and the underlying condition and terminate both the XML stream and the underlying
TCP connection. If the value of the 'from' address does not TCP connection. If the value of the 'from' address does not
match the hostname represented by Originating Server when match the hostname represented by Originating Server when
opening the TCP connection (or any validated domain), then opening the TCP connection (or any validated domain thereof,
such as a validated subdomain of Originating Server's hostname
or another validated domain hosted by Originating Server), then
Receiving Server MUST generate an <invalid-from/> stream error Receiving Server MUST generate an <invalid-from/> stream error
condition and terminate both the XML stream and the underlying condition and terminate both the XML stream and the underlying
TCP connection. After returning the verification to Receiving TCP connection. After returning the verification to Receiving
Server, Authoritative Server SHOULD terminate the stream between Server, Authoritative Server SHOULD terminate the stream between
them. them.
10. Receiving Server informs Originating Server of the result: 10. Receiving Server informs Originating Server of the result:
<db:result <db:result
from='Receiving Server' from='Receiving Server'
to='Originating Server' to='Originating Server'
type='valid'/> type='valid'/>
Note: At this point the connection has either been validated via Note: At this point the connection has either been validated via
a type='valid', or reported as invalid. If the connection is a type='valid', or reported as invalid. If the connection is
invalid, then Receiving Server MUST terminate both the XML invalid, then Receiving Server MUST terminate both the XML
skipping to change at page 45, line 40 skipping to change at page 46, line 27
<db:result <db:result
from='Receiving Server' from='Receiving Server'
to='Originating Server' to='Originating Server'
type='valid'/> type='valid'/>
Note: At this point the connection has either been validated via Note: At this point the connection has either been validated via
a type='valid', or reported as invalid. If the connection is a type='valid', or reported as invalid. If the connection is
invalid, then Receiving Server MUST terminate both the XML invalid, then Receiving Server MUST terminate both the XML
stream and the underlying TCP connection. If the connection is stream and the underlying TCP connection. If the connection is
validated, data can be sent by Originating Server and read by validated, data can be sent by Originating Server and read by
Receiving Server; before that, all data stanzas sent to Receiving Server; before that, all XML stanzas sent to Receiving
Receiving Server SHOULD be silently dropped. Server SHOULD be silently dropped.
The result of the foregoing is that Receiving Server has verified the
identity of Originating Server, so that Originating Server can send,
and Receiving Server can accept, XML stanzas over the "initial
stream" (i.e., the stream from Originating Server to Receiving
Server). In order to verify the identities of the entities using the
"response stream" (i.e., the stream from Receiving Server to
Originating Server), dialback MUST be completed in the opposite
direction as well.
After successful dialback negotiation, Receiving Server SHOULD accept
subsequent <db:result/> packets (e.g., validation requests sent to a
subdomain or other hostname serviced by Receiving Server) from the
Originating Server over the existing validated connection; this
enables "piggybacking" of the original validated connection in one
direction.
Even if dialback negotiation is successful, a server MUST verify that Even if dialback negotiation is successful, a server MUST verify that
all XML stanzas received from the other server include a 'from' all XML stanzas received from the other server include a 'from'
attribute and a 'to' attribute; if a stanza does not meet this attribute and a 'to' attribute; if a stanza does not meet this
restriction, the server that receives the stanza MUST generate an restriction, the server that receives the stanza MUST generate an
<improper-addressing/> stream error condition and terminate both the <improper-addressing/> stream error condition and terminate both the
XML stream and the underlying TCP connection. Furthermore, a server XML stream and the underlying TCP connection. Furthermore, a server
MUST verify that the 'from' attribute of stanzas received from the MUST verify that the 'from' attribute of stanzas received from the
other server includes a validated domain for the stream; if a stanza other server includes a validated domain for the stream; if a stanza
does not meet this restriction, the server that receives the stanza does not meet this restriction, the server that receives the stanza
skipping to change at page 47, line 8 skipping to change at page 48, line 12
'from' attribute of the error stanza to the value provided in the 'from' attribute of the error stanza to the value provided in the
'to' attribute of the offending stanza. 'to' attribute of the offending stanza.
9.1.2 from 9.1.2 from
The 'from' attribute specifies the JID of the sender. The 'from' attribute specifies the JID of the sender.
When a server receives an XML stanza within the context of an When a server receives an XML stanza within the context of an
authenticated stream qualified by the 'jabber:client' namespace, it authenticated stream qualified by the 'jabber:client' namespace, it
MUST do one of the following: MUST do one of the following:
1. validate that the value of the 'from' attribute provided by the 1. validate that the value of the 'from' attribute provided by the
client is that of a connected resource for the associated entity client is that of a connected resource for the associated entity
2. add a 'from' address to the stanza whose value is the bare JID
2. add a 'from' address to the stanza whose value is the full JID (<node@domain>) or the full JID (<node@domain/resource>)
(<node@domain/resource>) determined by the server for the determined by the server for the connected resource that
connected resource that generated the stanza (see Determination generated the stanza (see Determination of Addresses (Section
of Addresses (Section 3.5)) 3.5))
If a client attempts to send an XML stanza for which the value of the If a client attempts to send an XML stanza for which the value of the
'from' attribute does not match one of the connected resources for 'from' attribute does not match one of the connected resources for
that entity, the server SHOULD return an <invalid-from/> stream error that entity, the server SHOULD return an <invalid-from/> stream error
to the client. If a client attempts to send an XML stanza over a to the client. If a client attempts to send an XML stanza over a
stream that is not yet authenticated, the server SHOULD return a stream that is not yet authenticated, the server SHOULD return a
<not-authorized/> stream error to the client. If generated, both of <not-authorized/> stream error to the client. If generated, both of
these conditions MUST result in closing of the stream and termination these conditions MUST result in closing of the stream and termination
of the underlying TCP connection; this helps to prevent a denial of of the underlying TCP connection; this helps to prevent a denial of
service attack launched from a rogue client. service attack launched from a rogue client.
skipping to change at page 47, line 42 skipping to change at page 48, line 45
client's full JID (<node@domain/resource>). A server MUST NOT send client's full JID (<node@domain/resource>). A server MUST NOT send
to the client a stanza without a 'from' attribute if the stanza was to the client a stanza without a 'from' attribute if the stanza was
not generated by the server itself. When a client receives a stanza not generated by the server itself. When a client receives a stanza
that does not include a 'from' attribute, it MUST assume that the that does not include a 'from' attribute, it MUST assume that the
stanza is from the server to which the client is connected. stanza is from the server to which the client is connected.
In the 'jabber:server' namespace, a stanza MUST possess a 'from' In the 'jabber:server' namespace, a stanza MUST possess a 'from'
attribute; if a server receives a stanza that does not meet this attribute; if a server receives a stanza that does not meet this
restriction, it MUST generate an <improper-addressing/> stream error restriction, it MUST generate an <improper-addressing/> stream error
condition. Furthermore, the domain identifier portion of the JID condition. Furthermore, the domain identifier portion of the JID
contained in the 'from' attribute MUST match the hostname (or any contained in the 'from' attribute MUST match the hostname of the
validated domain) of the sending server as communicated in the SASL sending server (or any validated domain thereof, such as a validated
subdomain of the sending server's hostname or another validated
domain hosted by the sending server) as communicated in the SASL
negotiation or dialback negotiation; if a server receives a stanza negotiation or dialback negotiation; if a server receives a stanza
that does not meet this restriction, it MUST generate an that does not meet this restriction, it MUST generate an
<invalid-from/> stream error condition. Both of these conditions <invalid-from/> stream error condition. Both of these conditions
MUST result in closing of the stream and termination of the MUST result in closing of the stream and termination of the
underlying TCP connection; this helps to prevent a denial of service underlying TCP connection; this helps to prevent a denial of service
attack launched from a rogue server. attack launched from a rogue server.
9.1.3 id 9.1.3 id
The optional 'id' attribute MAY be used by a sending entity for The optional 'id' attribute MAY be used by a sending entity for
internal tracking of stanzas that it sends and receives (especially internal tracking of stanzas that it sends and receives (especially
for tracking the request-response interaction inherent in the for tracking the request-response interaction inherent in the
semantics of IQ stanzas). It is OPTIONAL for the value of the 'id' semantics of IQ stanzas). It is OPTIONAL for the value of the 'id'
attribute to be unique globally, within a domain, or within a stream. attribute to be unique globally, within a domain, or within a stream.
The semantics of IQ stanzas impose additional restrictions; see IQ The semantics of IQ stanzas impose additional restrictions; see IQ
Semantics (Section 9.2.3). Semantics (Section 9.2.3).
9.1.4 type 9.1.4 type
skipping to change at page 48, line 37 skipping to change at page 49, line 42
A stanza SHOULD possess an 'xml:lang' attribute (as defined in A stanza SHOULD possess an 'xml:lang' attribute (as defined in
Section 2.12 of [XML]) if the stanza contains XML character data that Section 2.12 of [XML]) if the stanza contains XML character data that
is intended to be presented to a human user (as explained in RFC 2277 is intended to be presented to a human user (as explained in RFC 2277
[CHARSET], "internationalization is for humans"). The value of the [CHARSET], "internationalization is for humans"). The value of the
'xml:lang' attribute specifies the default language of any such 'xml:lang' attribute specifies the default language of any such
human-readable XML character data, which MAY be overridden by the human-readable XML character data, which MAY be overridden by the
'xml:lang' attribute of a specific child element. If a stanza does 'xml:lang' attribute of a specific child element. If a stanza does
not possess an 'xml:lang' attribute, an implementation MUST assume not possess an 'xml:lang' attribute, an implementation MUST assume
that the default language is that specified for the stream as defined that the default language is that specified for the stream as defined
under Stream Attributes (Section 4.2) above. The value of the under Stream Attributes (Section 4.4) above. The value of the
'xml:lang' attribute MUST be an NMTOKEN and MUST conform to the 'xml:lang' attribute MUST be an NMTOKEN and MUST conform to the
format defined in RFC 3066 [LANGTAGS]. format defined in RFC 3066 [LANGTAGS].
9.2 Basic Semantics 9.2 Basic Semantics
9.2.1 Message Semantics 9.2.1 Message Semantics
The <message/> stanza kind can be seen as a "push" mechanism whereby The <message/> stanza kind can be seen as a "push" mechanism whereby
one entity pushes information to another entity, similar to the one entity pushes information to another entity, similar to the
communications that occur in a system such as email. All message communications that occur in a system such as email. All message
stanzas SHOULD possess a 'to' attribute that specifies the intended stanzas SHOULD possess a 'to' attribute that specifies the intended
recipient of the message; upon receiving such a stanza, a server recipient of the message; upon receiving such a stanza, a server
SHOULD route or deliver it to the intended recipient (see Server SHOULD route or deliver it to the intended recipient (see Server
Rules for Handling XML Stanzas (Section 10) for general routing and Rules for Handling XML Stanzas (Section 10) for general routing and
delivery rules related to XML stanzas). delivery rules related to XML stanzas).
9.2.2 Presence Semantics 9.2.2 Presence Semantics
The <presence/> element can be seen as a basic broadcast or The <presence/> element can be seen as a basic broadcast or
"publish-subscribe" mechanism, whereby multiple entities receive "publish-subscribe" mechanism, whereby multiple entities receive
information (in this case, presence information) about an entity to information about an entity to which they have subscribed (in this
which they have subscribed. In general, a publishing entity SHOULD case, network availability information). In general, a publishing
send a presence stanza with no 'to' attribute, in which case the entity SHOULD send a presence stanza with no 'to' attribute, in which
server to which the entity is connected SHOULD broadcast or multiplex case the server to which the entity is connected SHOULD broadcast or
that stanza to all subscribing entities. However, a publishing multiplex that stanza to all subscribing entities. However, a
entity MAY also send a presence stanza with a 'to' attribute, in publishing entity MAY also send a presence stanza with a 'to'
which case the server SHOULD route or deliver that stanza to the attribute, in which case the server SHOULD route or deliver that
intended recipient. See Server Rules for Handling XML Stanzas stanza to the intended recipient. See Server Rules for Handling XML
(Section 10) for general routing and delivery rules related to XML Stanzas (Section 10) for general routing and delivery rules related
stanzas, and [XMPP-IM] for presence-specific rules in the context of to XML stanzas, and [XMPP-IM] for presence-specific rules in the
an instant messaging and presence application. context of an instant messaging and presence application.
9.2.3 IQ Semantics 9.2.3 IQ Semantics
Info/Query, or IQ, is a request-response mechanism, similar in some Info/Query, or IQ, is a request-response mechanism, similar in some
ways to [HTTP]. The semantics of IQ enable an entity to make a ways to [HTTP]. The semantics of IQ enable an entity to make a
request of, and receive a response from, another entity. The data request of, and receive a response from, another entity. The data
content of the request and response is defined by the namespace content of the request and response is defined by the namespace
declaration of a direct child element of the IQ element, and the declaration of a direct child element of the IQ element, and the
interaction is tracked by the requesting entity through use of the interaction is tracked by the requesting entity through use of the
'id' attribute. Thus IQ interactions follow a common pattern of 'id' attribute. Thus IQ interactions follow a common pattern of
skipping to change at page 50, line 6 skipping to change at page 51, line 25
| <iq type='set' id='2'> | | <iq type='set' id='2'> |
| ------------------------> | | ------------------------> |
| | | |
| <iq type='error' id='2'> | | <iq type='error' id='2'> |
| <------------------------ | | <------------------------ |
| | | |
In order to enforce these semantics, the following rules apply: In order to enforce these semantics, the following rules apply:
1. The 'id' attribute is REQUIRED for IQ stanzas. 1. The 'id' attribute is REQUIRED for IQ stanzas.
2. The 'type' attribute is REQUIRED for IQ stanzas. The value MUST 2. The 'type' attribute is REQUIRED for IQ stanzas. The value MUST
be one of the following: be one of the following:
3.
* get -- The stanza is a request for information or * get -- The stanza is a request for information or
requirements. requirements.
* set -- The stanza provides required data, sets new values, or * set -- The stanza provides required data, sets new values, or
replaces existing values. replaces existing values.
* result -- The stanza is a response to a successful get or set * result -- The stanza is a response to a successful get or set
request. request.
* error -- An error has occurred regarding processing or * error -- An error has occurred regarding processing or
delivery of a previously-sent get or set (see Stanza Errors delivery of a previously-sent get or set (see Stanza Errors
(Section 9.3)). (Section 9.3)).
3. An entity that receives an IQ request of type "get" or "set" MUST
4. An entity that receives an IQ request of type "get" or "set" MUST
reply with an IQ response of type "result" or "error" (which reply with an IQ response of type "result" or "error" (which
response MUST preserve the 'id' attribute of the request). response MUST preserve the 'id' attribute of the request).
4. An entity that receives a stanza of type "result" or "error" MUST
5. An entity that receives a stanza of type "result" or "error" MUST
NOT respond to the stanza by sending a further IQ response of NOT respond to the stanza by sending a further IQ response of
type "result" or "error"; however, as shown above, the requesting type "result" or "error"; however, as shown above, the requesting
entity MAY send another request (e.g., an IQ of type "set" in entity MAY send another request (e.g., an IQ of type "set" in
order to provide required information discovered through a get/ order to provide required information discovered through a get/
result pair). result pair).
5. An IQ stanza of type "get" or "set" MUST contain one and only one
6. An IQ stanza of type "get" or "set" MUST contain one and only one child element that specifies the semantics of the particular
child element (properly-namespaced as defined in [XMPP-IM]) that request or response.
specifies the semantics of the particular request or response. 6. An IQ stanza of type "result" MUST include zero or one child
7. An IQ stanza of type "result" MUST include zero or one child
elements. elements.
7. An IQ stanza of type "error" SHOULD include the child element
8. An IQ stanza of type "error" SHOULD include the child element
contained in the associated "get" or "set" and MUST include an contained in the associated "get" or "set" and MUST include an
<error/> child; for details, see Stanza Errors (Section 9.3). <error/> child; for details, see Stanza Errors (Section 9.3).
9.3 Stanza Errors 9.3 Stanza Errors
Stanza-related errors are handled in a manner similar to stream Stanza-related errors are handled in a manner similar to stream
errors (Section 4.6). However, unlike stream errors, stanza errors errors (Section 4.7). However, unlike stream errors, stanza errors
are recoverable; therefore error stanzas include hints regarding are recoverable; therefore error stanzas include hints regarding
actions that the original sender can take in order to remedy the actions that the original sender can take in order to remedy the
error. error.
9.3.1 Rules 9.3.1 Rules
The following rules apply to stanza-related errors: The following rules apply to stanza-related errors:
o The receiving or processing entity that detects an error condition o The receiving or processing entity that detects an error condition
in relation to a stanza MUST return to the sending entity a stanza in relation to a stanza MUST return to the sending entity a stanza
skipping to change at page 51, line 16 skipping to change at page 52, line 22
9.3.1 Rules 9.3.1 Rules
The following rules apply to stanza-related errors: The following rules apply to stanza-related errors:
o The receiving or processing entity that detects an error condition o The receiving or processing entity that detects an error condition
in relation to a stanza MUST return to the sending entity a stanza in relation to a stanza MUST return to the sending entity a stanza
of the same kind (message, presence, or IQ) whose 'type' attribute of the same kind (message, presence, or IQ) whose 'type' attribute
is set to a value of "error" (such a stanza is called an "error is set to a value of "error" (such a stanza is called an "error
stanza" herein). stanza" herein).
o The entity that generates an error stanza SHOULD include the o The entity that generates an error stanza SHOULD include the
original XML sent so that the sender can inspect and if necessary original XML sent so that the sender can inspect and if necessary
correct the XML before attempting to resend. correct the XML before attempting to resend.
o An error stanza MUST contain an <error/> child element. o An error stanza MUST contain an <error/> child element.
o An <error/> child MUST NOT be included if the 'type' attribute has o An <error/> child MUST NOT be included if the 'type' attribute has
a value other than "error" (or if there is no 'type' attribute). a value other than "error" (or if there is no 'type' attribute).
o An entity that receives an error stanza MUST NOT respond to the o An entity that receives an error stanza MUST NOT respond to the
stanza with a further error stanza; this helps to prevent looping. stanza with a further error stanza; this helps to prevent looping.
9.3.2 Syntax 9.3.2 Syntax
The syntax for stanza-related errors is as follows: The syntax for stanza-related errors is as follows:
<stanza-name to='sender' type='error'> <stanza-kind to='sender' type='error'>
[RECOMMENDED to include sender XML here] [RECOMMENDED to include sender XML here]
<error type='error-type'> <error type='error-type'>
<defined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <defined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'> <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>
OPTIONAL descriptive text OPTIONAL descriptive text
</text> </text>
[OPTIONAL application-specific condition element] [OPTIONAL application-specific condition element]
</error> </error>
</stanza-name> </stanza-kind>
The stanza-name is one of message, presence, or iq. The stanza-kind is one of message, presence, or iq.
The value of the <error/> element's 'type' attribute MUST be one of The value of the <error/> element's 'type' attribute MUST be one of
the following: the following:
o cancel -- do not retry (the error is unrecoverable) o cancel -- do not retry (the error is unrecoverable)
o continue -- proceed (the condition was only a warning) o continue -- proceed (the condition was only a warning)
o modify -- retry after changing the data sent o modify -- retry after changing the data sent
o auth -- retry after providing credentials o auth -- retry after providing credentials
o wait -- retry after waiting (the error is temporary) o wait -- retry after waiting (the error is temporary)
The <error/> element: The <error/> element:
o MUST contain a child element corresponding to one of the defined o MUST contain a child element corresponding to one of the defined
stanza error conditions specified below; this element MUST be stanza error conditions specified below; this element MUST be
qualified by the 'urn:ietf:params:xml:ns:xmpp-stanzas' namespace. qualified by the 'urn:ietf:params:xml:ns:xmpp-stanzas' namespace.
o MAY contain a <text/> child containing XML character data that
o MAY contain a <text/> child containing CDATA that describes the describes the error in more detail; this element MUST be qualified
error in more detail; this element MUST be qualified by the by the 'urn:ietf:params:xml:ns:xmpp-stanzas' namespace and SHOULD
'urn:ietf:params:xml:ns:xmpp-stanzas' namespace and SHOULD possess possess an 'xml:lang' attribute.
an 'xml:lang' attribute.
o MAY contain a child element for an application-specific error o MAY contain a child element for an application-specific error
condition; this element MUST be qualified by an condition; this element MUST be qualified by an
application-defined namespace, and its structure is defined by application-defined namespace, and its structure is defined by
that namespace. that namespace.
The <text/> element is OPTIONAL. If included, it SHOULD be used only The <text/> element is OPTIONAL. If included, it SHOULD be used only
to provide descriptive or diagnostic information that supplements the to provide descriptive or diagnostic information that supplements the
meaning of a defined condition or application-specific condition. It meaning of a defined condition or application-specific condition. It
SHOULD NOT be interpreted programmatically by an application. It SHOULD NOT be interpreted programmatically by an application. It
SHOULD NOT be used as the error message presented to a user, but MAY SHOULD NOT be used as the error message presented to a user, but MAY
be shown in addition to the error message associated with the be shown in addition to the error message associated with the
included condition element (or elements). included condition element (or elements).
Finally, to maintain backward compatibility, the schema (specified in Finally, to maintain backward compatibility, the schema (specified in
[XMPP-IM]) allows the optional inclusion of a 'code' attribute on the [XMPP-IM]) allows the optional inclusion of a 'code' attribute on the
<error/> element. <error/> element.
9.3.3 Defined Conditions 9.3.3 Defined Conditions
The following stanza-related error conditions are defined for use in The following conditions are defined for use in stanza errors.
stanza errors.
o <bad-request/> -- the sender has sent XML that is malformed or o <bad-request/> -- the sender has sent XML that is malformed or
that cannot be processed (e.g., an IQ stanza that includes an that cannot be processed (e.g., an IQ stanza that includes an
unrecognized value of the 'type' attribute); the associated error unrecognized value of the 'type' attribute); the associated error
type SHOULD be "modify". type SHOULD be "modify".
o <conflict/> -- access cannot be granted because an existing o <conflict/> -- access cannot be granted because an existing
resource or session exists with the same name or address; the resource or session exists with the same name or address; the
associated error type SHOULD be "cancel". associated error type SHOULD be "cancel".
o <feature-not-implemented/> -- the feature requested is not o <feature-not-implemented/> -- the feature requested is not
implemented by the recipient or server and therefore cannot be implemented by the recipient or server and therefore cannot be
processed; the associated error type SHOULD be "cancel". processed; the associated error type SHOULD be "cancel".
o <forbidden/> -- the requesting entity does not possess the o <forbidden/> -- the requesting entity does not possess the
required permissions to perform the action; the associated error required permissions to perform the action; the associated error
type SHOULD be "auth". type SHOULD be "auth".
o <gone/> -- the recipient or server can no longer be contacted at o <gone/> -- the recipient or server can no longer be contacted at
this address (the error stanza MAY contain a new address in the this address (the error stanza MAY contain a new address in the
CDATA of the <gone/> element); the associated error type SHOULD be XML character data of the <gone/> element); the associated error
"modify". type SHOULD be "modify".
o <internal-server-error/> -- the server could not process the o <internal-server-error/> -- the server could not process the
stanza because of a misconfiguration or an otherwise-undefined stanza because of a misconfiguration or an otherwise-undefined
internal server error; the associated error type SHOULD be "wait". internal server error; the associated error type SHOULD be "wait".
o <item-not-found/> -- the addressed JID or item requested cannot be o <item-not-found/> -- the addressed JID or item requested cannot be
found; the associated error type SHOULD be "cancel". found; the associated error type SHOULD be "cancel".
o <jid-malformed/> -- the sending entity has provided or o <jid-malformed/> -- the sending entity has provided or
communicated an XMPP address (e.g., a value of the 'to' attribute) communicated an XMPP address (e.g., a value of the 'to' attribute)
or aspect thereof (e.g., a resource identifier) that does not or aspect thereof (e.g., a resource identifier) that does not
adhere to the syntax defined in Addressing Scheme (Section 3); the adhere to the syntax defined in Addressing Scheme (Section 3); the
associated error type SHOULD be "modify". associated error type SHOULD be "modify".
o <not-acceptable/> -- the recipient or server understands the o <not-acceptable/> -- the recipient or server understands the
request but is refusing to process it because it does not meet request but is refusing to process it because it does not meet
criteria defined by the recipient or server (e.g., a local policy criteria defined by the recipient or server (e.g., a local policy
regarding acceptable words in messages); the associated error type regarding acceptable words in messages); the associated error type
SHOULD be "modify". SHOULD be "modify".
o <not-allowed/> -- the recipient or server does not allow any o <not-allowed/> -- the recipient or server does not allow any
entity to perform the action; the associated error type SHOULD be entity to perform the action; the associated error type SHOULD be
"cancel". "cancel".
o <not-authorized/> -- the sender must provide proper credentials o <not-authorized/> -- the sender must provide proper credentials
before being allowed to perform the action, or has provided before being allowed to perform the action, or has provided
improper credentials; the associated error type SHOULD be "auth". improper credentials; the associated error type SHOULD be "auth".
o <payment-required/> -- the requesting entity is not authorized to o <payment-required/> -- the requesting entity is not authorized to
access the requested service because payment is required; the access the requested service because payment is required; the
associated error type SHOULD be "auth". associated error type SHOULD be "auth".
o <recipient-unavailable/> -- the intended recipient is temporarily o <recipient-unavailable/> -- the intended recipient is temporarily
unavailable; the associated error type SHOULD be "wait" (note: an unavailable; the associated error type SHOULD be "wait" (note: an
application MUST NOT return this error if doing so would provide application MUST NOT return this error if doing so would provide
information about the intended recipient's network availability to information about the intended recipient's network availability to
an entity that is not authorized to know such information). an entity that is not authorized to know such information).
o <redirect/> -- the recipient or server is redirecting requests for o <redirect/> -- the recipient or server is redirecting requests for
this information to another entity, usually temporarily (the error this information to another entity, usually temporarily (the error
stanza SHOULD contain the alternate address, which MUST be a valid stanza SHOULD contain the alternate address, which MUST be a valid
JID, in the CDATA of the <redirect/> element); the associated JID, in the XML character data of the <redirect/> element); the
error type SHOULD be "modify". associated error type SHOULD be "modify".
o <registration-required/> -- the requesting entity is not o <registration-required/> -- the requesting entity is not
authorized to access the requested service because registration is authorized to access the requested service because registration is
required; the associated error type SHOULD be "auth". required; the associated error type SHOULD be "auth".
o <remote-server-not-found/> -- a remote server or service specified o <remote-server-not-found/> -- a remote server or service specified
as part or all of the JID of the intended recipient does not as part or all of the JID of the intended recipient does not
exist; the associated error type SHOULD be "cancel". exist; the associated error type SHOULD be "cancel".
o <remote-server-timeout/> -- a remote server or service specified o <remote-server-timeout/> -- a remote server or service specified
as part or all of the JID of the intended recipient could not be as part or all of the JID of the intended recipient (or required
contacted within a reasonable amount of time; the associated error to fulfill a request) could not be contacted within a reasonable
type SHOULD be "wait". amount of time; the associated error type SHOULD be "wait".
o <resource-constraint/> -- the server or recipient lacks the system o <resource-constraint/> -- the server or recipient lacks the system
resources necessary to service the request; the associated error resources necessary to service the request; the associated error
type SHOULD be "wait". type SHOULD be "wait".
o <service-unavailable/> -- the server or recipient does not o <service-unavailable/> -- the server or recipient does not
currently provide the requested service; the associated error type currently provide the requested service; the associated error type
SHOULD be "cancel". SHOULD be "cancel".
o <subscription-required/> -- the requesting entity is not o <subscription-required/> -- the requesting entity is not
authorized to access the requested service because a subscription authorized to access the requested service because a subscription
is required; the associated error type SHOULD be "auth". is required; the associated error type SHOULD be "auth".
o <undefined-condition/> -- the error condition is not one of those o <undefined-condition/> -- the error condition is not one of those
defined by the other conditions in this list; any error type may defined by the other conditions in this list; any error type may
be associated with this condition, and it SHOULD be used only in be associated with this condition, and it SHOULD be used only in
conjunction with an application-specific condition. conjunction with an application-specific condition.
o <unexpected-request/> -- the recipient or server understood the o <unexpected-request/> -- the recipient or server understood the
request but was not expecting it at this time (e.g., the request request but was not expecting it at this time (e.g., the request
was out of order); the associated error type SHOULD be "wait". was out of order); the associated error type SHOULD be "wait".
9.3.4 Application-Specific Conditions 9.3.4 Application-Specific Conditions
As noted, an application MAY provide application-specific stanza As noted, an application MAY provide application-specific stanza
error information by including a properly-namespaced child in the error information by including a properly-namespaced child in the
error element. The application-specific element SHOULD supplement or error element. The application-specific element SHOULD supplement or
further qualify a defined element. Thus the <error/> element will further qualify a defined element. Thus the <error/> element will
skipping to change at page 55, line 38 skipping to change at page 56, line 15
10. Server Rules for Handling XML Stanzas 10. Server Rules for Handling XML Stanzas
Compliant server implementations MUST ensure in-order processing of Compliant server implementations MUST ensure in-order processing of
XML stanzas between any two entities. XML stanzas between any two entities.
Beyond the requirement for in-order processing, each server Beyond the requirement for in-order processing, each server
implementation will contain its own "delivery tree" for handling implementation will contain its own "delivery tree" for handling
stanzas it receives. Such a tree determines whether a stanza needs stanzas it receives. Such a tree determines whether a stanza needs
to be routed to another domain, processed internally, or delivered to to be routed to another domain, processed internally, or delivered to
a resource associated with a connected node. The following rules a resource associated with a connected node. The following rules
apply: apply to a "mere" XMPP server, but MAY be further specified or
overridden by a particular class of application servers (e.g., an
instant messaging and presence server as defined in [XMPP-IM]):
10.1 No 'to' Address 10.1 No 'to' Address
If the stanza possesses no 'to' attribute, the server SHOULD process If the stanza possesses no 'to' attribute, the server SHOULD process
it on behalf of the entity that sent it. Because all stanzas it on behalf of the entity that sent it. Because all stanzas
received from other servers MUST possess a 'to' attribute, this rule received from other servers MUST possess a 'to' attribute, this rule
applies only to stanzas received from a registered entity (such as a applies only to stanzas received from a registered entity (such as a
client) that is connected to the server. If the server receives a client) that is connected to the server. If the server receives a
presence stanza with no 'to' attribute, the server SHOULD broadcast presence stanza with no 'to' attribute, the server SHOULD broadcast
it to the entities that are subscribed to the sending entity's it to the entities that are subscribed to the sending entity's
skipping to change at page 57, line 23 skipping to change at page 57, line 46
itself and the JID contained in the 'to' attribute is of the form itself and the JID contained in the 'to' attribute is of the form
<node@domain> or <node@domain/resource>, the server SHOULD deliver <node@domain> or <node@domain/resource>, the server SHOULD deliver
the stanza to the intended recipient of the stanza as represented by the stanza to the intended recipient of the stanza as represented by
the JID contained in the 'to' attribute. The following rules apply: the JID contained in the 'to' attribute. The following rules apply:
1. If the JID contains a resource identifier (i.e., is of the form 1. If the JID contains a resource identifier (i.e., is of the form
<node@domain/resource>) and there exists a connected resource <node@domain/resource>) and there exists a connected resource
that matches the full JID, the recipient's server SHOULD deliver that matches the full JID, the recipient's server SHOULD deliver
the stanza to the stream or session that exactly matches the the stanza to the stream or session that exactly matches the
resource identifier. resource identifier.
2. If the JID contains a resource identifier and there exists no 2. If the JID contains a resource identifier and there exists no
connected resource that matches the full JID, the recipient's connected resource that matches the full JID, the recipient's
server SHOULD return a <service-unavailable/> stanza error to the server SHOULD return a <service-unavailable/> stanza error to the
sender. sender.
3. If the JID is of the form <node@domain> and there exists at least 3. If the JID is of the form <node@domain> and there exists at least
one connected resource for the node, the recipient's server MUST one connected resource for the node, the recipient's server
deliver the stanza to at least one of the connected resources, SHOULD deliver the stanza to at least one of the connected
according to application-specific rules (a set of delivery rules resources, according to application-specific rules (a set of
for instant messaging and presence applications is defined in delivery rules for instant messaging and presence applications is
[XMPP-IM]). defined in [XMPP-IM]).
11. XML Usage within XMPP 11. XML Usage within XMPP
11.1 Restrictions 11.1 Restrictions
XMPP is a simplified and specialized protocol for streaming XML XMPP is a simplified and specialized protocol for streaming XML
elements in order to exchange structured information in close to real elements in order to exchange structured information in close to real
time. Because XMPP does not require the parsing of arbitrary and time. Because XMPP does not require the parsing of arbitrary and
complete XML documents, there is no requirement that XMPP needs to complete XML documents, there is no requirement that XMPP needs to
support the full feature set of [XML]. In particular, the following support the full feature set of [XML]. In particular, the following
skipping to change at page 61, line 39 skipping to change at page 61, line 50
In addition, a client SHOULD support the following core protocols: In addition, a client SHOULD support the following core protocols:
o Generation of addresses to which the [NAMEPREP], Nodeprep o Generation of addresses to which the [NAMEPREP], Nodeprep
(Appendix A), and Resourceprep (Appendix B) profiles of (Appendix A), and Resourceprep (Appendix B) profiles of
[STRINGPREP] can be applied without failing [STRINGPREP] can be applied without failing
13. Internationalization Considerations 13. Internationalization Considerations
XML streams MUST be encoded in UTF-8 as specified under Character XML streams MUST be encoded in UTF-8 as specified under Character
Encoding (Section 11.5). As specified under Stream Attributes Encoding (Section 11.5). As specified under Stream Attributes
(Section 4.2), an XML stream SHOULD include an 'xml:lang' attribute (Section 4.4), an XML stream SHOULD include an 'xml:lang' attribute
that is treated as the default language for any XML character data that is treated as the default language for any XML character data
sent over the stream that is intended to be presented to a human sent over the stream that is intended to be presented to a human
user. As specified under xml:lang (Section 9.1.5), an XML stanza user. As specified under xml:lang (Section 9.1.5), an XML stanza
SHOULD include an 'xml:lang' attribute if the stanza contains XML SHOULD include an 'xml:lang' attribute if the stanza contains XML
character data that is intended to be presented to a human user. A character data that is intended to be presented to a human user. A
server SHOULD apply the default 'xml:lang' attribute to stanzas it server SHOULD apply the default 'xml:lang' attribute to stanzas it
routes or delivers on behalf of connected entities, and MUST NOT routes or delivers on behalf of connected entities, and MUST NOT
modify or delete 'xml:lang' attributes from stanzas it receives from modify or delete 'xml:lang' attributes from stanzas it receives from
other entities. other entities.
skipping to change at page 62, line 16 skipping to change at page 62, line 23
14.1 High Security 14.1 High Security
For the purposes of XMPP communications (client-to-server and For the purposes of XMPP communications (client-to-server and
server-to-server), the term "high security" refers to the use of server-to-server), the term "high security" refers to the use of
security technologies that provide both mutual authentication and security technologies that provide both mutual authentication and
integrity-checking; in particular, when using certificate-based integrity-checking; in particular, when using certificate-based
authentication to provide high security, a chain-of-trust SHOULD be authentication to provide high security, a chain-of-trust SHOULD be
established out-of-band, although a shared certificate authority established out-of-band, although a shared certificate authority
signing certificates could allow a previously unknown certificate to signing certificates could allow a previously unknown certificate to
establish trust in-band. See Section 14.2 below regarding certificate establish trust in-band. See Section 14.2 below regarding
validation procedures. certificate validation procedures.
Implementations MUST support high security. Service provisioning Implementations MUST support high security. Service provisioning
SHOULD use high security, subject to local security policies. SHOULD use high security, subject to local security policies.
14.2 Certificate Validation 14.2 Certificate Validation
When an XMPP peer communicates with another peer securely, it MUST When an XMPP peer communicates with another peer securely, it MUST
validate the peer's certificate. There are three possible cases: validate the peer's certificate. There are three possible cases:
Case #1: The peer contains an End Entity certificate which appears to Case #1: The peer contains an End Entity certificate which appears to
skipping to change at page 62, line 50 skipping to change at page 63, line 6
identity of the peer following the rules described in [HTTP-TLS], identity of the peer following the rules described in [HTTP-TLS],
except that a subjectAltName extension of type "xmpp" MUST be except that a subjectAltName extension of type "xmpp" MUST be
used as the identity if present. If one of these checks fails, used as the identity if present. If one of these checks fails,
user-oriented clients MUST either notify the user (clients MAY user-oriented clients MUST either notify the user (clients MAY
give the user the opportunity to continue with the connection in give the user the opportunity to continue with the connection in
any case) or terminate the connection with a bad certificate any case) or terminate the connection with a bad certificate
error. Automated clients SHOULD terminate the connection (with a error. Automated clients SHOULD terminate the connection (with a
bad certificate error) and log the error to an appropriate audit bad certificate error) and log the error to an appropriate audit
log. Automated clients MAY provide a configuration setting that log. Automated clients MAY provide a configuration setting that
disables this check, but MUST provide a setting which enables it. disables this check, but MUST provide a setting which enables it.
2. The peer SHOULD show the certificate to a user for approval, 2. The peer SHOULD show the certificate to a user for approval,
including the entire certificate chain. The peer MUST Cache the including the entire certificate chain. The peer MUST cache the
certificate (or some non-forgeable representation such as a certificate (or some non-forgeable representation such as a
hash). In future connections, the peer MUST verify that the same hash). In future connections, the peer MUST verify that the same
certificate was presented and MUST notify the user if it has certificate was presented and MUST notify the user if it has
changed. changed.
In Case #2 and Case #3, implementations SHOULD act as in (2) above. In Case #2 and Case #3, implementations SHOULD act as in (2) above.
14.3 Client-to-Server Communications 14.3 Client-to-Server Communications
A compliant implementation MUST support both TLS and SASL for A compliant client implementation MUST support both TLS and SASL for
connections to a server. connections to a server.
The TLS protocol for encrypting XML streams (defined under Use of TLS The TLS protocol for encrypting XML streams (defined under Use of TLS
(Section 5)) provides a reliable mechanism for helping to ensure the (Section 5)) provides a reliable mechanism for helping to ensure the
confidentiality and data integrity of data exchanged between two confidentiality and data integrity of data exchanged between two
entities. entities.
The SASL protocol for authenticating XML streams (defined under Use The SASL protocol for authenticating XML streams (defined under Use
of SASL (Section 6)) provides a reliable mechanism for validating of SASL (Section 6)) provides a reliable mechanism for validating
that a client connecting to a server is who it claims to be. that a client connecting to a server is who it claims to be.
skipping to change at page 63, line 42 skipping to change at page 63, line 46
IPv4/IPv6 address record resolution to determine the IP address, IPv4/IPv6 address record resolution to determine the IP address,
using the "xmpp-client" port of 5222 registered with the IANA. using the "xmpp-client" port of 5222 registered with the IANA.
The IP address and method of access of clients MUST NOT be made The IP address and method of access of clients MUST NOT be made
public by a server, nor are any connections other than the original public by a server, nor are any connections other than the original
server connection required. This helps to protect the client's server connection required. This helps to protect the client's
server from direct attack or identification by third parties. server from direct attack or identification by third parties.
14.4 Server-to-Server Communications 14.4 Server-to-Server Communications
A compliant implementation MUST support both TLS and SASL for A compliant server implementation MUST support both TLS and SASL for
inter-domain communications. For historical reasons, a compliant inter-domain communications. For historical reasons, a compliant
implementation SHOULD also support Server Dialback (Section 8). implementation SHOULD also support Server Dialback (Section 8).
Because service provisioning is a matter of policy, it is OPTIONAL Because service provisioning is a matter of policy, it is OPTIONAL
for any given domain to communicate with other domains, and for any given domain to communicate with other domains, and
server-to-server communications MAY be disabled by the administrator server-to-server communications MAY be disabled by the administrator
of any given deployment. If a particular domain enables inter-domain of any given deployment. If a particular domain enables inter-domain
communications, it SHOULD enable high security. communications, it SHOULD enable high security.
Administrators may want to require use of SASL for server-to-server Administrators may want to require use of SASL for server-to-server
skipping to change at page 64, line 28 skipping to change at page 64, line 31
the earlier usage did not conform to [SRV]; implementations desiring the earlier usage did not conform to [SRV]; implementations desiring
to be backward compatible should continue to look for or answer to to be backward compatible should continue to look for or answer to
the "jabber" service identifier as well). If the SRV lookup fails, the "jabber" service identifier as well). If the SRV lookup fails,
the fallback is a normal IPv4/IPv6 address record resolution to the fallback is a normal IPv4/IPv6 address record resolution to
determine the IP address, using the "xmpp-server" port of 5269 determine the IP address, using the "xmpp-server" port of 5269
registered with the IANA. registered with the IANA.
Server dialback helps protect against domain spoofing, thus making it Server dialback helps protect against domain spoofing, thus making it
more difficult to spoof XML stanzas. It is not a mechanism for more difficult to spoof XML stanzas. It is not a mechanism for
authenticating, securing, or encrypting streams between servers as is authenticating, securing, or encrypting streams between servers as is
done via SASL and TLS. Furthermore, it is susceptible to DNS done via SASL and TLS, and results in weak verification of server
poisoning attacks unless DNSSec [DNSSEC] is used, and even if the DNS identities only. Furthermore, it is susceptible to DNS poisoning
attacks unless DNSSec [DNSSEC] is used, and even if the DNS
information is accurate, dialback cannot protect from attacks where information is accurate, dialback cannot protect from attacks where
the attacker is capable of hijacking the IP address of the remote the attacker is capable of hijacking the IP address of the remote
domain. Domains requiring robust security SHOULD use TLS and SASL. domain. Domains requiring robust security SHOULD use TLS and SASL.
If SASL is used for server-to-server authentication, dialback SHOULD If SASL is used for server-to-server authentication, dialback SHOULD
NOT be used since it is unnecessary. NOT be used since it is unnecessary.
14.5 Order of Layers 14.5 Order of Layers
The order of layers in which protocols MUST be stacked is as follows: The order of layers in which protocols MUST be stacked is as follows:
skipping to change at page 69, line 40 skipping to change at page 69, line 22
This is the first version of Resourceprep This is the first version of Resourceprep
15.8 GSSAPI Service Name 15.8 GSSAPI Service Name
The IANA registers "xmpp" as a GSSAPI [GSS-API] service name, as The IANA registers "xmpp" as a GSSAPI [GSS-API] service name, as
defined under SASL Definition (Section 6.3). defined under SASL Definition (Section 6.3).
15.9 Port Numbers 15.9 Port Numbers
The IANA currently registers "jabber-client" and "jabber-server" as The IANA registers "xmpp-client" and "xmpp-server" as keywords for
keywords for [TCP] ports 5222 and 5269 respectively. The IANA shall [TCP] ports 5222 and 5269 respectively.
change these registrations to "xmpp-client" and "xmpp-server"
respectively.
These ports SHOULD be used for client-to-server and server-to-server These ports SHOULD be used for client-to-server and server-to-server
communications respectively, but their use is OPTIONAL. communications respectively, but their use is OPTIONAL.
Normative References Normative References
[ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", RFC 2234, November 1997. Specifications: ABNF", RFC 2234, November 1997.
[BASE64] Josefsson, S., "The Base16, Base32, and Base64 Data [BASE64] Josefsson, S., "The Base16, Base32, and Base64 Data
skipping to change at page 70, line 25 skipping to change at page 69, line 52
[DNS] Mockapetris, P., "Domain names - implementation and [DNS] Mockapetris, P., "Domain names - implementation and
specification", STD 13, RFC 1035, November 1987. specification", STD 13, RFC 1035, November 1987.
[GSS-API] Linn, J., "Generic Security Service Application Program [GSS-API] Linn, J., "Generic Security Service Application Program
Interface, Version 2", RFC 2078, January 1997. Interface, Version 2", RFC 2078, January 1997.
[HTTP-TLS] [HTTP-TLS]
Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000.
[IDNA] Faltstrom, P., Hoffman, P. and A. Costello,
"Internationalizing Domain Names in Applications (IDNA)",
RFC 3490, March 2003.
[IMP-REQS] [IMP-REQS]
Day, M., Aggarwal, S. and J. Vincent, "Instant Messaging / Day, M., Aggarwal, S. and J. Vincent, "Instant Messaging /
Presence Protocol Requirements", RFC 2779, February 2000. Presence Protocol Requirements", RFC 2779, February 2000.
[IPv6] Hinden, R. and S. Deering, "IP Version 6 Addressing [IPv6] Hinden, R. and S. Deering, "IP Version 6 Addressing
Architecture", RFC 2373, July 1998. Architecture", RFC 2373, July 1998.
[LANGTAGS] [LANGTAGS]
Alvestrand, H., "Tags for the Identification of Alvestrand, H., "Tags for the Identification of
Languages", BCP 47, RFC 3066, January 2001. Languages", BCP 47, RFC 3066, January 2001.
[IDNA] Faltstrom, P., Hoffman, P. and A. Costello,
"Internationalizing Domain Names in Applications (IDNA)",
RFC 3490, March 2003.
[NAMEPREP] [NAMEPREP]
Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep
Profile for Internationalized Domain Names (IDN)", RFC Profile for Internationalized Domain Names (IDN)", RFC
3491, March 2003. 3491, March 2003.
[SASL] Myers, J., "Simple Authentication and Security Layer [SASL] Myers, J., "Simple Authentication and Security Layer
(SASL)", RFC 2222, October 1997. (SASL)", RFC 2222, October 1997.
[SRV] Gulbrandsen, A., Vixie, P. and L. Esibov, "A DNS RR for [SRV] Gulbrandsen, A., Vixie, P. and L. Esibov, "A DNS RR for
specifying the location of services (DNS SRV)", RFC 2782, specifying the location of services (DNS SRV)", RFC 2782,
skipping to change at page 72, line 9 skipping to change at page 71, line 35
[DNSSEC] Eastlake, D., "Domain Name System Security Extensions", [DNSSEC] Eastlake, D., "Domain Name System Security Extensions",
RFC 2535, March 1999. RFC 2535, March 1999.
[HTTP] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., [HTTP] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P. and T. Berners-Lee, "Hypertext Masinter, L., Leach, P. and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[IMAP] Crispin, M., "Internet Message Access Protocol - Version [IMAP] Crispin, M., "Internet Message Access Protocol - Version
4rev1", RFC 2060, December 1996. 4rev1", RFC 2060, December 1996.
[IRC] Oikarinen, J. and D. Reed, "Internet Relay Chat Protocol",
RFC 1459, May 1993.
[JSF] Jabber Software Foundation, "Jabber Software Foundation", [JSF] Jabber Software Foundation, "Jabber Software Foundation",
<http://www.jabber.org/>. <http://www.jabber.org/>.
[POP3] Myers, J. and M. Rose, "Post Office Protocol - Version 3", [POP3] Myers, J. and M. Rose, "Post Office Protocol - Version 3",
STD 53, RFC 1939, May 1996. STD 53, RFC 1939, May 1996.
[RANDOM] Eastlake, D., Crocker, S. and J. Schiller, "Randomness [RANDOM] Eastlake, D., Crocker, S. and J. Schiller, "Randomness
Recommendations for Security", RFC 1750, December 1994. Recommendations for Security", RFC 1750, December 1994.
[SIMPLE] SIMPLE Working Group, "SIMPLE WG", <http://www.ietf.org/
html.charters/simple-charter.html>.
[SMTP] Klensin, J., "Simple Mail Transfer Protocol", RFC 2821,
April 2001.
[URI] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform [URI] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform
Resource Identifiers (URI): Generic Syntax", RFC 2396, Resource Identifiers (URI): Generic Syntax", RFC 2396,
August 1998. August 1998.
[USINGTLS] [USINGTLS]
Newman, C., "Using TLS with IMAP, POP3 and ACAP", RFC Newman, C., "Using TLS with IMAP, POP3 and ACAP", RFC
2595, June 1999. 2595, June 1999.
[XML-REG] Mealling, M., "The IETF XML Registry", [XML-REG] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
draft-mealling-iana-xmlns-registry-05 (work in progress), January 2004.
June 2003.
[XMPP-IM] Saint-Andre, P., "Extensible Messaging and Presence [XMPP-IM] Saint-Andre, P., "Extensible Messaging and Presence
Protocol (XMPP): Instant Messaging and Presence", Protocol (XMPP): Instant Messaging and Presence",
draft-ietf-xmpp-im-21 (work in progress), January 2004. draft-ietf-xmpp-im-21 (work in progress), January 2004.
Author's Address Author's Address
Peter Saint-Andre Peter Saint-Andre (editor)
Jabber Software Foundation Jabber Software Foundation
EMail: stpeter@jabber.org EMail: stpeter@jabber.org
Appendix A. Nodeprep Appendix A. Nodeprep
A.1 Introduction A.1 Introduction
This appendix defines the "Nodeprep" profile of [STRINGPREP]. As This appendix defines the "Nodeprep" profile of [STRINGPREP]. As
such, it specifies processing rules that will enable users to enter such, it specifies processing rules that will enable users to enter
skipping to change at page 76, line 51 skipping to change at page 75, line 49
C.1 Streams namespace C.1 Streams namespace
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<xs:schema <xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://etherx.jabber.org/streams' targetNamespace='http://etherx.jabber.org/streams'
xmlns='http://etherx.jabber.org/streams' xmlns='http://etherx.jabber.org/streams'
elementFormDefault='unqualified'> elementFormDefault='unqualified'>
<xs:import namespace='http://www.w3.org/XML/1998/namespace'
schemaLocation='http://www.w3.org/2001/xml.xsd'/>
<xs:element name='stream'> <xs:element name='stream'>
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence xmlns:client='jabber:client'
xmlns:server='jabber:server'
xmlns:db='jabber:server:dialback'>
<xs:element ref='features' minOccurs='0' maxOccurs='1'/> <xs:element ref='features' minOccurs='0' maxOccurs='1'/>
<xs:choice minOccurs='0' maxOccurs='1'> <xs:any namespace='urn:ietf:params:xml:ns:xmpp-tls'
<xs:any namespace='jabber:client'
minOccurs='0' minOccurs='0'
maxOccurs='unbounded'/> maxOccurs='unbounded'/>
<xs:any namespace='jabber:server' <xs:any namespace='urn:ietf:params:xml:ns:xmpp-sasl'
minOccurs='0' minOccurs='0'
maxOccurs='unbounded'/> maxOccurs='unbounded'/>
<xs:choice minOccurs='0' maxOccurs='1'>
<xs:choice minOccurs='0' maxOccurs='unbounded'>
<xs:element ref='client:message'/>
<xs:element ref='client:presence'/>
<xs:element ref='client:iq'/>
</xs:choice>
<xs:choice minOccurs='0' maxOccurs='unbounded'>
<xs:element ref='server:message'/>
<xs:element ref='server:presence'/>
<xs:element ref='server:iq'/>
<xs:element ref='db:result'/>
<xs:element ref='db:verify'/>
</xs:choice>
</xs:choice> </xs:choice>
<xs:element ref='error' minOccurs='0' maxOccurs='1'/> <xs:element ref='error' minOccurs='0' maxOccurs='1'/>
</xs:sequence> </xs:sequence>
<xs:attribute name='from' type='xs:string' use='optional'/> <xs:attribute name='from' type='xs:string' use='optional'/>
<xs:attribute name='id' type='xs:NMTOKEN' use='optional'/> <xs:attribute name='id' type='xs:NMTOKEN' use='optional'/>
<xs:attribute name='to' type='xs:string' use='optional'/> <xs:attribute name='to' type='xs:string' use='optional'/>
<xs:attribute name='version' type='xs:decimal' use='optional'/> <xs:attribute name='version' type='xs:decimal' use='optional'/>
<xs:attribute ref='xml:lang' use='optional'/> <xs:attribute ref='xml:lang' use='optional'/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name='features'> <xs:element name='features'>
<xs:complexType> <xs:complexType>
<xs:choice minOccurs='0' maxOccurs='unbounded'> <xs:all xmlns:tls='urn:ietf:params:xml:ns:xmpp-tls'
<xs:any namespace='urn:ietf:params:xml:ns:xmpp-tls'/> xmlns:sasl='urn:ietf:params:xml:ns:xmpp-sasl'
<xs:any namespace='urn:ietf:params:xml:ns:xmpp-sasl'/> xmlns:bind='urn:ietf:params:xml:ns:xmpp-bind'
<xs:any namespace='urn:ietf:params:xml:ns:xmpp-bind'/> xmlns:sess='urn:ietf:params:xml:ns:xmpp-session'>
<xs:any namespace='urn:ietf:params:xml:ns:xmpp-session'/> <xs:element ref='tls:starttls' minOccurs='0'/>
<xs:any namespace='##other'/> <xs:element ref='sasl:mechanisms' minOccurs='0'/>
</xs:choice> <xs:element ref='bind:bind' minOccurs='0'/>
<xs:element ref='sess:session' minOccurs='0'/>
</xs:all>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name='error'> <xs:element name='error'>
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence xmlns:err='urn:ietf:params:xml:ns:xmpp-streams'>
<xs:any namespace='urn:ietf:params:xml:ns:xmpp-streams' <xs:group ref='err:streamErrorGroup'/>
maxOccurs='2'/> <xs:element ref='err:text'
<xs:any
namespace='##other'
minOccurs='0' minOccurs='0'
maxOccurs='1'/> maxOccurs='1'/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:schema> </xs:schema>
C.2 Stream error namespace C.2 Stream error namespace
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<xs:schema <xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xs='http://www.w3.org/2001/XMLSchema'
xmlns:xml='http://www.w3.org/XML/1998/namespace'
targetNamespace='urn:ietf:params:xml:ns:xmpp-streams' targetNamespace='urn:ietf:params:xml:ns:xmpp-streams'
xmlns='urn:ietf:params:xml:ns:xmpp-streams' xmlns='urn:ietf:params:xml:ns:xmpp-streams'
elementFormDefault='qualified'> elementFormDefault='qualified'>
<xs:import namespace='http://www.w3.org/XML/1998/namespace'
schemaLocation='http://www.w3.org/2001/xml.xsd'/>
<xs:element name='bad-format' type='empty'/> <xs:element name='bad-format' type='empty'/>
<xs:element name='bad-namespace-prefix' type='empty'/> <xs:element name='bad-namespace-prefix' type='empty'/>
<xs:element name='conflict' type='empty'/> <xs:element name='conflict' type='empty'/>
<xs:element name='connection-timeout' type='empty'/> <xs:element name='connection-timeout' type='empty'/>
<xs:element name='host-gone' type='empty'/> <xs:element name='host-gone' type='empty'/>
<xs:element name='host-unknown' type='empty'/> <xs:element name='host-unknown' type='empty'/>
<xs:element name='improper-addressing' type='empty'/> <xs:element name='improper-addressing' type='empty'/>
<xs:element name='internal-server-error' type='empty'/> <xs:element name='internal-server-error' type='empty'/>
<xs:element name='invalid-from' type='empty'/> <xs:element name='invalid-from' type='empty'/>
<xs:element name='invalid-id' type='empty'/> <xs:element name='invalid-id' type='empty'/>
skipping to change at page 78, line 45 skipping to change at page 77, line 50
<xs:element name='resource-constraint' type='empty'/> <xs:element name='resource-constraint' type='empty'/>
<xs:element name='restricted-xml' type='empty'/> <xs:element name='restricted-xml' type='empty'/>
<xs:element name='see-other-host' type='xs:string'/> <xs:element name='see-other-host' type='xs:string'/>
<xs:element name='system-shutdown' type='empty'/> <xs:element name='system-shutdown' type='empty'/>
<xs:element name='undefined-condition' type='empty'/> <xs:element name='undefined-condition' type='empty'/>
<xs:element name='unsupported-encoding' type='empty'/> <xs:element name='unsupported-encoding' type='empty'/>
<xs:element name='unsupported-stanza-type' type='empty'/> <xs:element name='unsupported-stanza-type' type='empty'/>
<xs:element name='unsupported-version' type='empty'/> <xs:element name='unsupported-version' type='empty'/>
<xs:element name='xml-not-well-formed' type='empty'/> <xs:element name='xml-not-well-formed' type='empty'/>
<xs:element name='text' type='xs:string'> <xs:group name='streamErrorGroup'>
<xs:choice>
<xs:element ref='bad-format'/>
<xs:element ref='bad-namespace-prefix'/>
<xs:element ref='conflict'/>
<xs:element ref='connection-timeout'/>
<xs:element ref='host-gone'/>
<xs:element ref='host-unknown'/>
<xs:element ref='improper-addressing'/>
<xs:element ref='internal-server-error'/>
<xs:element ref='invalid-from'/>
<xs:element ref='invalid-id'/>
<xs:element ref='invalid-namespace'/>
<xs:element ref='invalid-xml'/>
<xs:element ref='not-authorized'/>
<xs:element ref='policy-violation'/>
<xs:element ref='remote-connection-failed'/>
<xs:element ref='resource-constraint'/>
<xs:element ref='restricted-xml'/>
<xs:element ref='see-other-host'/>
<xs:element ref='system-shutdown'/>
<xs:element ref='undefined-condition'/>
<xs:element ref='unsupported-encoding'/>
<xs:element ref='unsupported-stanza-type'/>
<xs:element ref='unsupported-version'/>
<xs:element ref='xml-not-well-formed'/>
</xs:choice>
</xs:group>
<xs:element name='text'>
<xs:complexType> <xs:complexType>
<xs:simpleContent>
<xs:extension base='xs:string'>
<xs:attribute ref='xml:lang' use='optional'/> <xs:attribute ref='xml:lang' use='optional'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:simpleType name='empty'> <xs:simpleType name='empty'>
<xs:restriction base='xs:string'> <xs:restriction base='xs:string'>
<xs:enumeration value=''/> <xs:enumeration value=''/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
</xs:schema> </xs:schema>
C.3 TLS namespace C.3 TLS namespace
skipping to change at page 79, line 26 skipping to change at page 79, line 19
<xs:schema <xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:ietf:params:xml:ns:xmpp-tls' targetNamespace='urn:ietf:params:xml:ns:xmpp-tls'
xmlns='urn:ietf:params:xml:ns:xmpp-tls' xmlns='urn:ietf:params:xml:ns:xmpp-tls'
elementFormDefault='qualified'> elementFormDefault='qualified'>
<xs:element name='starttls'> <xs:element name='starttls'>
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:element <xs:element
ref='required' name='required'
minOccurs='0' minOccurs='0'
maxOccurs='1'/> maxOccurs='1'
type='empty'/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name='required' type='empty'/>
<xs:element name='proceed' type='empty'/> <xs:element name='proceed' type='empty'/>
<xs:element name='failure' type='empty'/> <xs:element name='failure' type='empty'/>
<xs:simpleType name='empty'> <xs:simpleType name='empty'>
<xs:restriction base='xs:string'> <xs:restriction base='xs:string'>
<xs:enumeration value=''/> <xs:enumeration value=''/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
</xs:schema> </xs:schema>
skipping to change at page 80, line 12 skipping to change at page 79, line 51
<xs:schema <xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:ietf:params:xml:ns:xmpp-sasl' targetNamespace='urn:ietf:params:xml:ns:xmpp-sasl'
xmlns='urn:ietf:params:xml:ns:xmpp-sasl' xmlns='urn:ietf:params:xml:ns:xmpp-sasl'
elementFormDefault='qualified'> elementFormDefault='qualified'>
<xs:element name='mechanisms'> <xs:element name='mechanisms'>
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:element ref='mechanism' maxOccurs='unbounded'/> <xs:element name='mechanism'
maxOccurs='unbounded'
type='xs:string'/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name='mechanism' type='xs:string'/>
<xs:element name='auth'> <xs:element name='auth'>
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:simpleContent>
<xs:extension base='xs:string'> <xs:extension base='empty'>
<xs:attribute name='mechanism' <xs:attribute name='mechanism'
type='xs:NMTOKEN' type='xs:string'
use='optional'/> use='optional'/>
</xs:extension> </xs:extension>
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name='challenge' type='xs:NMTOKEN'/> <xs:element name='challenge' type='xs:string'/>
<xs:element name='response' type='xs:NMTOKEN'/> <xs:element name='response' type='xs:string'/>
<xs:element name='abort' type='empty'/> <xs:element name='abort' type='empty'/>
<xs:element name='success' type='empty'/> <xs:element name='success' type='empty'/>
<xs:element name='failure'> <xs:element name='failure'>
<xs:complexType> <xs:complexType>
<xs:choice maxOccurs='1'> <xs:choice minOccurs='0'>
<xs:element ref='aborted'/>
<xs:element ref='incorrect-encoding'/>
<xs:element ref='invalid-authzid'/>
<xs:element ref='invalid-mechanism'/>
<xs:element ref='mechanism-too-weak'/>
<xs:element ref='not-authorized'/>
<xs:element ref='temporary-auth-failure'/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name='aborted' type='empty'/> <xs:element name='aborted' type='empty'/>
<xs:element name='incorrect-encoding' type='empty'/> <xs:element name='incorrect-encoding' type='empty'/>
<xs:element name='invalid-authzid' type='empty'/> <xs:element name='invalid-authzid' type='empty'/>
<xs:element name='invalid-mechanism' type='empty'/> <xs:element name='invalid-mechanism' type='empty'/>
<xs:element name='mechanism-too-weak' type='empty'/> <xs:element name='mechanism-too-weak' type='empty'/>
<xs:element name='not-authorized' type='empty'/> <xs:element name='not-authorized' type='empty'/>
<xs:element name='temporary-auth-failure' type='empty'/> <xs:element name='temporary-auth-failure' type='empty'/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:simpleType name='empty'> <xs:simpleType name='empty'>
<xs:restriction base='xs:string'> <xs:restriction base='xs:string'>
<xs:enumeration value=''/> <xs:enumeration value=''/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
</xs:schema> </xs:schema>
C.5 Resource binding namespace C.5 Resource binding namespace
skipping to change at page 81, line 31 skipping to change at page 81, line 18
<xs:schema <xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:ietf:params:xml:ns:xmpp-bind' targetNamespace='urn:ietf:params:xml:ns:xmpp-bind'
xmlns='urn:ietf:params:xml:ns:xmpp-bind' xmlns='urn:ietf:params:xml:ns:xmpp-bind'
elementFormDefault='qualified'> elementFormDefault='qualified'>
<xs:element name='bind'> <xs:element name='bind'>
<xs:complexType> <xs:complexType>
<xs:choice minOccurs='0' maxOccurs='1'> <xs:choice minOccurs='0' maxOccurs='1'>
<xs:element ref='resource'/> <xs:element name='resource' type='xs:string'/>
<xs:element ref='jid'/> <xs:element name='jid' type='xs:string'/>
</xs:choice> </xs:choice>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name='resource' type='xs:string'/>
<xs:element name='jid' type='xs:string'/>
</xs:schema> </xs:schema>
C.6 Dialback namespace C.6 Dialback namespace
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<xs:schema <xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='jabber:server:dialback' targetNamespace='jabber:server:dialback'
xmlns='jabber:server:dialback' xmlns='jabber:server:dialback'
skipping to change at page 83, line 4 skipping to change at page 82, line 32
</xs:extension> </xs:extension>
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:schema> </xs:schema>
C.7 Stanza error namespace C.7 Stanza error namespace
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<xs:schema <xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xs='http://www.w3.org/2001/XMLSchema'
xmlns:xml='http://www.w3.org/XML/1998/namespace'
targetNamespace='urn:ietf:params:xml:ns:xmpp-stanzas' targetNamespace='urn:ietf:params:xml:ns:xmpp-stanzas'
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'
elementFormDefault='qualified'> elementFormDefault='qualified'>
<xs:import namespace='http://www.w3.org/XML/1998/namespace'
schemaLocation='http://www.w3.org/2001/xml.xsd'/>
<xs:element name='bad-request' type='empty'/> <xs:element name='bad-request' type='empty'/>
<xs:element name='conflict' type='empty'/> <xs:element name='conflict' type='empty'/>
<xs:element name='feature-not-implemented' type='empty'/> <xs:element name='feature-not-implemented' type='empty'/>
<xs:element name='forbidden' type='empty'/> <xs:element name='forbidden' type='empty'/>
<xs:element name='gone' type='xs:string'/> <xs:element name='gone' type='xs:string'/>
<xs:element name='internal-server-error' type='empty'/> <xs:element name='internal-server-error' type='empty'/>
<xs:element name='item-not-found' type='empty'/> <xs:element name='item-not-found' type='empty'/>
<xs:element name='jid-malformed' type='empty'/> <xs:element name='jid-malformed' type='empty'/>
<xs:element name='not-acceptable' type='empty'/> <xs:element name='not-acceptable' type='empty'/>
<xs:element name='not-allowed' type='empty'/> <xs:element name='not-allowed' type='empty'/>
skipping to change at page 83, line 36 skipping to change at page 83, line 14
<xs:element name='redirect' type='xs:string'/> <xs:element name='redirect' type='xs:string'/>
<xs:element name='registration-required' type='empty'/> <xs:element name='registration-required' type='empty'/>
<xs:element name='remote-server-not-found' type='empty'/> <xs:element name='remote-server-not-found' type='empty'/>
<xs:element name='remote-server-timeout' type='empty'/> <xs:element name='remote-server-timeout' type='empty'/>
<xs:element name='resource-constraint' type='empty'/> <xs:element name='resource-constraint' type='empty'/>
<xs:element name='service-unavailable' type='empty'/> <xs:element name='service-unavailable' type='empty'/>
<xs:element name='subscription-required' type='empty'/> <xs:element name='subscription-required' type='empty'/>
<xs:element name='undefined-condition' type='empty'/> <xs:element name='undefined-condition' type='empty'/>
<xs:element name='unexpected-request' type='empty'/> <xs:element name='unexpected-request' type='empty'/>
<xs:element name='text' type='xs:string'> <xs:group name='stanzaErrorGroup'>
<xs:choice>
<xs:element ref='bad-request'/>
<xs:element ref='conflict'/>
<xs:element ref='feature-not-implemented'/>
<xs:element ref='forbidden'/>
<xs:element ref='gone'/>
<xs:element ref='internal-server-error'/>
<xs:element ref='item-not-found'/>
<xs:element ref='jid-malformed'/>
<xs:element ref='not-acceptable'/>
<xs:element ref='not-allowed'/>
<xs:element ref='payment-required'/>
<xs:element ref='recipient-unavailable'/>
<xs:element ref='redirect'/>
<xs:element ref='registration-required'/>
<xs:element ref='remote-server-not-found'/>
<xs:element ref='remote-server-timeout'/>
<xs:element ref='resource-constraint'/>
<xs:element ref='service-unavailable'/>
<xs:element ref='subscription-required'/>
<xs:element ref='undefined-condition'/>
<xs:element ref='unexpected-request'/>
</xs:choice>
</xs:group>
<xs:element name='text'>
<xs:complexType> <xs:complexType>
<xs:simpleContent>
<xs:extension base='xs:string'>
<xs:attribute ref='xml:lang' use='optional'/> <xs:attribute ref='xml:lang' use='optional'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:simpleType name='empty'> <xs:simpleType name='empty'>
<xs:restriction base='xs:string'> <xs:restriction base='xs:string'>
<xs:enumeration value=''/> <xs:enumeration value=''/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
</xs:schema> </xs:schema>
Appendix D. Differences Between Core Jabber Protocol and XMPP Appendix D. Differences Between Core Jabber Protocols and XMPP
This section is non-normative. This section is non-normative.
XMPP has been adapted from the protocols originally developed in the XMPP has been adapted from the protocols originally developed in the
Jabber open-source community, which can be thought of as "XMPP 0.9". Jabber open-source community, which can be thought of as "XMPP 0.9".
Because there exists a large installed base of Jabber implementations Because there exists a large installed base of Jabber implementations
and deployments, it may be helpful to specify the key differences and deployments, it may be helpful to specify the key differences
between Jabber and XMPP in order to expedite and encourage upgrades between the relevant Jabber protocols and XMPP in order to expedite
of those implementations and deployments to XMPP. This section and encourage upgrades of those implementations and deployments to
summarizes the core differences, while the corresponding section of XMPP. This section summarizes the core differences, while the
[XMPP-IM] summarizes the differences that relate specifically to corresponding section of [XMPP-IM] summarizes the differences that
instant messaging and presence applications. relate specifically to instant messaging and presence applications.
D.1 Channel Encryption D.1 Channel Encryption
It is common practice in the Jabber community to use SSL for channel It was common practice in the Jabber community to use SSL for channel
encryption on ports other than 5222 and 5269 (the convention is to encryption on ports other than 5222 and 5269 (the convention is to
use ports 5223 and 5270). XMPP uses TLS over the IANA-registered use ports 5223 and 5270). XMPP uses TLS over the IANA-registered
ports for channel encryption, as defined under Use of TLS (Section 5) ports for channel encryption, as defined under Use of TLS (Section 5)
herein. herein.
D.2 Authentication D.2 Authentication
The client-server authentication protocol developed in the Jabber The client-server authentication protocol developed in the Jabber
community uses a basic IQ interaction qualified by the community used a basic IQ interaction qualified by the
'jabber:iq:auth' namespace (documentation of this protocol is 'jabber:iq:auth' namespace (documentation of this protocol is
contained in "JEP-0078: Non-SASL Authentication", published by the contained in "JEP-0078: Non-SASL Authentication", published by the
Jabber Software Foundation [JSF]). XMPP uses SASL for Jabber Software Foundation [JSF]). XMPP uses SASL for
authentication, as defined under Use of SASL (Section 6) herein. authentication, as defined under Use of SASL (Section 6) herein.
The Jabber community does not currently possess an authentication The Jabber community did not develop an authentication protocol for
protocol for server-to-server communications, only the Server server-to-server communications, only the Server Dialback (Section 8)
Dialback (Section 8) protocol to prevent server spoofing. XMPP protocol to prevent server spoofing. XMPP supersedes Server Dialback
augments Server Dialback with a true server-to-server authentication with a true server-to-server authentication protocol, as defined
protocol, as defined under Use of SASL (Section 6) herein. under Use of SASL (Section 6) herein.
D.3 Resource Binding D.3 Resource Binding
Resource binding in the Jabber community is handled via the Resource binding in the Jabber community was handled via the
'jabber:iq:auth' namespace that is also used for client 'jabber:iq:auth' namespace (which was also used for client
authentication with a server. XMPP defines a dedicated namespace for authentication with a server). XMPP defines a dedicated namespace
resource binding as well as the ability for a server to generate a for resource binding as well as the ability for a server to generate
resource identifier on behalf of a client, as defined under Resource a resource identifier on behalf of a client, as defined under
Binding (Section 7). Resource Binding (Section 7).
D.4 JID Processing D.4 JID Processing
JID processing was somewhat loosely defined by the Jabber community JID processing was somewhat loosely defined by the Jabber community
(documentation of forbidden characters and case handling is contained (documentation of forbidden characters and case handling is contained
in "JEP-0029: Definition of Jabber Identifiers", published by the in "JEP-0029: Definition of Jabber Identifiers", published by the
Jabber Software Foundation [JSF]). XMPP specifies the use of Jabber Software Foundation [JSF]). XMPP specifies the use of
[NAMEPREP] for domain identifiers and supplements Nameprep with two [NAMEPREP] for domain identifiers and supplements Nameprep with two
additional [STRINGPREP] profiles for JID processing: Nodeprep additional [STRINGPREP] profiles for JID processing: Nodeprep
(Appendix A) for node identifiers and Resourceprep (Appendix B) for (Appendix A) for node identifiers and Resourceprep (Appendix B) for
resource identifiers . resource identifiers .
D.5 Error Handling D.5 Error Handling
skipping to change at page 85, line 15 skipping to change at page 85, line 22
(documentation of forbidden characters and case handling is contained (documentation of forbidden characters and case handling is contained
in "JEP-0029: Definition of Jabber Identifiers", published by the in "JEP-0029: Definition of Jabber Identifiers", published by the
Jabber Software Foundation [JSF]). XMPP specifies the use of Jabber Software Foundation [JSF]). XMPP specifies the use of
[NAMEPREP] for domain identifiers and supplements Nameprep with two [NAMEPREP] for domain identifiers and supplements Nameprep with two
additional [STRINGPREP] profiles for JID processing: Nodeprep additional [STRINGPREP] profiles for JID processing: Nodeprep
(Appendix A) for node identifiers and Resourceprep (Appendix B) for (Appendix A) for node identifiers and Resourceprep (Appendix B) for
resource identifiers . resource identifiers .
D.5 Error Handling D.5 Error Handling
Stream-related errors are handled in the Jabber community via simple Stream-related errors were handled in the Jabber community via XML
CDATA text in a <stream:error/> element. In XMPP, stream-related character data text in a <stream:error/> element. In XMPP,
errors are handled via an extensible mechanism defined under Stream stream-related errors are handled via an extensible mechanism defined
Errors (Section 4.6) herein. under Stream Errors (Section 4.7) herein.
Stanza-related errors are handled in the Jabber community via Stanza-related errors were handled in the Jabber community via
HTTP-style error codes. In XMPP, stanza-related errors are handled HTTP-style error codes. In XMPP, stanza-related errors are handled
via an extensible mechanism defined under Stanza Errors (Section 9.3) via an extensible mechanism defined under Stanza Errors (Section 9.3)
herein. (Documentation of a mapping between Jabber and XMPP error herein. (Documentation of a mapping between Jabber and XMPP error
handling mechanisms is contained in "JEP-0086: Legacy Errors", handling mechanisms is contained in "JEP-0086: Error Condition
published by the Jabber Software Foundation [JSF].) Mappings", published by the Jabber Software Foundation [JSF].)
D.6 Internationalization D.6 Internationalization
Although use of UTF-8 has always been standard practice within the Although use of UTF-8 has always been standard practice within the
Jabber community, the community did not define mechanisms for Jabber community, the community did not define mechanisms for
specifying the language of human-readable text provided in CDATA specifying the language of human-readable text provided in XML
sections. XMPP specifies the use of the 'xml:lang' attribute in such character data. XMPP specifies the use of the 'xml:lang' attribute
contexts, as defined under Stream Attributes (Section 4.2) and in such contexts, as defined under Stream Attributes (Section 4.4)
xml:lang (Section 9.1.5) herein. and xml:lang (Section 9.1.5) herein.
D.7 Stream Version Attribute D.7 Stream Version Attribute
The Jabber community does not include a 'version' attribute in stream The Jabber community did not include a 'version' attribute in stream
headers. XMPP specifies inclusion of that attribute, with a value of headers. XMPP specifies inclusion of that attribute as a way to
'1.0', as a way to signal support for the stream features signal support for the stream features (authentication, encryption,
(authentication, encryption, etc.) defined under Version Support etc.) defined under Version Support (Section 4.4.1) herein.
(Section 4.2.1) herein.
Appendix E. Revision History
Note to RFC Editor: please remove this entire appendix, and the
corresponding entries in the table of contents, prior to publication.
E.1 Changes from draft-ietf-xmpp-core-21
o Clarified "<major>.<minor>" version numbering and basis for
comparison.
o Clarified relationship between certificate names and JIDs.
o Clarified relationship between SASL usernames and JIDs.
o Changed "TCP socket" to "TCP connection".
o Added informative reference to RFC 1750 with regard to randomness
of stream IDs.
o Changed "Server informs ... to proceed" to "Server informs ...
that it is allowed to proceed".
o Replaced "NOT REQUIRED" with appropriate conformance terminology.
E.2 Changes from draft-ietf-xmpp-core-20
o Completed changes necessary to address IESG feedback.
E.3 Changes from draft-ietf-xmpp-core-19
o Fixed several typographical errors.
o Restricted values of 'type' attribute for IQ stanzas to those
defined in the schema (i.e., changed SHOULD to MUST) to ensure
consistency with text in XMPP IM.
o Added reference to RFC 3548.
o Added the <not-authorized/> stanza error.
o Replaced RFC 2222 reference with reference to
draft-ietf-sasl-rfc2222bis.
o Further clarified role and usage of user names in SASL mechanisms.
o Added mention of 'code' attribute on error element.
o Clarified several sentences in the dialback narrative.
o Clarified use of stringprep profiles and added reference to RFC
3490.
o Added security consideration regarding lack of SASL channel
binding to TLS per discussion at IETF 58 meeting.
o Adjusted formatting to conform to RFC Editor requirements.
E.4 Changes from draft-ietf-xmpp-core-18
o Added the 'xml:lang' attribute to the root <stream/> element per
previous consensus and list discussion.
o Changed "jabber-server" and "jabber-client" service names to
"xmpp-server" and "xmpp-client".
o Added the <gone/>, <not-acceptable/>, and <redirect/> stanza
errors.
o Changed dataype of <see-other-host/> stream error and of <gone/>
and <redirect/> stanza errors to xs:string so that these elements
may contain programmatic information.
o Removed <invalid-realm/> and <bad-protocol/> SASL errors.
o Removed references to RFC 952 and RFC 1123 (domain name format is
handled by reference to Nameprep).
o Changed address record resolution text so that it is not specific
to IPv4.
o Clarified text in appendices regarding scope of Nodeprep and
Resourceprep.
o Removed requirement that receiving entity terminate the TCP
connection upon receiving an <abort/> element from or sending a
<failure/> element to the initiating entity during SASL
negotiation.
o Removed recommendation that TLS and SASL security layer should not
both be used simultaneously.
o Added subsection to Security Considerations regarding use of
base64 in SASL.
o Specified rules regarding inclusion of username in SASL
negotiation.
o Adjusted content related to SASL authorization identities, since
the previous text did not track SASL.
o Added section on resource binding to compensate for changes to
SASL authorization identity text.
o Specified ABNF for JIDs.
o Checked all references.
o Completed a thorough proofreading and consistency check of the
entire text.
E.5 Changes from draft-ietf-xmpp-core-17
o Specified that UTF-8 is the only allowable encoding.
o Added stream errors for <bad-namespace-prefix/>, <invalid-xml/>,
and <restricted-xml/>, as well as a <bad-format/> error for
generic XML error conditions.
o Folded Nodeprep and Resourceprep profiles into this document.
o Moved most delivery handling rules from XMPP IM to XMPP Core.
o Moved detailed stanza syntax descriptions from XMPP Core to XMPP
IM.
o Moved stanza schemas from XMPP Core to XMPP IM.
E.6 Changes from draft-ietf-xmpp-core-16
o Added <conflict/> and <unsupported-encoding/> stream errors.
o Changed the datatype for the <see-other-host/> and
<unsupported-version/> stream errors from 'xs:string' to 'empty'.
o Further clarified server handling of the basic stanza kinds.
o Further clarified character encoding rules per list discussion.
o Specified meaning of version='1.0' flag in stream headers.
o Added stream closure to SASL failure cases in order to mirror
handling of TLS failures.
o Added section on compliance requirements for server and client
implementations.
o Added non-normative section on differences between Jabber usage
and XMPP specifications.
E.7 Changes from draft-ietf-xmpp-core-15
o Added <connection-timeout/> and <policy-violation/> stream errors.
o Added <aborted/> SASL error and clarified <bad-protocol/> error.
o Made 'id' required for IQ stanzas.
E.8 Changes from draft-ietf-xmpp-core-14
o Added SRV lookup for client-to-server communications.
o Changed server SRV record to conform to RFC 2782; specifically,
the service identifier was changed from 'jabber' to
'jabber-server'.
E.9 Changes from draft-ietf-xmpp-core-13
o Clarified stream restart after successful TLS and SASL
negotiation.
o Clarified requirement for resolution of DNS hostnames.
o Clarified text regarding namespaces.
o Clarified examples regarding empty <stream:features/> element.
o Added several more SASL error conditions.
o Changed <invalid-xml/> stream error to <improper-addressing/> and
added to schema.
o Made small editorial changes and fixed several schema errors.
E.10 Changes from draft-ietf-xmpp-core-12
o Moved server dialback to a separate section; clarified its
security characteristics and its role in the protocol.
o Adjusted error handling syntax and semantics per list discussion.
o Further clarified length of node identifiers and total length of
JIDs.
o Documented message type='normal'.
o Corrected several small errors in the TLS and SASL sections.
o Corrected several errors in the schemas.
E.11 Changes from draft-ietf-xmpp-core-11
o Corrected several small errors in the TLS and SASL sections.
o Made small editorial changes and fixed several schema errors.
E.12 Changes from draft-ietf-xmpp-core-10
o Adjusted TLS content regarding certificate validation process.
o Specified that stanza error extensions for specific applications
are to be properly namespaced children of the relevant descriptive
element.
o Clarified rules for inclusion of the 'id' attribute.
o Specified that the 'xml:lang' attribute SHOULD be included (per
list discussion).
o Made small editorial changes and fixed several schema errors.
E.13 Changes from draft-ietf-xmpp-core-09
o Fixed several dialback error conditions.
o Cleaned up rules regarding TLS and certificate processing based on
off-list feedback.
o Changed <stream-condition/> and <stanza-condition/> elements to
<condition/>.
o Added or modified several stream and stanza error conditions.
o Specified only one child allowed for IQ, or two if type="error".
o Fixed several errors in the schemas.
E.14 Changes from draft-ietf-xmpp-core-08
o Incorporated list discussion regarding addressing, SASL, TLS, TCP,
dialback, namespaces, extensibility, and the meaning of 'ignore'
for routers and recipients.
o Specified dialback error conditions.
o Made small editorial changes to address RFC Editor requirements.
E.15 Changes from draft-ietf-xmpp-core-07
o Made several small editorial changes.
E.16 Changes from draft-ietf-xmpp-core-06
o Added text regarding certificate validation in TLS negotiation per
list discussion.
o Clarified nature of XML restrictions per discussion with W3C, and
moved XML Restrictions subsection under "XML Usage within XMPP".
o Further clarified that XML streams are unidirectional.
o Changed stream error and stanza error namespace names to conform
to the format defined in The IETF XML Registry.
o Removed note to RFC Editor regarding provisional namespace names.
E.17 Changes from draft-ietf-xmpp-core-05
o Added <invalid-namespace/> as a stream error condition.
o Adjusted security considerations per discussion at IETF 56 and on
list.
E.18 Changes from draft-ietf-xmpp-core-04
o Added server-to-server examples for TLS and SASL.
o Changed error syntax, rules, and examples based on list
discussion.
o Added schemas for the TLS, stream error, and stanza error
namespaces.
o Added note to RFC Editor regarding provisional namespace names.
o Made numerous small editorial changes and clarified text
throughout.
E.19 Changes from draft-ietf-xmpp-core-03
o Clarified rules and procedures for TLS and SASL.
o Amplified stream error code syntax per list discussion.
o Made numerous small editorial changes.
E.20 Changes from draft-ietf-xmpp-core-02
o Added dialback schema.
o Removed all DTDs since schemas provide more complete definitions.
o Added stream error codes.
o Clarified error code "philosophy".
E.21 Changes from draft-ietf-xmpp-core-01
o Updated the addressing restrictions per list discussion and added
references to the new Nodeprep and Resourceprep profiles.
o Corrected error in Use of SASL regarding 'version' attribute.
o Made numerous small editorial changes.
E.22 Changes from draft-ietf-xmpp-core-00
o Added information about TLS from list discussion.
o Clarified meaning of "ignore" based on list discussion.
o Clarified information about Universal Character Set data and
character encodings.
o Provided base64-decoded information for examples.
o Fixed several errors in the schemas.
o Made numerous small editorial fixes.
E.23 Changes from draft-miller-xmpp-core-02
o Brought Use of SASL section into line with discussion on list and
at IETF 55 meeting.
o Added information about the optional 'xml:lang' attribute per
discussion on list and at IETF 55 meeting.
o Specified that validation is neither required nor recommended, and
that the formal definitions (DTDs and schemas) are included for
descriptive purposes only.
o Specified that the response to an IQ stanza of type "get" or "set"
must be an IQ stanza of type "result" or "error".
o Specified that compliant server implementations must process
stanzas in order.
o Specified that for historical reasons some server implementations
may accept 'stream:' as the only valid namespace prefix on the
root stream element.
o Clarified the difference between 'jabber:client' and
'jabber:server' namespaces, namely, that 'to' and 'from'
attributes are required on all stanzas in the latter but not the
former.
o Fixed typo in Step 9 of the dialback protocol (changed db:result
to db:verify).
o Removed references to TLS pending list discussion.
o Removed the non-normative appendix on OpenPGP usage pending its
inclusion in a separate I-D.
o Simplified the architecture diagram, removed most references to
services, and removed references to the 'jabber:component:*'
namespaces.
o Noted that XMPP activity respects firewall administration
policies.
o Further specified the scope and uniqueness of the 'id' attribute
in all stanza kinds and the <thread/> element in message stanzas.
o Nomenclature changes: (1) from "chunks" to "stanzas"; (2) from
"host" to "server" and from "node" to "client" (except with regard
to definition of the addressing scheme).
Intellectual Property Statement Intellectual Property Statement
The IETF takes no position regarding the validity or scope of any The IETF takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to intellectual property or other rights that might be claimed to
pertain to the implementation or use of the technology described in pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights this document or the extent to which any license under such rights
might or might not be available; neither does it represent that it might or might not be available; neither does it represent that it
has made any effort to identify any such rights. Information on the has made any effort to identify any such rights. Information on the
IETF's procedures with respect to rights in standards-track and IETF's procedures with respect to rights in standards-track and
 End of changes. 260 change blocks. 
880 lines changed or deleted 501 lines changed or added

This html diff was produced by rfcdiff 1.34. The latest version is available from http://tools.ietf.org/tools/rfcdiff/