diff --git a/inbox/isr.xml b/inbox/isr.xml
index 5d6a8d3f..53884d73 100644
--- a/inbox/isr.xml
+++ b/inbox/isr.xml
@@ -8,7 +8,7 @@
Second draft.
Compared to the existing stream resumption mechanism of XEP-0198 § - 5, the approach defined herein reduces the round trips + url='http://xmpp.org/extensions/xep-0198.html#resumption'>XEP-0198 + § 5, the approach defined herein reduces the round trips required to resume a stream to exactly one (besides the round trips required by the TLS handshake). This is achieved by - using only a secure token to resume the stream.
- + using just a secure key to resume the stream. +If an entity supports ISR, then the <enabled/>
Nonza
In order to instantaneously resume an XMPP stream the entity - trying to do so must posses a valid ISR token. If it then needs to - perform ISR, it first determines the host for resumption, and after - that, tries to perform the instant stream resumption.
+In order to instantaneously resume an XMPP stream the initiating + entity, which is either an XMPP client or server, must posses a + valid ISR key. After it has obtained the ISR key, using the process + described in the previous section, it first determines the host for + resumption, and after that, tries to perform the instant stream + resumption.
The lookup mechanism order to determine host candidates for ISR - resumption is as follows:
+The lookup mechanism order to determine host candidates for ISR + resumption is as follows:
-The host candidates retrieved by those mechanisms SHOULD be - tried by the initiating entity in this order.
+The host candidates retrieved by those mechanisms SHOULD be + tried by the initiating entity in this order.
-Note that the hosts announced by the 'location' attribute - qualified by the 'urn:xmpp:isr:0' namespace MUST be connected to - using Transport Layer Security (TLS, see &rfc5246;) from the - beginning, i.e. <starttls/> MUST NOT be used, instead the - TLS Handshake is performed right after establishing the - connection.
+Note that the hosts announced by the 'location' attribute + qualified by the 'urn:xmpp:isr:0' namespace MUST be connected to + using TLS from the beginning, i.e. <starttls/> MUST NOT be + used, instead the TLS handshake is performed right after + establishing the connection.
-The order prefers hosts which allow connections where TLS is - enabled from the beginning. This is desirable in order to reduce - the required round trips by skipping the <starttls/> - step.
+This order prefers hosts which allow connections where TLS is + enabled from the beginning. This is desirable to reduce the + required round trips by skipping the <starttls/> step.
After the host on which the instant stream resumption should be - performed was determined, the entity connects to, and establishes - TLS by either
+After the remote host on which the instant stream resumption + should be performed was determined, the initiating entity connects + to the host, and establishes TLS by either
-After the connection has been secured, the - initiating entity sends an XMPP <stream> open element - followed by a <instant-resume/> Nonza qualified by the - 'urn:xmpp:isr:0' namespace which MUST contain the ISR token in the - 'tok' attribute and the sequence number of the last by Stream - Management handled stanza in the 'h' attribute.
+Next, the initiating entity sends an XMPP <stream> open + element followed by a <instant-resume/> Nonza qualified by + the 'urn:xmpp:isr:0' namespace which MUST contain the previous + stream identifier, the XEP-0198 "SM-ID", in the + 'previd' attribute, the sequence number of the last by Stream + Management handled stanza in the 'h' attribute and the + initiator-hmac as value of at least one <hash/> element as + specified by &xep0300;, which are put as child elements under the + <hmac/> element.
-Note that the initiating entity SHOULD pipeline the instant - stream resumption request together with then initial - <stream> open element since it already has determined that - the service supports this feature. Servers MUST announce that they - support ISR by including an <isr/> element qualified by the - 'urn:xmpp:isr:0' namespace in their stream features.
+The initiator-hmac is defined as follows:
-The function defined in &rfc2104; is used to compute the HMAC + using the hash algorithm specified in the 'algo' attribute of the + <hash/> element as the cryptographic hash function H. The + ISR Key is used as key of the HMAC. And the bytewise concatnation + of the ASCII String "Initiator" and the bytes from + tls-server-end-point, which a TLS Channel Binding defined in + &rfc5929; § 4, is used a the HMAC text. The resulting bytes of the + HMAC function are encoded using Base64 as defined in &rfc4648; + § + 4 and resulting string is used as text value of the + <hash/> element.
+ +Note that the initiating entity SHOULD pipeline the instant + stream resumption request together with then initial + <stream> open element. The initiating entity is able to do + so since it already knows that the service supports ISR because it + announced an ISR key. Servers MUST nevertheless announce that they + support ISR by including an <isr/> element qualified by the + 'urn:xmpp:isr:0' namespace in their stream features.
+ +ISR MUST only be performed over TLS secured sessions. What - follows is that the ISR feature MUST only be announced after - STARTTLS has been successfully performed or on streams where TLS - was established from the beginning.
+ISR MUST only be performed over TLS secured sessions. What + follows is that the ISR feature MUST only be announced after + STARTTLS has been successfully performed or on streams where TLS + was established from the beginning.
-On success the server replies with <inst-resumed/> - Nonza which MUST contain a new ISR Token found in the - 'tok' attribute and the sequence number of the last by Stream - Mangement handled stanza in the 'h' attribute.
+On success the server replies with <inst-resumed/> + Nonza which MUST contain a new ISR Key found in the + 'key' attribute, the sequence number of the last by Stream + Mangement handled stanza in the 'h' attribute and the + 'responder-hmac' as value of the <hash/> element being a + child of the <hamc/> element.
-+ responder-hmac = Base64(HMAC(key, "Responder" || + tls-server-end-point)) +
+ +That is, it is the same as the initiator-hamc, but instead of + using the ASCII string "Initiator", the ASCII string "Responder" + is used.
+ +The initiating entity is required to verify the + responder-hmac achieve mutual authentication.
+ +After the <inst-resumed/> was received both entities - MUST consider the resumed stream to re-established. This - includes all previously negotiated stream features like - &xep0138;. It does however not include the specific state of the - features: For example in case of stream compression, the - dictionary used by the compression mechanism of the resumed - stream MUST NOT be considered to be restored after instant - stream resumption.
+After the <inst-resumed/> was received and has been + verified both entities MUST consider the resumed stream to be + re-established. This includes all previously negotiated stream + features like &xep0138;. It does however not include the + specific state of the features: For example in case of Stream + Compression, the dictionary used by the compression mechanism of + the resumed stream MUST NOT be considered to be restored after + instant stream resumption.
-If the server is unable to resume the stream instantly it - MUST reply with a <failed/> Nonza qualified by the - 'urn:xmpp:isr:0' namespace.
+The server MAY also include a 'h' attribute in the - <failed/> element indicating the number of handled - stanzas.
+The server MAY also include a 'h' attribute in the + <failed/> element indicating the number of stanzas it has + handled so far.
-Instant stream resumption errors SHOULD be considered - recoverable, the initiating entity MAY continue with normal - session establishment; however, misuse of stream management MAY - result in termination of the stream.
+Instant stream resumption errors SHOULD be considered + recoverable, the initiating entity MAY continue with normal + session establishment; however, misuse of stream management MAY + result in termination of the stream.
-It is of vital importance that the Instant Stream Resumption Token +
It is of vital importance that the Instant Stream Resumption Key is generated by a cryptographically secure random generator. See &rfc4086; for more information about Randomness Requirements for Security
@@ -336,7 +401,7 @@Thanks to Jonas Wielicki for his feedback.
+Thanks to Jonas Wielicki and Thijs Alkemade for their feedback.