diff --git a/xep-0388.xml b/xep-0388.xml index 82fd2e84..9c4b7d3e 100644 --- a/xep-0388.xml +++ b/xep-0388.xml @@ -20,6 +20,22 @@ sasl2 &dcridland; + + 0.2.0 + 2017-08-14 + dwd + +

Updated according to implementation experience:

+
    +
  • Updated namespace
  • +
  • Continue "mechanisms" are not; changed these to "tasks".
  • +
  • Added stream features after Success.
  • +
  • Don't need complexity of "=" encoding; removed.
  • +
  • Fixed internal links.
  • +
  • Updated examples.
  • +
+
+
0.1.0 2017-03-16 @@ -60,28 +76,28 @@ -

Servers capable of SASL2 offer a stream feature of <mechanisms/>, qualified by the "urn:xmpp:sasl:0" namespace. This in turn contains one or more <mechanism/> elements in the same namespace, and potentially other elements (for example, the <hostname/> element defined within XEP-0233).

+

Servers capable of SASL2 offer a stream feature of <mechanisms/>, qualified by the "urn:xmpp:sasl:1" namespace. This in turn contains one or more <mechanism/> elements in the same namespace, and potentially other elements (for example, the <hostname/> element defined within XEP-0233).

Note that SASL2 is impossible for clients to initiate without at least one mechanism being available, and therefore MUST NOT be offered.

The feature so advertised, and its child content, SHOULD be stable for the given stream to and from attributes and encryption state, and therefore MAY be cached by clients for later connections.

The Service Name used by XMPP is unchanged from RFC 6120.

-

In all cases, both Clients and Servers encode SASL exchanges using Base 64 encoding. This SHOULD NOT include any line wrapping or other whitespace. As the form <element/> is equivalent to <element></element>, these both indicate an empty string, which is used to indicate no data (ie, the absence of the data). In order to explicitly transmit a zero-length SASL challenge or response, the sending party sends a single equals sign character ("=").

+

In all cases, both Clients and Servers encode SASL exchanges using Base 64 encoding. This SHOULD NOT include any line wrapping or other whitespace. As the form <element/> is equivalent to <element></element>, these both indicate an empty string. Challenges and responses with no data do not occur in SASL, and so require no special handling. To indicate the absence of an initial response, or the absence of success data, the element is simply not included.

Clients, upon observing this stream feature, initiate the authentication by the use of the <authenticate/> top-level element, within the same namespace. The nature of this element is to inform the server about properties of the final stream state, as well as initiate authentication itself. To achieve the latter, it has a single mandatory attribute of "mechanism", with a string value of a mechanism name offered by the Server in the stream feature, and an optional child element of <initial-response/>, containing a base64-encoded SASL Initial Response.

On subsequent connections, if a Client has previously cache the stream feature, the Client MAY choose to send it before seeing the stream features - sending it "pipelined" with the Stream Open tag for example.

- SW1wcm92ZWQgZW5jYXNwdWxhdGlvbiBvZiBvcHRpb25hbCBTQVNMLUlSIGRhdGE= + + Tm9ib2R5IGV2ZXIgZGVjb2RlcyB0aGUgZXhhbXBsZXMu ]]>

In order to provide support for other desired stream states beyond authentication, additional child elements are used. For example, a hypothetical XEP-0198 session resumption element might be included, and/or Resource Binding requests.

+ - U0FTTC1JUiBlbmNvZGVkIGFsb25nc2lkZSBiaW5kIHJlcXVlc3Q= + SSBzaG91bGQgbWFrZSB0aGlzIGEgY29tcGV0aXRpb24= @@ -92,13 +108,13 @@

Server Challenges MAY then be sent. Each Challenge MUST be responded to by a Client in a Client Response. These are not extensible, and contain the corresponding base64 encoded SASL data:

- - QmFzZSA2NCBlbmNvZGVkIFNBU0wgY2hhbGxlbmdlIGRhdGE= + + U28sIG5leHQgRk9TREVNIC0gMjAxOCwgdGhhdCBpcy4uLg== - - QmFzZSA2NCBlbmNvZGVkIFNBU0wgcmVzcG9uc2UgZGF0YQ== + + Li4uSSdsbCBidXkgYSBiZWVyIGZvciB0aGUgZmlyc3QgcGVyc29uIHdoby4uLg== ]]> @@ -112,29 +128,30 @@

If the Client is now authenticated, the Server sends a <success/> element, which contains an OPTIONAL <additional-data/> element containing SASL additional data. It also contains a <authorization-identity/> element containing the negotiated identity - this is a bare JID, unless resource binding has occurred, in which case it is a full JID.

+ - T3B0aW9uYWwgQmFzZSA2NCBlbmNvZGVkIFNBU0wgc3VjY2VzcyBkYXRh + ip/AeIOfZXKBV+fW2smE0GUB3I//nnrrLCYkt0Vj juliet@montague.example/Balcony/a987dsh9a87sdh ]]>

Other extension elements MAY also be contained by the <success/> element.

+ - T3B0aW9uYWwgQmFzZSA2NCBlbmNvZGVkIFNBU0wgc3VjY2VzcyBkYXRh + SGFkIHlvdSBnb2luZywgdGhlcmUsIGRpZG4ndCBJPw== juliet@montague.example/Balcony/a987dsh9a87sdh ]]> -

Any security layer negotiated SHALL take effect after the ">" octet of the closing tag (ie, immediately after "</success>").

+

Any security layer negotiated SHALL take effect after the ">" octet of the closing tag (ie, immediately after "</success>"), if it has not already taken effect at a <continue> - see Continue below.

+

The <success> element is immediately followed by a <features> element containing the applicable stream features of the newly authenticated stream. Note that no stream restart occurs.

A <failure/> element is used by the server to terminate the authentication attempt. It MAY contain application-specific error codes, and MAY contain a textual error. It MUST contain one of the SASL error codes from RFC 6120 Section 6.5.

+ This is a terrible example. @@ -143,25 +160,28 @@

A <continue/> element is used to indicate that while the SASL exchange was successful, it is insufficient to allow authentication at this time.

-

This can be used to indicate that the Client needs to perform a Second Factor Authentication ("2FA"), or is required to change password. These are conducted as additional SASL mechanisms. Such SASL mechanisms MUST NOT change the authorization identifier, or introduce any security layer. The authorization identifer transmitted during the subsequent <success/>, and any security layer which comes into effect after the eventual <success/>, therefore MUST be that of the first mechanism.

-

The element contains a <mechanisms/> element, as defined above as a stream feature, containing suitable mechanisms. It MAY contain an <additional-data/> element, as the <success/> element does.

+

This can be used to indicate that the Client needs to perform a Second Factor Authentication ("2FA"), or is required to change password.

+

Such tasks are presented within a <tasks> element, which contains a sequence of <task> elements, each containing a name. These tasks are analogous to a SASL mechanism, but have a number of differences - they may never attempt to negotiate a new authorization identifier, nor a new security layer.

+

A client MAY choose any one of the offered tasks; if multiple are required a sequence of <continue> exchanges will occur until all mandatory tasks are complete.

+

The <continue element therefore always contains a <tasks/> element, as defined above. It MAY contain an <additional-data/> element, as the <success/> element does.

Finally, it MAY contain a <text/> element, which can contain human-readable data explaining the nature of the step required.

+ - T3B0aW9uYWwgQmFzZSA2NCBlbmNvZGVkIFNBU0wgc3VjY2VzcyBkYXRh + SSdtIGJvcmVkIG5vdy4= - - HOTP-EXAMPLE - TOTP-EXAMPLE - + + HOTP-EXAMPLE + TOTP-EXAMPLE + This account requires 2FA ]]> -

Clients respond with a <next-authenticate/> element, which has a single mandatory attribute of "mechanism", containing the selected mechanism name, and contains an OPTIONAL base64 encoded initial response.

+

After the final octet of the first <continue> element, any SASL security layer negotiated in the preceding exchange SHALL be immediately in effect.

+

Clients respond with a <next/> element, which has a single mandatory attribute of "task", containing the selected task name, and contains an OPTIONAL base64 encoded initial response.

- MkZBIG9yIHBhc3N3b3JkIGNoYW5nZSBvciBzb21ldGhpbmc= + + SSd2ZSBydW4gb3V0IG9mIGlkZWFzIGhlcmUu ]]>
@@ -169,46 +189,48 @@
-

This provides pointers and/or clarifications to the in the order and manner defined in RFC 4422, section 4.

+

This provides pointers and/or clarifications to the Overview in the order and manner defined in RFC 4422, section 4.

The service name SHALL be "xmpp", as defined by RFC 6120.

-

Servers list mechanisms during stream features (See ) and within the <continue/> element (See ).

-

TODO: Neither this specification nor RFC 6120 allow clients access to the mechanism list after SASL negotiation...?

+

Servers list mechanisms during stream features (See Discovering Support).

-

Clients initiate using the <authenticate/> top level element (See , and after any <continue/> with the <next-authenticate/> message (See ).

+

Clients initiate using the <authenticate/> top level element (See Initiation.

-

See .

+

See Challenges and Responses.

-

See .

+

See Completing Authentication.

If a Client specifies an authorization string which is non-empty, the identifier is normalized by treating it as a JID, and performing normalization as described in RFC 7622.

+

In general, implementors are advised that a non-empty authorization string MAY be considered an error if the stream's from attribute (if present) does not match.

-

Clients MAY abort unilaterally by sending <abort/> as specified in .

-

Servers MAY abort unliterally by sending <failure/> with the <aborted/> error code as defined in .

+

Clients MAY abort unilaterally by sending <abort/> as specified in Client Aborts.

+

Servers MAY abort unliterally by sending <failure/> with the <aborted/> error code as defined in Failure.

-

See .

+

Security Layers take effect after the SASL mechanism itself (ie, the first negotiation) has completed successfully, after the final octet of the server's <success> or <continue>. See Success and Continue.

Option (a) is used - any SASL Security Layer is applied first to data being sent, and TLS applied last.

-

Although the <continue/> concept does use multiple SASL sequences, only the first SASL mechanism used is considered an authentication, and only the first can negotiate a security layer.

+

Although the <continue/> concept does use tasks analogous to multiple SASL sequences, only the first SASL mechanism used is considered an authentication, and only the first can negotiate a security layer.

In particular, once <success/> has been sent by the server, any further <authenticate/> element MUST result in a stream error.

Relative to the SASL profile documented in RFC 6120, this introduces more data unprotected by any security layer negotiated by SASL itself.

+

While no actual exchanges are introduced that are unprotected, the nature of this exchange might allow for (for example) a resource binding extension to be introduced.

+

SASL security layers are sparingly used in the field, however., so this is thought to be a theoretical, rather than practical, concern.