<?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">
<!ENTITY RFC5869 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5869.xml">
<!ENTITY RFC2548 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2548.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-eap-edhoc-01">
    <!-- 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-eap-edhoc-01">EAP method based on 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-Carrillo">
            <organization>University of Oviedo</organization><!-- TODO: Review -->
            <address>
                <postal>
                    <street>Campus de Gijon, S/N, Escuela Politecnica de Ingenieria de Gijon </street>
                    <!-- Reorder these if your country does things differently -->
                    <city>Gijon</city>
                    <region>Asturias</region>
                    <code>33203</code>
                    <country>Spain</country>
                </postal>
                <!--
                    <phone>+34 868 88 78 82</phone>
                -->
                <email>garciadan@uniovi.es</email>
                <!-- uri and facsimile elements may also be added -->
            </address>
        </author>

        <author fullname="Rafael Marin-Lopez" initials="R." surname="Marin-Lopez">
            <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="November" 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>EMU Working Group</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 of an EAP method based on the EDHOC authentication protocol.
            </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 to provide 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.  Provides authentication and key material generation, which are basic pillars to the design of an EAP method. And indeed the most important thing is that it is lightweight and designed for IoT. In addition, the EDHOC implementation that exists on the device can be reused to establish OSCORE Security Associations (SAs) for the authentication process.
                
                  
                EAP is a protocol that allows to implement different authentication mechanims, provides a framework for key management and has integration with AAA infrastructures. 
                  
                For these reasons, this new EAP method will allow the different applications and use cases to take advantage of EAP. 
                
                

            </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="Protocol Overview">
            <section title="The EAP-EDHOC Conversation">
                <t><!-- EDU: New -->
                The exchange of messages befalls between two entities that EDHOC identifies as Initiator (I) and Responder (R). In this EAP method, we establish equivalence with those terms. On the one hand, EAP peer acts as Initiator while EAP Server takes on the role of Responder.
                </t>  
                <t><!-- EDU: Modified -->
                The EAP-EDHOC conversation typically starts with the negotiation of EAP by the EAP authenticator and the EAP peer. The EAP authenticator sends an EAP-Request/Identity packet to the EAP peer, to which the EAP peer answers with an EAP-Response/Identity. This last messages contains the peer's user-Id.
                </t>             

                <t>             

                From this point on, the authenticator MAY act as a forwarder of the EAP messages between the EAP peer and the server, if the pass-through mode is used, receiving the EAP packets from the peer, encapsulating them for transmission to the EAP server that will act as Authentication Server (AS).
                </t>
                <t>         

                Once the EAP server receives the peer's Identity, it MUST respond with an empty EAP-EDHOC/Start message, which is an EAP-Request packet with EAP-Type=EAP-EDHOC and no data. Initiator must initiate the EDHOC conversation. Hence, EAP Server sends this message to indicate that it can start the authentication process.
                
                
                The EAP-EDHOC conversation will then begin, with the peer sending an EAP-Response packet with EAP-Type=EAP-EDHOC.  The data field of that packet will encapsulate the "EDHOC Message 1".
                </t>             
                <t>             

                
                The EAP server will then respond with an EAP-Request packet with
                EAP-Type=EAP-EDHOC.  The data field of this packet will encapsulate "EDHOC Message 2" message. To this message, the EAP peer will send the and EAP-Response message containing the "EDHOC Message 3" message.
                </t>             
                <t>             

                In the case where the EDHOC mutual authentication is successful, the conversation will appear as follows:
              </t>
               <t>
                <figure align="center" anchor="summ_edhoc_exchange" title="Overview EDHOC exchange">
                  <!-- maximum wide of the figure                                   -->
                  <artwork align="left"><![CDATA[
      +--------+                                               +-------+
      |   EAP  |                                               |  EAP  |
      |  Peer  |                                               | AuthN |
      +--------+                                               +-------+
        |                           EAP-Request/Identity        |
        | <---------------------------------------------------+ |
        |                                                       |
        |   EAP-Response/Identity (ID)                          |
        | +---------------------------------------------------> |
        |                                      EAP-Request/     |
        |                                EAP-Type=EAP-EDHOC     |
        |                                     (EDHOC Start)     |
        | <---------------------------------------------------+ |
        |   EAP-Response/                                       |
        |   EAP-Type=EAP-EDHOC                                  |
        |   (EDHOC message 1)                                   |
        | +---------------------------------------------------> |
        |                                      EAP-Request/     |
        |                                EAP-Type=EAP-EDHOC     |
        |                                 (EDHOC message 2)     |
        | <---------------------------------------------------+ |
        |   EAP-Response/                                       |
        |   EAP-Type=EAP-EDHOC                                  |
        |   (EDHOC message 3)                                   |
        | +---------------------------------------------------> |
        |                                                       |
        |                                        EAP-Success    |
        | <---------------------------------------------------+ |
        +                                                       +

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

            <section title="Transport and Message Correlation">
                <t>
                One of the defining characteristics of EAP is its lock-step procedure. The EAP protocol manages the exchange of messages guaranteeing the order of transmission. In the same way, it manages retransmissions and the detection of duplicate messages. Therefore, EAP ensures the message correlation mechanism in the different EAP layers.
                </t>    
                <t>
                Given the above, EDHOC does not need to use its internal mechanism for correlating messages. Then, the value for METHOD_CORR variable must satisfy the formula:          
                </t>             
                <t>             
                METHOD_CORR = 4 * method + corr
                </t>
                <t>             
                Where:
                </t>     
                <t>             
                method = EDHOC Method Type defined in Section 8.2 of EDHOC <xref target="I-D.selander-lake-edhoc"></xref><!-- EDU: Maybe I shouldn't repeat the reference -->
                </t>     
                <t>             
                corr = 
                </t>

            </section>

              <section title="Identity">
               <t>
              It is RECOMMENDED to use  NAIs in the Identity Response as identities.
              </t>
              </section>
                

            </section>
        </section>

            
        <section title="Identity Verification">
            <t>             
            The identity provided in the EAP-Response/Identity is not
              authenticated by EAP-EDHOC, hence SHALL NOT be
              used for authorization or accounting purposes.  The
              authenticator and the EAP server MAY examine the identity presented
              in EAP-Response/Identity for routing and EAP method
              selection.
            </t>
        </section>


        
      <section title="Key Hierarchy">
        <t>             
        
          EDHOC uses HKDF <xref target="RFC5869">RFC 5869</xref> to derive keys.  HKDF-Extract is used for deriving fixed-length uniformly pseudorandom keys (PRK) from ECDH shared secrets.  HKDF-Expand is used for deriving additional output keying material (OKM) from the PRKs.  
        </t>             
        <t>             
          The derivation proceeds as follows:
          </t>             
          <t>             
          PRK = HKDF-Extract( salt, IKM )
          </t>             
          <t>             
          Where:
          </t>             
          <t>             
          HKDF-Extract = RFC5869 HKDF function
          </t>             
          <t>             
          salt  = The empty byte string
          </t>             
          <t>             
          IKM (input keying material) = The ECDH shared secret
          </t>             
          <t>             
          <xref target="eap_edhoc_key"></xref> illustrates the EDHOC Key Hierarchy.  
          </t>             
          <t>             
          In EAP-EDHOC, the MSK, EMSK, and Initialization Vector (IV) are derived
          from the PRK via a hash function.  This ensures that
          the EDHOC PRK cannot be derived from the MSK, EMSK, or IV
          unless the hash function is defeated.  Since the MSK and
          EMSK are derived from the EDHOC PRK, if the EDHOC PRK
          is compromised then the MSK and EMSK are also compromised. 
          </t>             
          <t>             
          EAP-EDHOC derives exported keying material and parameters as follows:
          </t>             
          <t>             
          Type-Code    = 0XFF
          </t>             
          <t>             
          Key_Material = HKDF-Expand(EDHOC PRK, "EAP-EDHOC encryption", 128)
          </t>             
          <t>             
          MSK          = Key_Material(0,63)
          </t>             
          <t>             
          EMSK         = Key_Material(64,127)
          </t>             
          <t>             
          IV           = HKDF-Expand(EDHOC PRK, "EAP-EDHOC IV", 64)
          </t>             
          <t>             
          Session-Id   = Type-Code || Method-Id
          </t>             
          <t>             
          Method-Id    = HKDF-Expand(EDHOC PRK, "EAP_EDHOC_Method-Id", 64)
          </t>
          <t>
          Where:
          </t>

          <t>
          Key_Material(S,F) = Octets S through F inclusive of the key material.
          </t>             
                  
        <t>
         <figure align="center" anchor="eap_edhoc_key" title="EAP-EDHOC Key derivation">
          <!-- maximum wide of the figure                                   -->
          <artwork align="left"><![CDATA[

                                  | PRK                
                                  V                    
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                        MSK, EMSK                        |
      |               label == "EAP-EDHOC encryption"           |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |                           |                      | 
        | MSK(0,63)                 | EMSK(0,63)           | IV (0,63)
        |                           |                      |
        |                           |                      |
        V                           V                      V

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

    
<section title="IANA considerations">
  <t>             
  TBD.
  </t>
</section>

  
<section title="Security Considerations">
  <t>             
  TBD.

  </t>
</section>

  

<section title="Acknowledgements">
    <t>             
      This work is possible due the EU Project IoTCrawlwer under grant agreement n.779852 and 
      the EU Project INSPIRE-5Gplus under grant agreement n.871808
    </t>
</section>

        
    </middle>
    
    <back>
        <references title="Normative References">
            &RFC2119;
            &RFC5869;
            &RFC2548;
            &I-D.selander-lake-edhoc;
            
        </references>
         </back>
</rfc>
