<?xml version="1.0" encoding="utf-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.3.8 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY I-D.ietf-ace-oauth-authz SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-ace-oauth-authz.xml">
<!ENTITY I-D.ietf-ace-oscore-profile SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-ace-oscore-profile.xml">
<!ENTITY RFC8613 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8613.xml">
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC8174 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC6749 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6749.xml">
]>

<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc tocdepth="2"?>

<rfc ipr="trust200902" docName="draft-palombini-ace-oscore-profile-id-00" category="std">

  <front>
    <title abbrev="Id Negotiation for OSCORE Profile">Identifier Negotiation for the OSCORE Profile of ACE</title>

    <author initials="F." surname="Palombini" fullname="Francesca Palombini">
      <organization>Ericsson AB</organization>
      <address>
        <postal>
          <street>Torshamnsgatan 23</street>
          <city>Kista</city>
          <code>SE-16440 Stockholm</code>
          <country>Sweden</country>
        </postal>
        <email>francesca.palombini@ericsson.com</email>
      </address>
    </author>

    <date year="2020" month="September" day="21"/>

    
    <workgroup>ACE Working Group</workgroup>
    

    <abstract>


<t>This document defines a mechanism to negotiate OSCORE security material identifiers for the OSCORE profile of ACE.</t>



    </abstract>


  </front>

  <middle>


<section anchor="intro" title="Introduction">

<t>In the OSCORE profile, the client and resource server receive the OSCORE Sender and Recipient Identifiers from the AS. This has some limitations, especially if the OSCORE profile is used in conjuction with other mechamisms that also derive identifiers, in which case either collisions would happen, or longer identifiers need to be used as a result. This document describes a way to negotiate the identifiers so that collisions does not happen even if other authentication mechanisms are used.</t>

<section anchor="terminology" title="Terminology">

<t>The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>

<t>Readers are expected to be familiar with the terms and concepts described in  <xref target="I-D.ietf-ace-oauth-authz"/> <xref target="I-D.ietf-ace-oscore-profile"/>, such as Authorization Server (AS) and Resource Server (RS).</t>

<t>Readers are expected to be familiar with the terms and concepts described in <xref target="RFC8613"/>, especially on the use of Sender, Recipient and Context Identifiers.</t>

</section>
</section>
<section anchor="background" title="Background">

<t>TODO: introduce OSCORE Sender and Recipient Identifiers and how they are used in OSCORE.</t>

<t>The OSCORE profile specifies that the AS assigns and sends the OSCORE Sender and Recipient Identifiers to both Client and RS, together with the rest of the input material to derive the complete OSCORE Security Context. That is done by including these identifiers in the Access Token and Access Information response to the Client. The access token containing these identifiers is also forwarded to the RS by the Client.</t>

<figure title="OSCORE Profile Overview" anchor="fig1"><artwork align="center"><![CDATA[
   C                            RS                   AS
   |                            |                     |
   | ----- POST /token  ----------------------------> |
   |                            |                     |
   | <---------------------------- Access Token ----- |
   |                           + Access Information   |
   | ---- POST /authz-info ---> |                     |
   |     (access_token, N1)     |                     |
   |                            |                     |
   | <--- 2.01 Created (N2) --- |                     |
   |                            |                     |
 /Sec Context             /Sec Context                |
   Derivation/              Derivation/               |
   |                            |                     |
   | ---- OSCORE Request -----> |                     |
   |                            |                     |
   |                    /proof-of-possession          |
   |                    Sec Context storage/          |
   |                            |                     |
   | <--- OSCORE Response ----- |                     |
   |                            |                     |
/proof-of-possession            |                     |
Sec Context storage/            |                     |
   |                            |                     |
   | ---- OSCORE Request -----> |                     |
   |           ...              |                     |
]]></artwork></figure>

<t>This works with a number of requirements: the OSCORE profile states that 
<!-- a resource is associated to one single AS, which makes it possible for the AS to enforce uniqueness of identifiers for each client requesting a particular resource to a RS.  If this is not the case, collisions of identifiers may occur at the RS, in which case the RS needs to have a mechanism in place to disambiguate identifiers or mitigate the effect of the collisions. -->
if other authentication mechanisms are used to set up OSCORE between the same client and RS, that do not rely on an AS assigning identifiers, collisions may happen and need to be mitigated.
Such mitigation mechanism also need to be used if a different AS (not sinchronized with the first AS) or authentication protocol is used to set up OSCORE between the same RS and other clients. A mitigation example would be to use distinct namespaces of context identifiers for different authentication mechanisms or authentication servers. Another solution would be to use longer random identifiers. A third possible solution, acceptable if collisions are not expected to be numerous, would be to rely on trial and error of security contexts when receiving a message.</t>

<t>These solutions have the drawback of requiring longer identifiers to be used in general, which leads to larger message sizes, or additional processing on the RS.</t>

<t>This document specifies a different mechanism to assign identifiers that works on top of the current OSCORE profile, and that allows to set up identifiers without collisions, even when other authentication mechanisms or non-syncrhonized AS are used.</t>

</section>
<section anchor="identifiers-negotiation" title="Identifiers Negotiation">

<t>This section details the message exchange.</t>

<section anchor="c-to-as" title="C-to-AS:">

</section>
<section anchor="c-to-rs-post-to-authz-info-endpoint" title="C-to-RS: POST to authz-info endpoint">

<t>The client generates its own Recipient Id for the OSCORE Security Context that it is establishing with the RS. By generating its own Recipient Id, the client makes sure that it does not collide with any other Recipient Identifiers stored in memory. The client posts it together with what is described in Section 4.1 of <xref target="I-D.ietf-ace-oscore-profile"/>. The Client includes the Recipient Id in the POST to authz-info request, as a ace_client_recipientid parameter, as registered in <xref target="iana-oauth"/> and <xref target="iana-oauth-map"/>.</t>

<t>When receiving the POST to authz-info request including the ace_client_recipientid parameter, the RS MUST set its own Sender Identifier to the value of the ace_client_recipientid and discard any ServerId present in the access token.</t>

</section>
<section anchor="rs-to-c-201-created" title="RS-to-C: 2.01 (Created)">

<t>The RS generates its own Recipient Id for the OSCORE Security Context that it is establishing with the client. The Recipient Id MUST be different than the ace_client_recipientid received from the client. By generating its own Recipient Id, the RS makes sure that it does not collide with any other Recipient Identifiers stored in memory. The RS sends it to the Client together with what is described in Section 4.2 of <xref target="I-D.ietf-ace-oscore-profile"/>. The RS includes the Recipient Id in the 2.01 (Created) response, as a ace_server_recipientid parameeter, as registered in <xref target="iana-oauth"/> and <xref target="iana-oauth-map"/>.</t>

<t>When receiving the response including the ace_server_recipientid parameter, the Client MUST set its own Sender Identifier to the value of the ace_server_recipientid and discard any ClientId present in the access token.</t>

</section>
<section anchor="not-supported" title="Not Supported">

<t>If the RS does not support this specification, and the client sends its Recipient Id in the ace_client_recipientid, the server will not recognize the parameter and either respond with an error response or discard the parameter.</t>

<t>If the RS replies with an error response or if the RS replies with a 2.01 (Created) not including the ace_server_recipientid parameter the Client MUST assume the server uses the identifiers in the token and do the same.</t>

<t>TODO: so it is possible for anybody in the middle to revert back to OSCORE profile, without this addition, and therefore create collisions without identifiers.</t>

</section>
</section>
<section anchor="sec-cons" title="Security Considerations">

<t>TODO</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<t>This document has the following actions for IANA.</t>

<section anchor="iana-oauth" title="OAuth Parameters Registry">

<t>The following registrations are done for the OAuth ParametersRegistry following the procedure specified in section 11.2 of <xref target="RFC6749"/>:</t>

<t>o  Parameter name: ace_client_recipientid
   o  Parameter usage location: client-rs request
   o  Change Controller: IESG
   o  Specification Document(s): [[This specification]]</t>

<t>o  Parameter name: ace_server_recipientid
   o  Parameter usage location: rs-client response
   o  Change Controller: IESG
   o  Specification Document(s): [[This specification]]</t>

</section>
<section anchor="iana-oauth-map" title="OAuth Parameters CBOR Mappings Registry">

<t>The following registrations are done for the OAuth Parameters CBOR
   Mappings Registry following the procedure specified in section 8.9 of
   <xref target="I-D.ietf-ace-oauth-authz"></xref>:</t>

<figure><artwork><![CDATA[
* Name: ace_client_recipientid
* CBOR Key: TBD (range -256 to 255)
* Value Type: byte string
* Reference: \[\[This specification\]\]

* Name: ace_server_recipientid
* CBOR Key: TBD (range -256 to 255)
* Value Type: byte string
* Reference: \[\[This specification\]\]
]]></artwork></figure>

</section>
</section>
<section numbered="no" anchor="acknowledgments" title="Acknowledgments">

<t>This document was started from comments and discussion with the following individuals: John Mattsson, Jim Schaad, Göran Selander.</t>

</section>


  </middle>

  <back>

    <references title='Normative References'>

&I-D.ietf-ace-oauth-authz;
&I-D.ietf-ace-oscore-profile;
&RFC8613;
&RFC2119;
&RFC8174;
&RFC6749;


    </references>




  </back>

<!-- ##markdown-source:
H4sIAOasaF8AA71abXPbNhL+zl+Bs7/Yd6Jiu2naaNrOKbLbuk2snORc56bp
dCASknAmCR4ARlFS38+6P3B/7J4FQIqU5Zc0zXEyCUUCu4vdZ1+ZOI4jK20m
Buw8FYWVcyk0uxALZSW3UhVsrjSzS8HG09F4csZeajWXmWBqzoajs4jPZlq8
oc03NnU3RKlKCp6DT6r53MYlz1Q+k4WMeSJiZRKlRVz6tbFM46OjKJKlHjCr
K2NPjo6eHp1Eq8WAuLKflL6SxYJ9p1VVRgm3A2ZsGkWJSvF4wCo7j7+MSjmI
GLMqGbC1MLg1Slst5qb5vc7bP7EyFaVdDthJFPHKLpUmAnTF4V/GZIH13/bZ
y1r+5o0/3beaF4kwCd+xQmnIdqZlYgx0NHzWvDAQS+AQl0qbJc8Ls+CWF+zk
s2ZFIu16wH6UxvLNM5WC4fQsPn7y+PERm0L+q6XK8taCqrAa+6YrAeM2z0XO
ZTZg81rUfmOMv4ogXT9ReRQVSucw6BsxiLD5PD7tSwHVOouRgmL6693gxruO
Nen15NvRl0+OPwu3J8fHT+unx188DrdPvniMp5Es5m2uURTHMeMzqIgnNoou
l9IwYKnKgVaWirkshGGc5SJZ8kKaHGZkRYBig1ojkkpDhQyEcUSeMdmg3WxD
vOxAvO8lyGWaAsXRPjuHTlVaJQ7o7/cl/byOovNiB42ee5ZkkoT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