<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
 which is available here: http://xml.resource.org. -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
There has to be one entity for each item to be referenced.
An alternate method (rfc include) is described in the references. -->


<!--
Example of a reference of a RFC document

<!ENTITY RFCXXXX SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.XXXX.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
-->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">


<!--
Example of a reference of a draft document

<!ENTITY I-D.bhattacharyya-dice-less-on-coap SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.draft-bhattacharyya-dice-less-on-coap-00.xml">
-->

<!ENTITY I-D.selander-lake-edhoc SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.draft-selander-lake-edhoc-01.xml">

]>

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs),
 please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
 (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
 (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->

<!-- Note: add the name of the draft-->

<rfc ipr="trust200902" category="exp" docName="draft-ingles-radex-radius-edhoc-00">
    <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN"
     they will automatically be output with "(if approved)" -->
    
    <!-- ***** FRONT MATTER ***** -->
    
    <front>
        <!-- The abbreviated title is used in the page header - it is only necessary if the
         full title is longer than 39 characters -->
        
        <title abbrev="draft-ingles-radex-radius-edhoc-00">AAA-based assisted EDHOC Authentication</title>
        
        <!-- add 'role="editor"' below for the editors if appropriate -->
        <!-- Another author who claims to be an editor -->        



        <author fullname="Eduardo Ingles Sanchez" initials="E." surname="Ingles">
            <organization>University of Murcia</organization>
            <address>
                <postal>
                    <street>Campus de Espinardo S/N, Faculty of Computer Science</street>
                    <!-- Reorder these if your country does things differently -->
                    <city>Murcia</city>
                    <region></region>
                    <code>30100</code>
                    <country>Spain</country>
                </postal>                
                <email>eduardo.ingles@um.es</email>
                <!-- uri and facsimile elements may also be added -->
            </address>
        </author>

        <author fullname="Dan Garcia Carrillo" initials="D." surname="Garcia">
            <organization>Odin Solutions S.L.</organization>
            <address>
                <postal>
                    <street>Poligono Industrial Oeste, C/ Peru, 5</street>
                    <!-- Reorder these if your country does things differently -->
                    <city>Alcantarilla</city>
                    <region>Murcia</region>
                    <code>30820</code>
                    <country>Spain</country>
                </postal>
                <!--
                    <phone>+34 868 88 78 82</phone>
                -->
                <email>dgarcia@odins.es</email>
                <!-- uri and facsimile elements may also be added -->
            </address>
        </author>

        <author fullname="Rafael Marin-Lopez" initials="R." surname="Marin">
            <organization>University of Murcia</organization>
            <address>
                <postal>
                    <street>Campus de Espinardo S/N, Faculty of Computer Science</street>
                    <!-- Reorder these if your country does things differently -->
                    <city>Murcia</city>
                    <region></region>
                    <code>30100</code>
                    <country>Spain</country>
                </postal>
                <phone>+34 868 88 85 01</phone>
                <email>rafa@um.es</email>
                <!-- uri and facsimile elements may also be added -->
            </address>
        </author>
        <!-- 
            Put the current Date
        -->        
        <date month="August" year="2020" />
        
        <!-- If the month and year are both specified and are the current ones, xml2rfc will fill
         in the current day for you. If only the current year is specified, xml2rfc will fill
         in the current day and month for you. If the year is not the current one, it is
         necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the
         purpose of calculating the expiry date).  With drafts it is normally sufficient to
         specify just the year. -->
        
        <!-- Meta-data Declarations -->
        
        <area>General</area>
        
        <workgroup></workgroup>
        
        <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.
         If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->
        
        <keyword>template</keyword>
        
        <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->
        
        <abstract>
            <t>
                  This document describes a proposal to place EDHOC server in an external Authentication, Authorization and Accounting (AAA) server. The purpose is to centralize the EDHOC authentication in AAA infrastructure.
            </t>
        </abstract>
    </front>
    
    <middle>
        <section title="Introduction">
            <t> 
                EDHOC <xref target="I-D.selander-lake-edhoc"></xref>  is a new protocol for autentication and key derivation that has been proposed as an alternative in IoT mainly due to two main characteristics, namely, it works on top of any reliable transport, which means it can be carried over a protocol such as CoAP and provides a secure exchange in an end-to-end fashion.  This key material can be futher used to run other protocols such as OSCORE, as well as providing key material to any other protocol that needs pre-shared key material to secure the communications.  EDHOC has another characteristic that makes it an interesting alternative that is work underlining, it is designed to be lightweight, for which is build using COSE, reducing the overhead of the protocol.  The proposal of this protocol coalesces with the advancement of the new set of technologies known as LPWAN, which generally have high constrains in the link, even more than traditional IoT networks.  Furthermore, these technologies generally lack in measurements for refreshing the key material that is used to protect the communications, for which methods to provide them with bootstrapping and key management  capabilities has been subject of reseach, as well as extending the protocols provided to perform the joining of the devices into the network. In this work we propose an architecture to allow the EDHOC authentication being carried out with the assistance of a AAA infraestructure. The motivation is to centralize not only authentication but also authorization and accounting of a joining IoT node to a particular domain.

            </t>

                <section title="Requirements Language">
                <t>
                    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
                    "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
                    document are to be interpreted as described in <xref target="RFC2119">RFC 2119</xref>.
                </t>
            </section>
        </section>

       <section title="EDHOC support in AAA">
           <t>             
          Regarding the overall functionality, AAA support for EDHOC will take care of adapting AAA protocols, such as RADIUS or Diameter, to add the support for EDHOC. An example of this could be with RADIUS.  In this instance, RADIUS support for EDHOC will define the new Attributes needed to manage the protocol.
           
          The EDHOC server implements the RADIUS client supporting this specification and therefore, it MUST implement the RADIUS attributes for this service.

          The NAS-Port-Type specifying the type of port on which the EDHOC
          Server is authenticating the End-Device will be set according to the
          technology used.  For example, if we use LoRaWAN <xref target="LoRaWAN"></xref> we MAY set it to 18 (Wireless - Other) or a new one specifically assigned for
            LoRaWAN (TBD.).
            
            Similarly, the adaptation could be done for Diameter. 
            
           </t>
        </section>

        <section title="EDHOC Overview">            
            <section title="Introduction">
                <t>             
                    EDHOC is a lightweight authenticated key exchange protocol that enables to establish a cryptographic key between two entities. To this end, EDHOC implements the Elliptic Curve Diffie-Hellman algorithm with ephemeral keys (ECDHE), by which both entities must generate a new ephemeral key pair every time they launch this protocol. Therefore, EDHOC also provides the perfect forward secrecy property. Additionally, EDHOC supports the same authentication modes as DTLS (i.e., PSK, RPK, and certificates). Hence, the {key generation} process remains independent concerning the selected authentication mode.  The EDHOC protocol defines a three-message exchange. These messages are encoded following the CBOR representation and are protected using COSE standard. This way, the minimum message size is assured in contrast to other JSON-based representation formats (such as JWS and JWE), therefore, reducing the overhead on the network.

 
                    EDHOC protects specific fields selectively using COSE objects, ensuring end-to-end security, while intermediate entities can access the information required to carry out their functionality. 

              </t>
            </section>
           <section title="EDHOC protocol overview">
               <t>             
                    The EDHOC specification defines an exchange of three messages. 
                    The exact message content differs depending, if the authentication method used is PSK, or of RPK or Certificates. 

                    The EDHOC client starts the exchange sending the first message that includes the ephimeral public key of the client. When this message arrives to the EDHOC server, it generates it own ephemeral key pair and sends its public key to the client in the second message. The client, then finishes the EDHOC exchange sending the third message.
                </t>
                <t>
                    <figure align="center" anchor="summ_edhoc_exchange" title="Overview EDHOC exchange">
                      <!-- maximum wide of the figure                                   -->
                        <artwork align="left"><![CDATA[
+--------+                                               +-------+
| EDHOC  |                                               | EDHOC |
| Server |                                               | Server|
+--------+                                               +-------+
    |                                                       |
    | +------------------ EDHOC MSG 1 --------------------> |
    |                                                       |
    | <------------------ EDHOC MSG 2 --------------------+ |
    |                                                       |
    | +------------------ EDHOC MSG 3 --------------------> |
    |                                                       |
    | <----------+ Application Protected Data +-----------> |
    +                                                       +

                        ]]></artwork>
                    </figure>                        
                </t>
                <t>

                  Each message of the EDHOC protocol is defined as a COSE object with specific content depending on the message and the mode of authentication, as specified in the document. 

               </t>
            </section>
            
           <section title="EDHOC key derivation">
               <t>             
                  When the first message is received by the EDHOC server, it generates its own ephemeral key pair and is able to compute the Secret, called  pseudorandom keys (PRK), as follows: 
               </t>
               <t>             
                    PRK = HKDF-Extract( salt, IKM )
      
               </t>
               <t>
                  Upon receiving the last exchange both entites have a shared secret key that is derived using a HDKF the input keying material (IKM): Secret, Salt, Context and Key Length. The derivation is done in a different way depending on the method used for authentication. 
                  
                   <list style="symbols">
                        <t>
                          The Secret is the same, since it is the result of the Ephemeral Diffie-Hellman exchange as specified above. The Context.
                        </t>
                        <t> 
                          In case the it is done using PSK, the Salt is the PSK value, otherwise the field is not used. 
                        </t>
                        <t> 
                          The context is the COSE_KDF_CONTEXT defined in the protocol
                        </t>
                        <t>
                          The key length is the lenght of the derived shared symetric key that has to be at least 128-bits long. 
                        </t>
                  </list>
                  
               </t>
               <t>             
                According to the last version of the draft, there is a key derivation hierarchy by which a Pseudorandom Key (PRK) is derived from  the ECDH shared
   secrets, and from the RPK additional key material called output keying material (OKM) can be also derived. 
               </t>
            </section>
        </section>

       <section title="Integration Overview">
            <section title="Mapping EDHOC entities to AAA infrastructure">
                <t>             
                  In the current specification of EDHOC, there is no explicit reference to an external entity to which the EDHOC Server can degate the authentication. In this sense, we propose to add the support for RADIUS to provide such delegation 
              </t>
            </section>
            <section title="Assumptions">
                <t>             
                  For the integration of EDHOC with RADIUS next we describe some assumptions.  The first is that the credentials that are used for authenticating the devices are only shared (in the case of PSK) between the AAA server and the EDHOC client.  The outcome of the successful authentication (i.e. PRK) is sent from the AAA server to the EDHOC server.  This allows for the EDHOC client to exchange messages with the EDHOC server, once the protocol is finished.
              </t>
            </section>
            <section title="Protocol Exchange">
                <t>             
                  The join procedure between the client and the server consists if three messages.  In RADIUS the EDHOC server implements a RADIUS client to communicate with the AAA server. 
                </t>

                <t>
                    The protocol exchange is done in the following steps:
  
                    <list style="numbers">
                       <t> 
                          The client sends the first message to the EDHOC server.
                       </t>
                       <t> 
                          Upon reception of this message, the EDHOC server creates a RADIUS Access-Request message, with the EDHOC-message attribute containing all the fields of the first message of EDHOC. 
                       </t>
                       <t> 
                         Once the AAA server receives this message, performs the processing of said message as the EDHOC server would in the specification, generating in turn the message 2 and sendig it in a new RADIUS Attribute EDHOC-message, embedded in an Access-Challenge. 
                       </t>
                       <t> 
                         The EDHOC client, then processes the message and generates the third EDHOC message. 
                       </t>
                       <t> 
                         The AAA server, receives the third EDHOC message and processes it, deriving the PRK and generating and Access-Accept for the EDHOC server that contains the key in an EDHOC-key attribute. 
                       </t>
              
                    </list>
                </t>
                <t>
                    <figure align="center" anchor="protocol-overview" title="EDHOC-AAA exchange">
                      <!-- maximum wide of the figure                                   -->
                        <artwork align="left"><![CDATA[

+------------+       +-----------+        +-----------+
|     AAA    |       |  EDHOC    |        |    AAA    |
|   Client   |       |  Server   |        |  Server   |
+------+-----+       +-----+-----+        +-----+-----+
       |    EDHOC MSG 1    |  Access-Request    |
       +------------------>+  EDHOC-message Att |
       |                   +------------------->+
       |                   |                    |
       |                   |  Access-Challenge  |
       |                   |  EDHOC-message Att |
       |   EDHOC MSG 2     +<-------------------+
       +<------------------+                    |
       |                   |                    |
       |  EDHOC MSG 3      |  Access-Request    |
       +------------------>+  EDHOC-message Att |
       |                   +------------------->+
       |                   |                    |
       |                   |   Access-Accept    |
       |                   |   EDHOC-key(PRK)   |
       +                   +<-------------------+
                        ]]></artwork>
                    </figure>                        
                </t>

            </section>

    <section title="EDHOC-message Attribute">
                    <t>Description</t>
                    <t> This Attribute contains the original EDHOC messages. This attribute will appear in the Access-Request and Access-Challenge messages.
                    A summary of the EDHOC-message attribute format is shown below.  The fields are transmitted from left to right.
                    </t>
                    <t>
 <figure align="center">
<!-- maximum wide of the figure                                   -->
<artwork align="left"><![CDATA[                        
0                   1                   2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |    Length     |     String...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

TBD. for EDHOC-message

Length

>= 3

String
      
The String field contains an EDHOC message.

]]></artwork>
</figure> 

The String field contains an octet string with the Join-Request message as received over the network, such as defined in <xref target="LoRaWAN"/>.
                        
                    </t>
                </section>

                <section title="EDHOC-key attribute">
                    <t>Description</t>
                    <t> This Attribute contains the EDHOC PRK, a shared secret key specific for the EDHOC client. This attribute only appears in the RADIUS Access-Accept message. A summary of the EDHOC-key attribute format is shown below.  The fields are transmitted from left to right.
                        
 <figure align="center">
<!-- maximum wide of the figure                                   -->
<artwork align="left"><![CDATA[                        
0                   1                   2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |    Length     |     String...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

TBD. for EDHOC-key

Length

>= 16

String
The String field contains an EDHOC shared symmetric key.


]]></artwork>
</figure> 
                        
              
          </t>
      </section>
      <section title="Table of Attribute">
          <t>
            <figure align="center" anchor="table-attributes" title="Attributes Table">
<!-- maximum wide of the figure                                   -->
<artwork align="left"><![CDATA[                                
Request  Accept  Reject  Challenge   #    Attribute
  1       0       0        1       TBD.   EDHOC-message
  0       1       0        0       TBD.   EDHOC-key
Request  Accept  Reject  Challenge   #    Attribute
]]></artwork>
</figure>
          </t>
      </section>

        </section>

 

       <section title="Open Issues">
           <t>             
              A specification can be considered about the way credentials are identified in EDHOC to support federation. According to the EDHOC draft, the credentials are identified by each communication endpoing by a 'kid'. We propose that this value will contain a network access identifier, that will be used to retreive the credentials in both the symmetric asymmetric keys. 
              
              This value is extracted, it is passed to a textual form to include it in an AAA attribute (e.g. User-Name in RADIUS) to be routed to the appropiate server. 

           </t>
        </section>

       <section title="Security Considerations">
           <t>             
              The security considerations of this proposal inherit the same security considerations of EDHOC. 

              TBD.
           </t>
        </section>

       <section title="Acknowledgements">
           <t>             
              This work is possible due the EU Project IoTCrawlwer under grant agreement n. 779852 and to the pre-doctoral grant Industrial PhD DI-16-08432 granted to ODIN Solutions S.L
           </t>
        </section>

       <section title="IANA Considerations">
          <t> 
            In this document we define 2 new RADIUS Attributes that would need actions from IANA to assign the corresponding numbers.

              <figure align="center">
<!-- maximum wide of the figure                                   -->
                <artwork align="left"><![CDATA[                        
+--------+---------------+----------------------------+
| Number |     Name      |          Reference         |
+------------------------+----------------------------+
|   TBD  | EDHOC-message | Section 4 of this document |
|   TBD  | EDHOC-key     | Section 4 of this document |
+--------+---------------+----------------------------+
                ]]></artwork>
              </figure>
            </t>
        </section>
        
    </middle>
    
    <back>
        <references title="Normative References">
            &RFC2119;
            &I-D.selander-lake-edhoc;
            
        </references>
       <references title="Informative References">
            <reference anchor="LoRaWAN" target="https://www.lora-alliance.org/portals/0/specs/LoRaWAN%20Specification%201R0.pdf">
                <front>
                    <title>LoRa Specification V1.0</title>
                    <author initials="N." surname="Sornin"></author>
                    <author initials="M." surname="Luis"></author>
                    <author initials="T." surname="Eirich"></author>
                    <author initials="T." surname="Kramp"></author>
                    <date month="January" year="2015" />
                </front>
            </reference>
        </references>
    </back>
</rfc>
