<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' []>
<rfc ipr="trust200902" category="exp" docName="draft-schmaus-kitten-sasl-ht-01">
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc private=""?>
<?rfc topblock="yes"?>
<?rfc comments="no"?>
<front>
<title abbrev="">The Hashed Token SASL Mechanism</title>

<author initials="F." surname="Schmaus" fullname="Florian Schmaus">
<organization>University of Erlangen-Nuremberg</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>schmaus@cs.fau.de</email>
<uri></uri>
</address>
</author>
<author initials="C." surname="Egger" fullname="Christoph Egger">
<organization>University of Erlangen-Nuremberg</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>egger@cs.fau.de</email>
<uri></uri>
</address>
</author>
<date year="2017" month="September" day="29"/>

<area>Internet</area>
<workgroup>Common Authentication Technology Next Generation</workgroup>


<abstract>
<t>This document specifies a SASL mechanism designed to be used with short-lived, exclusively ephemeral tokens.
</t>
</abstract>


</front>

<middle>

<section anchor="introduction" title="Introduction">
<t>This section specifies the the family of Hashed Token (HT-*) SASL mechanisms.
It provides hash agility, mutual authentication and is secured by channel binding.
</t>
<t>This mechanism was designed to be used with short-lived tokens for quick, one round-trip, re-authentication of a previous session.
Clients are supposed to request such tokens from the server after being authenticated using a &quot;strong&quot; SASL mechanism (e.g. SCRAM).
Hence a typical sequence of actions using SASL-HT may look like the following:
</t>

<figure align="center"><artwork align="center">
A) Client authenticates using a strong mechanism (e.g., SCRAM)
B) Client requests secret SASL-HT token
   &lt;normal client-server interaction here&gt;
C) Connection between client and server gets interrupted
   (e.g., WiFi ↔ GSM switch)
D) Client resumes previous session using the token from B
E) Client requests secret SASL-HT token
   [goto C]
</artwork></figure>
<t>An example application protocol specific extension based on SASL-HT is <xref target="XEP-ISR-SASL2"/>.
</t>
<t>Since the token is not salted, and only one hash iteration is used, the HT-* mechanism is not suitable to protect long-lived shared secrets (e.g. &quot;passwords&quot;).
You may want to look at <xref target="RFC5802"/> for that.
</t>

<section anchor="conventions-and-terminology" title="Conventions and Terminology">
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;,
&quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this
document are to be interpreted as described in RFC 2119 <xref target="RFC2119"/>.
</t>
<t>Additionally, the key words &quot;<spanx style="strong">MIGHT</spanx>&quot;, &quot;<spanx style="strong">COULD</spanx>&quot;, &quot;<spanx style="strong">MAY WISH TO</spanx>&quot;, &quot;<spanx style="strong">WOULD
PROBABLY</spanx>&quot;, &quot;<spanx style="strong">SHOULD CONSIDER</spanx>&quot;, and &quot;<spanx style="strong">MUST (BUT WE KNOW YOU WON'T)</spanx>&quot; in
this document are to interpreted as described in RFC 6919 <xref target="RFC6919"/>.
</t>
</section>

<section anchor="applicability" title="Applicability">
<t>Because this mechanism transports information that should not be controlled by an attacker, the HT-* mechanism MUST only be used over channels protected by TLS, or over similar integrity-protected and authenticated channels.
In addition, when TLS is used, the client MUST successfully validate the server's certificate (<xref target="RFC5280"/>, <xref target="RFC6125"/>).
</t>
<t>The family of HT-* mechanisms is not applicable for proxy authentication, since they can not carry a authorization identity string (authzid).
</t>
</section>
</section>

<section anchor="the-ht-family-of-mechanisms" title="The HT-* Family of Mechanisms">
<t>Each mechanism in this family differs by the choice of the hash algorithm and the choice of the channel binding <xref target="RFC5929"/> type.
</t>
<t>A HT mechanism name is a string beginning with &quot;HT-&quot; followed by the capitalized name of the used hash, followed by &quot;-&quot;, and suffixed by one of 'ENDP' and 'UNIQ'.
</t>
<t>Hence each HT mechanism has a name of the following form:
</t>

<figure align="center"><artwork align="center">
HT-&lt;hash-alg&gt;-&lt;cb-type&gt;
</artwork></figure>
<t>Where &lt;hash-alg&gt; is the capitalized &quot;Hash Name String&quot; of the IANA &quot;Named Information Hash Algorithm Registry&quot; <xref target="iana-hash-alg"/> as specified in <xref target="RFC6920"/>, and &lt;cb-type&gt; is one of 'ENDP' or 'UNIQ' denoting the channel binding type.
In case of 'ENDP', the tls-server-end-point channel binding type is used.
In case of 'UNIQ', the tls-unique channel binding type is used.
Valid channel binding types are defined in the IANA &quot;Channel-Binding Types&quot; registry <xref target="iana-cbt"/> as specified in <xref target="RFC5056"/>.
</t>
<texttable title="Mapping of CBT to Channel Bindings
">
<ttcol align="center">CBT</ttcol>
<ttcol align="center">Channel Binding Type</ttcol>

<c>ENDP</c><c>tls-server-end-point</c>
<c>UNIQ</c><c>tls-unique</c>
</texttable>
<t>The following table lists the HT-* SASL mechanisms registered this document.
</t>
<texttable title="Defined HT-* SASL mechanisms
">
<ttcol align="center">Mechanism Name</ttcol>
<ttcol align="center">Hash Algorithm</ttcol>
<ttcol align="center">Channel-binding unique prefix</ttcol>

<c>HT-SHA-512-ENDP</c><c>SHA-512</c><c>tls-server-end-point</c>
<c>HT-SHA-512-UNIQ</c><c>SHA-512</c><c>tls-unique</c>
<c>HT-SHA3-512-ENDP</c><c>SHA3-512</c><c>tls-server-end-point</c>
<c>HT-SHA-256-UNIQ</c><c>SHA-256</c><c>tls-unique</c>
</texttable>
</section>

<section anchor="the-ht-mechanism" title="The HT Mechanism">
<t>The mechanism consists of a simple exchange of exactly two messages between the initiator and responder.
</t>
<t>The following syntax specifications use the Augmented Backus-Naur form (ABNF) notation as specified in <xref target="RFC5234"/>.
</t>

<section anchor="initiator-first-message" title="Initiator First Message">
<t>The HT-* SASL mechanism starts with the initiator-msg, send by the initiator to the responder.
</t>
<t>initiator-msg = authcid-length authcid-data initiator-hashed-token
</t>
<t>authcid-length = 4OCTET
</t>
<t>authcid-data = 1*OCTET
</t>
<t>initiator-hashed-token = 1*OCTET
</t>
<t>The initiator message starts with an unsigned 32-bit integer in big endian. It denotes length of the authcid-data, which contains the authentication identity.
Before sending the authentication identity string the initiator SHOULD prepare the data with the UsernameCaseMapped profile of <xref target="RFC7613"/>.
</t>
<t>The initiator-hashed-token value is defined as: HMAC(token, &quot;Initiator&quot; || cb-data)
</t>
<t>HMAC() is the function defined in <xref target="RFC2104"/> with H being the selected HT-* hash algorithm, 'cb-data' represents the data provided by the channel binding type, and 'token' are the UTF-8 encoded octets of the token string which acts as shared secret between initiator and responder.
</t>
<t>The initiator-msg MUST NOT be included in TLS 1.3 0-RTT early data (see <xref target="I-D.ietf-tls-tls13"/>).
</t>
<t>TODO: Add note why HMAC() is always involved, even if HMAC() is usually not required when modern hash algorithms are used.
</t>
</section>

<section anchor="final-responder-message" title="Final Responder Message">
<t>This message is followed by a message from the responder to the initiator. This 'responder-msg' is defined as follows:
</t>
<t>responder-msg = 1*OCTET
</t>
<t>The responder-msg value is defined as: HMAC(token, &quot;Responder&quot; || cb-data)
</t>
<t>The initiating entity MUST verify the responder-msg to achieve mutual authentication.
</t>
</section>
</section>

<section anchor="compliance-with-sasl-mechanism-requirements" title="Compliance with SASL Mechanism Requirements">
<t>This section describes compliance with SASL mechanism requirements specified in Section 5 of <xref target="RFC4422"/>.
</t>
<t>
<list style="numbers">
<t>&quot;HT-SHA-256-ENDP&quot;, &quot;HT-SHA-256-UNIQ&quot;, &quot;HT-SHA-3-512-ENDP&quot; and &quot;HT-SHA-3-512-UNIQ&quot;.</t>
<t>Definition of server-challenges and client-responses:
<list style="format %c">
<t>HT is a client-first mechanism.</t>
<t>HT does not send additional data with success.</t>
</list></t>
<t>HT is capable of transferring authorization identities from the client to the server.</t>
<t>HT does not offer any security layers (HT offers channel binding instead).</t>
<t>HT does not protect the authorization identity.</t>
</list>
</t>
</section>

<section anchor="security-considerations" title="Security Considerations">
<t>To be secure, HT-* MUST be used over a TLS channel that has had the session hash extension <xref target="RFC7627"/> negotiated, or session resumption MUST NOT have been used.
</t>
</section>

<section anchor="iana-considerations" title="IANA Considerations">
<t>IANA has added the following family of SASL mechanisms to the SASL Mechanism registry established by <xref target="RFC4422"/>:
</t>

<figure align="center"><artwork align="center">
To: iana@iana.org
Subject: Registration of a new SASL family HT

SASL mechanism name (or prefix for the family): HT-*
Security considerations:
  Section FIXME of draft-schmaus-kitten-sasl-ht-00 
Published specification (optional, recommended):
  draft-schmaus-kitten-sasl-ht-00 (TODO)
Person &amp; email address to contact for further information:
IETF SASL WG &lt;kitten@ietf.org&gt;
Intended usage: COMMON
Owner/Change controller: IESG &lt;iesg@ietf.org&gt;
Note: Members of this family MUST be explicitly registered
using the "IETF Review" [@!RFC5226] registration procedure.
Reviews MUST be requested on the Kitten WG mailing list
&lt;kitten@ietf.org&gt; (or a successor designated by the responsible
Security AD).
</artwork></figure>
</section>

</middle>
<back>
<references title="Normative References">
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-tls-tls13-19.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2104.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4422.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5056.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5234.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5929.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6125.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6919.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6920.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7613.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7627.xml"?>
<reference anchor='iana-cbt' target='https://www.iana.org/assignments/channel-binding-types/channel-binding-types.xhtml'>
    <front>
        <title>IANA Channel-Binding Types</title>
        <author initials='N.' surname='Williams' fullname='Nicolas Williams'>
            <organization>IANA</organization>
        </author>
        <date year='2010'/>
    </front>
</reference>
<reference anchor='iana-hash-alg' target='https://www.iana.org/assignments/named-information/named-information.xhtml#hash-alg'>
    <front>
        <title>IANA Named Information Hash Algorithm Registry</title>
        <author initials='N.' surname='Williams' fullname='Nicolas Williams'>
            <organization>IANA</organization>
        </author>
        <date year='2010'/>
    </front>
</reference>
</references>
<references title="Informative References">
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5802.xml"?>
<reference anchor='XEP-ISR-SASL2' target='http://geekplace.eu/xeps/xep-isr-sasl2/xep-isr-sasl2.html'>
    <front>
        <title>XEP-XXXX: Instant Stream Resumption</title>
        <author initials='F.' surname='Schmaus' fullname='Florian Schmaus'>
        </author>
        <date year='2017'/>
    </front>
</reference>
</references>

<section anchor="acknowledgments" title="Acknowledgments">
<t>Thanks to Thijs Alkemade.
</t>
</section>

</back>
</rfc>
