<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [

    <!-- Normative References -->
    <!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
    <!-- <!ENTITY rfc3986 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml'> -->
    <!-- <!ENTITY rfc4501 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4501.xml'> -->
    <!ENTITY rfc3748 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3748.xml'>
    <!ENTITY rfc4210 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4210.xml'>
    <!-- <!ENTITY rfc5019 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5019.xml'> -->
    <!-- <!ENTITY rfc5234 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5234.xml'> -->
    <!ENTITY rfc5272 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5272.xml'>
    <!ENTITY rfc5280 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5280.xml'>
    <!-- <!ENTITY rfc5280 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5280.xml'> -->
    <!ENTITY rfc6402 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6402.xml'>
    <!ENTITY rfc7030 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7030.xml'>
    <!-- <!ENTITY rfc7170 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7170.xml'> -->
    <!ENTITY rfc8126 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8126.xml'>
    <!ENTITY rfc8520 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8520.xml'>

    <!-- Informative References -->
    <!-- <!ENTITY ietf-acme-acme PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.I-D.ietf-acme-acme.xml'> -->
]>

<rfc category="std" docName="draft-pala-eap-creds-06" ipr="trust200902">
    
	<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

	<?rfc toc="yes" ?>
	<?rfc tocdepth="5"?>
	<?rfc symrefs="yes" ?>
	<?rfc sortrefs="yes"?>
	<?rfc iprnotified="no" ?>
	<?rfc strict="yes" ?>
	<?rfc compact="yes" ?>
	<?rfc subcompact="no" ?>

  <front>
	  <title abbrev="EAP-CREDS">Credentials Provisioning and Management via EAP (EAP-CREDS)</title>
	  <author initials="M.P." surname="Pala" fullname="Massimiliano Pala">
	    <organization>CableLabs</organization>
	    <address>
	      <postal>
	        <street>858 Coal Creek Cir</street>
	        <city>Louisville</city>
	        <region>CO</region>
	        <code>80027</code>
	        <country>US</country>
	      </postal>
	      <email>m.pala@openca.org</email>
	      <uri>http://www.linkedin.com/in/mpala</uri>
	    </address>
	  </author>
	 
	  <date month="June" year="2020" />
	  <area>Security</area>
	  <workgroup></workgroup>
	  <keyword>PKI</keyword>
	  <keyword>EAP</keyword>
	  <keyword>Provisioning</keyword>
	  <abstract>
	    <t>
	      With the increase number of devices, protocols, and applications that rely on strong credentials
	      (e.g., digital certificates, keys, or tokens) for network access, the need for
	      a standardized credentials provisioning and management framework is paramount.

	      The 802.1x architecture allows for entities (e.g., devices, applications, etc.) to authenticate to
	      the network by providing a communication channel where different methods can be used to
	      exchange different types of credentials.

	      However, the need for managing these credentials (i.e., provisioning and renewal) is still a
	      hard problem to solve.

				<vspace blankLines="1" />

				EAP-CREDS, if implemented in Managed Networks (e.g., Cable Modems), could
	      enable our operators to offer a registration and credentials management service
	      integrated in the home WiFi thus enabling visibility about registered devices.
	      During initialization, EAP-CREDS also allows for MUD files or URLs to
	      be transferred between the EAP Peer and the EAP Server, thus giving
	      detailed visibility about devices when they are provisioned with credentials
				for accessing the networks. The possibility provided by EAP-CREDS can help to
				secure home or business networks by leveraging the synergies of the security
				teams from the network operators thanks to the extended knowledge of what
				and how is registered/authenticated.

	      <vspace blankLines="1" />

	      This specifications define how to support the provisioning and management of authentication
	      credentials that can be exploited in different environments (e.g., Wired, WiFi, cellular, etc.)
	      to users and/or devices by using EAP together with standard provisioning protocols.
    	</t>
  	</abstract>
	</front>

	<middle>

	  <section title="Requirements notation">
		  <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"/>.
		  </t>
	  </section>

	  <section anchor="intro" title="Introduction"> 
	    <t>
	      Many environments are, today, moving towards requiring strong authentication when
	      it comes to gain access to networks. The 802.1x architecture provides network
	      administrators with the possibility to check credentials presented by a device
	      even before providing any connectivity or IP services to it.

	      <vspace blankLines="1" />

	      However, the provisioning and management of these credentials is a hard problem
	      to solve and many vendors opt for long-lived credentials that can not be easily
	      revoked, replaced, or simply renewed.

	      <vspace blankLines="1" />

	      This specification addresses the problem of providing a simple-to-use and
	      simple-to-deploy conduit for credentials management by extending the EAP
	      protocol to support credentials provisioning and management functionality.

	      In particular, the EAP-CREDS method defined here provides a generic framework
	      that can carry the messages for provisioning different types of credentials.
	      EAP-CREDS cannot be used as a stand-alone method, it is required that EAP-CREDS is used
	      as an inner method of EAP-TLS, EAP-TEAP, or any other tunnelling method that can provide
	      the required secrecy and (at minimum) server-side authentication to make sure
	      that the communication is protected and with the right server.
	    </t>

	    <section anchor="existing_solutions" title="Overview of existing solutions">
	      <t>
	        Currently there are many protocols that address credentials lifecycle management. In particular,
	        when it comes to digital certificates, some of the most deployed management protocols are: 
	        Certificate Management Protocol (CMP) <xref target="RFC4210" />, Certificate Management over CMS (CMC)
	        <xref target="RFC5272"/><xref target="RFC6402"/>, Enrollment over Secure Transport (EST)
	        <xref target="RFC7030"/>, and Automated Certificate Management Environment (ACME) <!-- <xref target="I-D.ietf-acme-acme"/> -->.

	        However, none of these protocols provide native support for client that do not have IP connectivity
	        yet (e.g., because they do not have network-access credentials, yet). EAP-CREDS
	        provides the possibility to use such protocols (i.e., message-based) by defining a series of
	        messages that can be used to encapsulate the provisioning messages for the selected
	        provisioning protocol.

	        <vspace blankLines="1" />

	        In addition to these protocols, EAP-CREDS also defines a series of simple
	        messages that provide a generic enrollment protocol that allows not only
	        certificates but also other types of credentials (e.g., username/password pairs,
	        tokens, or symmetric secrets) to be delivered to the client as part of the provisioning
	        and/or renewal process. The set of messages that make up the generic
	        provisioning protocol is referred to as the Simple Provisioning Protocol protocol or
	        SPP.
	      </t>
	    </section>

	    <section anchor="scope" title="Scope Statement">
	      <t>
	        This document focuses on the definition of the EAP-CREDS method to convey
	        credentials provisioning and managing messages between the client and the
	        AAA server. Moreover, the document defines how to encode messages for the
	        main IETF provisioning protocols.

	        <vspace blankLines="1" />

	        This document, however, does not provide specifications for how and where
	        the credentials are generated. In particular, the credentials could be
	        generated directly within the AAA server or at a different location (i.e., the
	        Certificate Service Provider or CSP) site. Different authentication
	        mechanisms (e.g., TLS, etc.) can be used to secure the communication
	        between the server's endpoint and the CSP.
	      </t>
	    </section>

	    <section anchor="tunnel" title="EAP-CREDS as tunneled mechanism only">
	      <t>
	        EAP-CREDS requires that an outer mechanism is in place between the Peer and
	        the Server in order to provide authentication and confidentiality of the
	        messages exchanged via EAP-CREDS. In other words, EAP-CREDS assumes that an
	        appropriatly encrypted and authenticated channel has been established to
	        prevent the possibility to leak information or to allow man-in-the-middle attacks.
	      </t>
	      <t>
	        This choice was taken to simplify the message flow between Peer and Server, and
	        to abstract EAP-CREDS from the secure-channel establishment mechanism. EAP-TLS,
	        or EAP-TEAP are examples of such mechanisms.s
	      </t>
	    </section>

	    <section anchor="frag" title="Fragmentation Support">
	      <t>
	        EAP does not directly support handling fragmented packets and it requires
	        the outer method to provide fragmentation support.
	      </t>
	      <t>
	        Because of the outer method requirements in particular, removing any
	        support for fragmented messages in EAP-CREDS removes the duplication
	        of packets (e.g., Acknowledgment Packets) sent across the Peer and
	        the Server, thus resulting in a smaller number of exchanged messages
	      </t>
	    </section>

	    <section anchor="teap_creds" title="Encapsulating Provisioning Protocols in EAP-CREDS">
	      <t>
	        In order to use EAP-CREDS together with your favorite provisioning protocol, the messages
	        from the provisioning protcol need to be sent to the other party. In EAP-CREDS, this is
	        done by encoding the provisioning protocol messages inside the ('Provisioning-Data') TLV.
	        In case the provisioning protocol uses additional data for its operations (e.g., uses
	        HTTP Headers), this data can be encoded in a separate ('Provisioning-Headers') TLV.
	      </t>
	      <t>
	        Since the implementation of the provisioning endpoint could happen in a (logically or
	        physically) different component, a method is needed to identify when a provisioning
	        protocol has actually ended. In EAP-CREDS, the 'D' bit in the message headers
	        is used for this purpose.
	      </t>
	      <t>
	        In the first message of Phase Two, the Server provides the client with all the selected
	        parameters for one specific credential that needs attention (or for a new credential)
	        to be managed by the network. In particular, the server provides, at minimum, the
	        ('Protocol') TLV, the ('Action') TLV, and the ('Provisioning-Params') or the 
	        ('Credentials-Info') TLV.
	      </t>
	      <t>
	        After checking the parameters sent by the Server, if the Peer does not support any of
	        the proposed ones, it MUST send a message with one single ('Error') TLV with the appropriate error
	        code(s). The server, can then decide if to manage a different set of credentials (if
	        more where reported by the Peer in its Phase One message) or if to terminate the EAP
	        session with an error.
	      </t>
	      <t>
	        The Peer and the Server exchange Provisioning messages until an error is detected (and the
	        appropriate error message is sent to the other party) or until Phase Two is successfully
	        completed.
	      </t>
	    </section>

	    <section anchor="eap_creds_hashing" title="Algorithm Requirements">
	      <t>
	          EAP-CREDS uses the SHA-256 hashing algorithm to verify credentials in phase three
	          of the protocol. Peers and Servers MUST support SHA-256 for this purpose.
	      </t>
	    </section>

	    <section anchor="notation" title="Notation" >
	      <t>
	          In this document we use the following notation in the diagrams to
	          provide information about the cardinality of the data structures (TLVs)
	          within EAP-CREDS messages:
	      </t>

	      <texttable anchor="eap_creds_notation" title="EAP-CREDS Notation">
	        <ttcol align="center">Symbol</ttcol>
	        <ttcol align="center">Example</ttcol>
	        <ttcol align="left">Usage</ttcol>

	        <c>{ }</c>
	        <c>{TLV1}</c>
	        <c>Curly Brackets are used to indicate a set</c>

	        <c>[ ]</c>
	        <c>{[TLV2]}</c>
	        <c>Square Brackets are used to indicate that a field is optional</c>

	        <c>( )</c>
	        <c>{TLV1(=V)}</c>
	        <c>Round Squares are used to specify a value</c>

	        <c> + </c>
	        <c>{TLV_2+}</c>
	        <c>The Plus character indicates that one or more instances are allowed</c>
	      </texttable>
	    </section>

  	</section> 

  	<!--                     -->
  	<!-- End of Introduction -->
  	<!--                     -->

	  <section title="EAP-CREDS Protocol">
	    <t>
	      In a nutshell, EAP-CREDS provides the abstraction layer on top of which credentials
	      provisioning/managing protocols can be deployed thus enabling their use even before
	      provisioning IP services.
	    </t>
	    <t>
	        This section outlines the operation of the protocol and message flows.
	        The format of the CREDS messages is given in <xref target="creds_msg" />.
	    </t>

	    <section title="Message Flow">
	      <t>
	          EAP-CREDS message flow is logically subdivided into three different
	          phases: Initialization, Provisioning, and Validation. EAP-CREDS
	          enforces the order of phases, i.e. it is not possible to move to an
	          earlier phase.
	      </t>
	      <t>
	          Phase transitioning is controlled by the Server. In particular, the
	          server, after the last message of a phase, it can decide to either
	          (a) start the next phase by sending the first message of the next
	          phase, or (b) continue the same phase by sending another "first"
	          message of the phase (e.g., managing a second set of credentials) - 
	          this is allowed only in Phase Two and Phase Three but NOT in Phase One,
	          or (c) terminate the EAP session.
	      </t>
	      <t>
	        <list style="hanging">
	          <t hangText="Phase One (Required).">
	              Initialization. During this phase the Peer and the Server
	              exchange the information needed to select the appropriate
	              credentials management protocol.

	              Phase One flow is composed by only messages.

	              In particular, the Sever sends
	              its initial message of type ('EAP-CREDS-Init'). The Peer replies with
	              the details about which provisioning protocols are supported, and additional
	              information such as the list of installed credentials and, optionally,
	              authorization data (for new credentials registration).
	          </t>
	          <t hangText="Phase Two (Optional).">
	              Provisioning Protocol Flow. In this phase, the Peer and the Server
	              exchange the provisioning protocol's messages encapsulated in a
	              EAP-CREDS message of type Provisioning. The messages use two main TLVs.
	              The first one is the ('Provisioning-Headers') TLV which is optional
	              and carries information that might be normally coveyed via the transport
	              protocol (e.g., HTTP headers). The second one is the ('Provisioning-Data'),
	              which is required and carries the provisioning protocol's
	              messages. The server can decide to repeat
	              phase two again to register new credentials or to renew a separate
	              set of credentials by issuing a new ('Provisioning') message for the
	              new target. When no more credentials have to be managed,
	              the Server can start phase three or simply terminate the EAP session.
	          </t>
	          <t hangText="Phase Three (Optional).">
	              Credentials Validation. This optional phase can be initiated by
	              the server and it is used to validate that the Peer has properly
	              installed the credentials and can use them to authenticate
	              itself. Depending on the credentials' type, the messages can
	              carry a challenge/nonce, the value of the secret/token, or other
	              information. The format of the credentials is supposed to be
	              known by the provider and the device.
	          </t>
	        </list>
	      </t>
	    </section>

	    <section anchor="phase_transitioning" title="Phase Transitioning Rules">
	      <t>
	        In order to keep track of starting and ending a phase, EAP-CREDS defines
	        several bits and fields in the EAP-CREDS message headers. In particular,
	        as described in <xref target="creds_header" />, the 'S' bit is
	        used to indicate the beginning (or Start) of a phase, while the 'Phase'
	        field (4 bits) is used to indicate the phase for this message. 
	      </t>
	      <t>
	        In EAP-CREDS, phase transitioning is under the sole control of the Server,
	        therefore the value of the 'S' bit is meaningful only in messages sent by the Server.
	        The value of the 'S' bit in Peer's messages SHALL be set to '0x0' and SHALL be
	        ignored by the server.
	      </t>
	      <t>
	        When starting a new phase, the Server MUST set the 'S' bit
	        to '1' and the 'Phase' field to the current phase number (e.g., one, two, or three).
	      </t>
	      <t>
	        In case the first message of a phase is to be repeated (e.g., because of
	        processing multiple credentials), the
	        'S' bit SHALL be set to '0' (i.e., it should be set to '1' only on the first
	        occurrency and set to '0'
	        in subsequent messages).
	      </t>
	    </section>

	    <section anchor="creds_phase_one" title="Phase One: Initialization">

	      <t>
	        The following figure provides the message flow for Phase One:
	      </t>
	<figure title="EAP-CREDS Phase One Message Flow"><artwork><![CDATA[

	,--------.                              ,----------.         
	|EAP Peer|                              |EAP Server|         
	`---+----'                              `----+-----'         
	   |        Outer Tunnel Established        |               
	   | <-------------------------------------->               
	   |                                        |               
	   |  [1] EAP-Request/EAP-CREDS(Type=Init)  |  ,---------!. 
	   |      { [ Version+ ], [ Challenge ] }   |  |Phase One|_\
	   | <---------------------------------------  |Begins     |
	   |                                        |  `-----------'
	   | [2] EAP-Response/EAP-CREDS(Type=Init)  |               
	   |     { Protocol+, [ Encoding+ ],        |               
	   |       [ Format+ ] , [  Version  ]      |  ,---------!. 
	   |       [ Creds-Info+ ], [ Storage-Info ]|  |Phase One|_\
	   |       [ Net-Usage], [ Token ],         |  |Ends       |
	   |       [ Challenge-Rsp ], [ Profile+ ] }|  `-----------'
	   | --------------------------------------->               
	   |                                        |               
	   |                                        |               

	]]></artwork></figure>
	      <t>[1] Server sends EAP-Request/EAP-CREDS(Type=Init):
	        <list>
	          <t>
	            After the establishment of the outer
	            mechanism (e.g., EAP-TLS, EAP-TEAP, EAP-TTLS, etc.), the server MAY
	            decide to start a credentials management session. In order to do that,
	            the Server sends an EAP-Request/EAP-CREDS(Type=Init) message to the Peer with
	            one ('Phase-Control') TLV with the 'S' bit set to '1' and the value set
	            to '1' (thus indicating the beginning of Phase One). Also, the Server
	            MAY use one or more ('Version') TLVs to indicate the supported versions.
	          </t>
	          <t>
	            The Server MAY also specify which versions of EAP-CREDS are supported
	            by adding one or more ('Version') TLVs. If no ('Version') TLV is added
	            to the message, the Peer SHOULD assume the supported version is 1 ('0x1').
	          </t>
	        </list>
	      </t>
	      <t>[2] The Peer sends EAP-Response/EAP-CREDS(Type=Init)
	        <list>
	          <t>
	            The Peer, sends back a message that carries one
	            ('Version') TLV to indicate the selected version of EAP-CREDS (i.e.
	            from the list provided by the server) (optional). If the client does
	            not include the ('Version') TLV, the Server MUST use the most recent
	            supported version of EAP-CREDS. Moreover, the Server includes one or
	            more ('Protocol') TLVs to indicate the list of supported provisioning
	            protocols, followed by one ('Credentials-Info') TLVs for each installed
	            credentials to provide their status to the server (i.e., if multiple
	            credentials are configured on the Peer for this Network, then the Peer
	            MUST include one ('Credentials-Info') TLV for each of them).
	          </t>
	          <t>
	            The Peer also provides the list of supported Encodings and Formats
	            by adding one or more ('Supported-Encodings') and ('Supported-Formats')
	            TLVs. The Peer MAY also provide the Server with information about the
	            Peer's credentials storage by using the 'Storage-Status' TLV.
	          </t>
	          <t>
	            When there are no abailable credentials, the Peer MAY include an authorization
	            token that can be consumed by the Server for registering new credentials.
	            In particular, the Peer can include the ('Token-Data') TLV to convey the
	            value of the token. The ('Challenge-Data') and ('Challenge-Response') TLVs,
	            instead, can be used to convey a challenge and its response
	            based on the authorization information (e.g., maybe a public key hash is
	            present in the Token, then the peer can generate some random data - or use the
	            one from the Server - and generate a signature on that value: the
	            signature SHALL be encoded in the ('Challenge-Response') TLV and it should
	            be calculated over the concatenation of values inside the ('Challenge-Data')
	            TLV and the ('Token-Data') TLV.
	          </t>
	          <t>
	            Also, the Peer MAY add one or more ('Profile') TLVs to indicate to the Server
	            which profiles are requested/supported (e.g., a pre-configuration MAY exist
	            on the Peer with these ecosystem-specific identifiers).
	          </t>
	          <t>
	            Ultimately, the Peer MAY include additional metadata regarding the status of
	            the Peer. To this end, the Peer can use a ('Storage-Info') TLV to provide the server
	            with additional data about the Peer's capabilities and resources. Also, the
	            ('Network-Usage') TLV can be used to provide the Server with the indication of
	            which network resources are needed by the Peer and what is its intended
	            utilization pattern(s).
	          </t>
	          <t>
	            The server checks that the Peer's selected protocol, version, and
	            parameters are supported and, if not (or if the server detects an
	            error), it can (a) send a non-recoverable error message to the peer,
	            notify the outer (tunneling) layer, and terminate the EAP-CREDS session, or
	            (b) start phase one again by sending a new ('EAP-CREDS-Init') message
	            that will also carry an ERROR TLV that provides the Peer with the
	            reason the initial response was not acceptable. In this case, the
	            ('Phase-Control') TLV MUST be omitted since it is not the first message of 
	            phase one. The server and the peer can repeat phase one until they reach
	            an agreement or the session is terminated by the Server.
	          </t>
	        </list>
	      </t>
	      <t>
	        <list>
	          <t>
	            NOTE WELL: The determination of the need to start phase two or not is based on the
	            contents of the ('Credentials-Info') TLV sent by the Peer (e.g., a credential
	            is about to expire or a credential is simply missing).
	          </t>
	        </list>
	      </t>

	    </section>

	    <section anchor="creds_phase_two" title="Phase Two: Provisioning">
	      <t>
	        The following figure provides the message flow for Phase 2:
	      </t>
	<figure title="EAP-CREDS Phase Two Message Flow"><artwork><![CDATA[

	,--------.                                     ,----------.         
	|EAP Peer|                                     |EAP Server|         
	`---+----'                                     `----+-----'         
	 |  [1] EAP-Request/EAP-CREDS(Type=Provisioning) |               
	 |      { Protocol, Action,                      |  ,---------!. 
	 |        [ CredInfo  ], [ Params ],             |  |Phase Two|_\
	 |        [ ProtoData ], [ ProtoHeaders ] }      |  |Begins     |
	 | <----------------------------------------------  `-----------'
	 |                                               |               
	 | [2] EAP-Response/EAP-CREDS(Type=Provisioning) |               
	 |     { ProtoData, [ ProtoHeaders ] }           |               
	 | ---------------------------------------------->               
	 |                                               |               
	 .                                               .               
	 .                                               .               
	 .                                               .               
	 .                                               .               
	 | [N] EAP-Response/EAP-CREDS(Type=Provisioning) |               
	 |     { [ CredInfo ], [ ProtoData ],            |               
	 |       [ ProtoHeaders ] }                      |               
	 | <----------------------------------------------               
	 |                                               |               
	 | [N+1] EAP-Request/EAP-CREDS(Type=Provisioning)|  ,---------!. 
	 |     { [ ProtoData ], [ ProtoHeaders ] }       |  |Phase Two|_\
	 | ---------------------------------------------->  |Ends       |
	 |                                               |  `-----------'
	 |                                               |               

	]]></artwork></figure>
	      <t>[1] The Server sends EAP-Request/EAP-CREDS(Type=Init)
	        <list>
	          <t>
	            The first message of Phase Two indicates that the Server is
	            ready to initiate the selected provisioning protocol.
	          </t>
	        </list>
	      </t>
	      <t>[2] The Peer sends EAP-Response/EAP-CREDS(Type=Init)
	        <list>
	          <t>
	            After that, the Peer sends its first message to the Server by sending the
	            EAP-Response/EAP-CREDS(Type=Provisioning) message. This message contains
	            the selected provisioning protocol's message data and some extra fields
	            (e.g., transport-protocol headers) in the ('Provisioning-Data') and 
	            ('Protocol-Headers') TLVs respectively.
	          </t>
	        </list>
	      </t>
	      <t> [3] The Server sends EAP-Request/EAP-CREDS(Type=Init)
	        <list>
	          <t>
	            The Server replies to the Peer's message with EAP-Request/EAP-CREDS(Type=Provisioning)
	            messages until the provisioning protocol reaches an end or an error condition
	            arise (non-recoverable).
	          </t>
	        </list>
	      </t>
	      <t>[N] The Server sends EAP-Request/EAP-CREDS(Type=Provisioning)
	        <list>
	          <t>
	            When the provisioning protocol has been executed for the specific set of
	            credentials, the server sends a last message that MUST include the description
	            of the provisioned credentials in a ('Credentials-Info') TLV and MUST set the 'D'
	            bit in the EAP-CREDS message header to '1' to indicates that the server does not
	            have any more ('Provisioning') messages for this credenital.
	            The final message does not need to be an empty one, i.e. other TLVs are still
	            allowed in the same message (e.g., the 'Provisioning-Data' and the
	            'Provisioning-Headers' ones).
	          </t>
	        </list>
	      </t>
	      <t>[N+1] The Peer sends EAP-Request/EAP-CREDS(Type=Provisioning)
	        <list>
	          <t>
	            The Peer MUST reply to the server with a ('Provisioning') message that MUST
	            have the 'D' bit in the EAP-CREDS message header set to '1', thus indicating
	            that the credentials have been installed correctly. In case of errors, the Peer
	            MUST include the appropriate ('Error') TLV.
	            Also in this case, the final message does not need to be an empty one,
	            i.e. other TLVs are still allowed in the same message (e.g., the 'Provisioning-Data'
	            and the 'Provisioning-Headers' ones).
	          </t>
	        </list>
	      </t>
	      <t>
	        At this point, the Server can decide to provision (or manage) another set of credentials
	        by issuing a new ('Provisioning') message, or it can decide to start Phase Three by
	        sending its first ('Validate') message, or it can terminate the EAP session.
	      </t>
	    </section>

	    <section anchor="creds_phase_three" title="Phase Three: Validation">
	      <t>
	        The following figure provides the message flow for Phase 3:
	      </t>
	<figure title="EAP-CREDS Phase Three Message Flow"><artwork><![CDATA[

	,--------.                                ,----------.           
	|EAP Peer|                                |EAP Server|           
	`---+----'                                `----+-----'           
	 | [1] EAP-Request/EAP-CREDS(Type=Validate) |  ,-----------!. 
	 |     { Cred-Info, Challenge }             |  |Phase Three|_\
	 | <-----------------------------------------  |Begins       |
	 |                                          |  `-------------'
	 | [2] EAP-Response/EAP-CREDS(Type=Validate)|  ,-----------!. 
	 |     { Challenge-Response }               |  |Phase Three|_\
	 | ----------------------------------------->  |Ends         |
	 |                                          |  `-------------'
	 |                                          |                 

	]]></artwork></figure>
	      <t>
	        Phase three is optional and it is used by the server to request the client to
	        validate (proof) that the new credentials have been installed correctly
	        before issuing the final Success message.
	      </t>
	      <t>
	          <list>
	              <t>
	                  NOTE WELL:
	                  Phase Three introduces a dependency on the selected hashing algorithm
	                  to provide common and easy way to check the integrity and functionality
	                  of a newly installed set of credentials.
	              </t>
	          </list>
	      </t>
	      <t>[1] The Server sends EAP-Request/EAP-CREDS(Type=Validate)
	        <list>
	          <t>
	            In order to start Phase Three, the Server sends an
	            EAP-Request/EAP-CREDS(Type=Validate) message to the Peer.
	            The Server MUST include the ('Credentials-Info') TLV to provide the indication about
	            which set of credentials the Server intends to validate. The Server MUST also include a randomly generated challenge in the message to the client. The type of challenge
	            determines how the ('Challenge-Response') is calculated. EAP-CREDS defines the
	            asymmetric and symmetric challenges in <xref target="eap_creds_challenge_types" />
	            and others can be defined according to the specified rules.
	          </t>
	          <t>
	            As usual, the Server MUST set, in the headers, the 'S' bit to '1' in its first
	            message of Phase Three and the 'Phase' value shall be set to '3'
	            (beginning of Phase Three).
	          </t>
	        </list>
	      </t>
	      <t>
	      	[2] The Peer sends EAP-Response/EAP-CREDS(Type=Validate)
	        <list>
	          <t>
	            When the client receives the Validate message from the server, it calculates the
	            response to the challenge and sends the response back to the server in a
	            EAP-Response/EAP-CREDS(Type=Validate) message. 
	            When the EAP-CREDS-ASYMMETRIC-CHALLENGE and EAP-CREDS-SYMMETRIC-CHALLENGE values
	            are used in the Challenge type, the Peer MUST calculate the response as follows:
	            <list>
	              <t>
	                Public-Key
	                <list>
	                  <t>
	                  	For any public-key based credentials (e.g., certificates or
	                  	raw key pairs), the response to the challenge is calculated by generating a
	                  	signature over the hashed value of the challenge. The hashing algorithm
	                  	to be used for this purpose is specified in <xref target="eap_creds_hashing" />.
	                  	The format of the signature in the ('Challenge-Response') TLV is the
	                  	concatenation of:
	                  	<list style="symbols">
	                    	<t>
	                      	The signatureAlgorithm (DER encoded) which contains the identifier for the
	                      	cryptographic algorithm used by the Peer to generate the signature.
	                      	[RFC3279], [RFC4055], and [RFC4491] list supported signature
	                      	algorithms, but other signature algorithms MAY also be supported.
	                      	The definition of the signatureAlgorithm is provided in Section 4.1.1.2
	                      	of <xref target="RFC5280" />.
	                    	</t>
	                    	<t>
	                    	  The signatureValue (DER encoded) which contains the digital signature
	                    	  itself. The signature value is encoded as a BIT STRING and the details
	                    	  of how to generate the signatures' structures can be found in
	                    	  Section 4.1.1.3 of <xref target="RFC5280" /> and referenced material.
	                    	</t>
	                 		</list>
	                  </t>
	                </list>
	              </t>
	              <t>
	                Symmetric Secret
	                <list>
	                	<t>
	                		For any symmetric based credentials (e.g., password or
		                  Key), the response to the challenge is calculated by using the selected
		                  hash function (see <xref target="eap_creds_hashing" />) on the concatenation of
		                  (a) the value carried in the server-provided ('Challenge-Data') TLV, and
		                  (b) the secret value itself (salted hash).
	                  </t>
	                </list>
	              </t>
	            </list>
	          </t>
	          <t>
	            The initial values for the type of challenges are described in the <xref target="eap_creds_challenge_types" />. Other types of challenges MAY be defined according
	            to the specified procedures.
	          </t>
	          
	          <t>
	            In case of issues with the validation of newly deployed credentials, both
	            the Server and the Peer should consider those credentials invalid (or
	            unusable) and should issue the required failure message(s).
	          </t>
	        </list>
	      </t>
	  	</section>

	  </section> 

	  <!--                             -->
	  <!-- End Of EAP Protocol Section -->
	  <!--                             -->


    <section anchor="creds_msg" title="EAP-CREDS Message Format">
      <t>
        The EAP-CREDS defines the following message types:
        <list style="numbers">
          <t>EAP-CREDS/Init</t>
          <t>EAP-CREDS/Provisioning</t>
          <t>EAP-CREDS/Validate</t>
        </list>
      </t>
      <t>
        Each of these message types have the basic structure as identified in <xref target="creds_header" />.
        EAP-CREDS messages contain zero, one, or more TLVs.
        The internal structure of the different types of TLVs is described in <xref target="creds_msg_payload" />,
        while a detailed description of the EAP-CREDS message types is provided in <xref target="creds_msg_types" />.
      </t>

      <section anchor="creds_header" title="Message Header">
        <t>
          The EAP-CREDS messages consist of the standard EAP header (see Section 4
          of <xref target="RFC3748" />), followed by the version of the EAP-CREDS
          (4 bits) and a field (4 bits) reserved for future use.
          The header has the following structure:
        </t>
        <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |     Code      |  Identifier   |             Length            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |     Type      |J|S|F|D| Phase |         Message Length        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |         Message Length        |               Data           ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-.

]]></artwork></figure>

        <t>
          Where the Code, Identifier, Length, and Type fields are all part of the EAP
          header as defined in <xref target="RFC3748" />. Since EAP-CREDS can only be
          used as a tunneled mechanism, the presence of these fields is only for
          backward compatibility with existing parsers. In particular, the 'Length'
          field is not used (can be ignored): the message length is carried in the
          'Message Length' field instead.
        </t>
        <t>
          The Type field in the EAP header is &lt;TBD&gt; for EAP-CREDS.
        </t>
        <t>
          The Flags bitfield is used to convey status information (e.g., extra long
          message, phase number, phase transitioning state). The transition-control
          bit (i.e., the 'S' bit) are set in Server's messages and are ignored in
          Peer's messages (the Server is the entity that unilaterally controls the
          phase transition process).
          The meanins of the bits in the 'Flags' field are as follows:
          <list>
            <t>
              Bit 'J' (Jumbo Message) - If set, it idicates the presence of the 'Message Length' field.
                       This bit SHALL be used only when the size of the message exceeds the maximum value allowed
                       in the 'Length' field. In this case, the 'Message Length' field is
                       added to the message and set to the whole message size and the 'Length'
                       field is used for the current fragment length.
                       If not set, the 'Message Length' field is not
                       present in the Message and the 'Length' field is used for the message size
                       (and the 'F' bit MUST be set to '0').
            </t>
            <t>
            	Bit 'S' (Start) - If set, this message is the first one of a new EAP-CREDS phase.
                       The value of the new phase is encoded in the 'Phase' field.
            </t>
            <t>
            	Bit 'F' - If set, this message is a fragment of a message. In this case, the
                       'Data' field is to be concatenated with all messages with the 'F' bit
                       set to '1' until the message with the 'F' bit set to '0' that indicates
                       the end of the message. If the message is not fragmented, the 'F' bit
                       MUST be set to '0'. The use of this bit is required when the tunneling
                       method does not provide support for messages up to 2^32 bits in size.
            </t>
            <t>
            	Bit 'D' - This bit is used in Phase Two and Phase Three to indicate that the
                       specific operation for the identified credential is over. For example,
                       when multiple credentials exist on the Peer and the Server needs to
                       manage and validate one of them. In its last message, when the provisioning
                       protocol is done, the server sets the 'D' (Done) bit to indicate that
                       it is done. The Peer, in its reply, sets the bit to indicate
                       the end of provisioning for this credentials is also over. After that, the
                       Server can continue Phase Two, transition to Phase Three, or terminate
                       the EAP session.
            </t>
          </list>
        </t>
        <t>
          The Phase field is a 4-bits value and identifies the EAP-CREDS phase for the current message.
          The version of EAP-CREDS described in this document supports three values for this
          field:
          <list>
            <t>0x01 - Phase One</t>
            <t>0x02 - Phase Two</t>
            <t>0x03 - Phase Three</t>
          </list>
        </t>
        <t>
          A detailed explanation of the 'Phase' and 'Flags' fields of the message headers
          is provided in <xref target="phase_transitioning" />.
        </t>
        <t>
          The Data field is the message payload. The full description of this field
          is provided in the next section.
        </t>
      </section>

      <section anchor="creds_msg_payload" title="Message Payload">
        <t>
          The Data part of the message is organized as zero, one, or more TLV
          objects whose structure is defined in this section.
        </t>
        <t>
          Each TLV object has the same basic structure that is defined as follows:
        </t>
<figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                   TLV Length                  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                       TLV Value                              ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
        <t>Where:</t>
        <t>TLV-Type (uint8)
          <list>
            <t>
              This field is used to indicate the type of data that the TLV
              carries. The type of TLV determines its internal structure.
              The supported values for this fields are provided in the following
              table:
            </t>
          </list>
        </t>
        <t>Length (uint24)
          <list>
            <t>
              This field carries the size of the value of the TLV. In particular,
              the overall size of a TLV (i.e., the header plus the value) can be
              calculated by adding the size of the header (6 octects) to the value
              of the Length field (i.e., the size of the TLV's value).
            </t>
          </list>
        </t>

        <texttable anchor="eap_creds_tlvs_table" title="EAP-CREDS Supported TLVs Types">
          <ttcol align="center">TLV Name</ttcol>
          <ttcol align="left">TLV Type</ttcol>
          <ttcol align="center">Scope/Usage</ttcol>

            <c>&lt;TBD&gt;</c>
            <c>Action TLV</c>
            <c>Phase Two</c>

            <c>&lt;TBD&gt;</c>              
            <c>Certificate-Data TLV</c>
            <c>Phase Two/SPP</c>

            <c>&lt;TBD&gt;</c>
            <c>Challenge-Data TLV</c>
            <c>Phase Two, Phase Three</c>

            <c>&lt;TBD&gt;</c>
            <c>Challenge-Response TLV</c>
            <c>Phase Two, Phase Three</c>

            <c>&lt;TBD&gt;</c>
            <c>Credentials-Data TLV</c>
            <c>Phase Two/SPP</c>

            <c>&lt;TBD&gt;</c>
            <c>Credentials-Info TLV</c>
            <c>Phase Two, Phase Three</c>

            <c>&lt;TBD&gt;</c>
            <c>Error TLV</c>
            <c>All Phases</c>

            <c>&lt;TBD&gt;</c>
            <c>Network-Usage TLV</c>
            <c>Phase One</c>

            <!--
            <c>&lt;TBD&gt;</c>
            <c>Phase-Control TLV</c>
            <c>All Phases</c>
            -->

            <c>&lt;TBD&gt;</c>
            <c>Profile TLV</c>
            <c>Phase Two</c>
            
            <c>&lt;TBD&gt;</c>
            <c>Protocol TLV</c>
            <c>Phase One, Phase Two</c>

            <c>&lt;TBD&gt;</c>
            <c>Provisioning-Data TLV</c>
            <c>Phase Two</c>

            <c>&lt;TBD&gt;</c>
            <c>Provisioning-Headers TLV</c>
            <c>Phase Two</c>

            <c>&lt;TBD&gt;</c>
            <c>Provisioning-Params TLV</c>
            <c>Phase Two</c>

            <c>&lt;TBD&gt;</c>
            <c>Certificate-Request TLV</c>
            <c>SPP</c>

            <c>&lt;TBD&gt;</c>
            <c>Storage-Info TLV</c>
            <c>SPP</c>

            <c>&lt;TBD&gt;</c>
            <c>Supported-Format TLV</c>
            <c>SPP</c>

            <c>&lt;TBD&gt;</c>
            <c>Supported-Encoding TLV</c>
            <c>SPP</c>

            <c>&lt;TBD&gt;</c>
            <c>Token-Data TLV</c>
            <c>Phase One</c>

            <c>&lt;TBD&gt;</c>
            <c>Version TLV</c>
            <c>Phase One</c>

        </texttable>

        <t>TLV Value ( > 1 octet )
          <list>
              <t>
                  This field carries data for the identified TLV. The internal structure
                  is determined by the TLV Type field.
              </t>
          </list>
        </t>

        <t>
          The rest of this section describes the structure of the different
          supported TLVs and their usage in the different messages.
        </t>
      </section>

      <section anchor="creds_tlvs_types" title="EAP-CREDS defined TLVs">
	      <t>
	        EAP-CREDS messages's payload comprieses zero, one, or more TLVs that are encoded
	        in a single EAP-CREDS message.
	        The values for the TLV Type that are supported by this specifications are listed
	        in <xref target="eap_creds_tlvs_table" />.
	      </t>

	    <section anchor="tlv_action" title="The Action TLV">

	      <figure><artwork><![CDATA[

	  0                   1                   2                   3
	  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
	 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	 |   TLV Type    |                 TLV Length                    |
	 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	 |     Flags     |  Action Type  |
	 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

	]]></artwork></figure>
	    	<t>TLV Type (uint8)
	        <list>
	            <t>&lt;TBD&gt; - Action TLV</t>
	        </list>
	    	</t>
	    	<t>TLV Length (uint24)
	        <list>
	            <t>Fixed value (=2)</t>
	        </list>
	    	</t>
	    	<t>Flags (uint8)
	        <list>
	            <t>Reserved</t>
	        </list>
	    	</t>
	    </section>

    <section anchor="tlv_certificatedata" title="The Certificate-Data TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |     Flags     |    Encoding     |            Value           ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
    	<t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Certificate-Data TLV</t>
        </list>
    	</t>
    	<t>Length (uint24)
        <list>
            <t>Provides the length of the TLV (> 3 octets)</t>
        </list>
    	</t>
    	<t>Flags (uint8)
        <list>
          <t>
            Provides a BITMASK that can be used to provide additional information
            related to the encapsulated certificate. The bits have the following
            meaning:
            <list>
              <t>Bit 0 - If set, the certificate is trusted (Trust Anchor)</t>
              <t>Bit 1 - If set, the certificate is a CA certificate</t>
              <t>Bit 2 - If set, the certificate is self-signed</t>
              <t>Bit 3 - If set, the certificate is a proxy certificate</t>
              <t>Bit 4 - If set, the certificate is an attribute certificate</t>
              <t>Bit 5 - Reserved</t>
              <t>Bit 6 - Reserved</t>
              <t>Bit 7 - Reserved</t>
            </list>
          </t>
        </list>
        For a Trusted Root CA, the value of the flags shall be 0x7 (0000 0111).
        For an intermediate CA certificate that is not implicitly trusted, the value of
        the flags field should be set to 0x02 (0000 0010).
        For an End-Entity certificate, the value of the Flags will be 0x0 (0000 0000).
    	</t>
    	<t>Format (uint8)
        <list>
          <t>
            Provides the indication of the Format the certificate is in. The
            allowed values for this field are listed in
            <xref target="iana_creds_data_type" />.
          </t>
        </list>
	    </t>
  	  <t>Encoding (uint8)
        <list>
          <t>
            Provides the indication of the Encoding the certificate is in. The
            allowed values for this field are listed in 
            <xref target="iana_creds_encoding_type" />.
		      </t>
        </list>
    	</t>
    	<t>Value (octet string)
        <list>
          <t>
              This field carries the data for the certificate.
          </t>
        </list>
    	</t>
    </section>

    <section anchor="tlv_challenge" title="The Challenge-Data TLV">
      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Ch. Type    |           Challenge Data                     ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
      <t>TLV Type (uint8)
        <list>
          <t>&lt;TBD&gt; - Challenge-Data TLV</t>
        </list>
    	</t>
    	<t>Length (uint24)
        <list>
          <t>3 octets</t>
        </list>
    	</t>
    	<t>Challenge Type (uint8)
      	<list>
        	<t>
	          This field carries the type of Challenge. In particular, the challenge
	          type determines how the Peer MUST calculate the ('Challenge-Response').
	          The initial values for this fiel are listed in <xref target="eap_creds_challenge_types" />.
	          Please refer to <xref target="creds_phase_three" /> for a detailed explanation
	          of how to calculate the response to the challenge for the challenge types
	          defined in this document.
        	</t>
      	</list>
    	</t>
    	<t>Challenge Data (> 1 octet)
        <list>
          <t>
            This field carries the data to be used as a challenge
            when validating newly deployed credentials.
          </t>
	      </list>
  	  </t>
    </section>

    <section anchor="tlv_challenge_response" title="The Challenge-Response TLV">
      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                       Challenge Response                     ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
      <t>TLV Type (uint8)
        <list>
          <t>&lt;TBD&gt; - Challenge-Response TLV</t>
        </list>
    	</t>
    	<t>Length (uint24)
        <list>
          <t>3 octets</t>
        </list>
    	</t>
    	<t>Challenge Response (> 1 octet)
        <list>
          <t>
            This field carries the data that resulted from the use
            of the credentials to be validated.
          </t>
        </list>
	    </t>
    </section>

		<section anchor="tlv_credinfo" title="The Credentials-Information TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |        
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |     Flags     |   CredsType   |             ProtoID           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 |                         IssuedOn (GMT)                        |
 |                                                               |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 |                        Expires On (GMT)                       |
 |                                                               |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                       Credentials Length                      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                           CredIDValue                        ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
    <t>
        The Credential-Information TLV is used by the Peer to provide
        a description of the installed credentials that are relevant for
        the network that is being accessed.
    </t>
    <t>
        For example, when a set of credentials need to be renewed, the
        server checks the ('Credentials-Info') from the Peer and eventually
        selects the right one for renewal. The TLV structure is as follows:
    </t>
    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Credentials-Information TLV</t>
        </list>
    </t>
    <t>Length (uint24)
        <list>
            <t>
                Provides the total length of the body of the Credential-Information TLV.
            </t>
        </list>
    </t>
    <t>Flags (uint8)
        <list>
            <t>
                Provides a BITMASK that can be used to provide information
                about the status of the credentials (e.g., if the use marks the
                credentials to be compromised). The bits have the following
                meaning:
                <list>
                    <t>Bit 0 - If set, the credential is marked as compromised</t>
                    <t>Bit 1 - If set, the credential is immutable and cannot be updated</t>
                    <t>Bit 2 - Private Key or Secret Immutable, the public part of the
                               credential (e.g., a certificate) can still be updated</t>
                    <t>Bit 3 - If set, the credential cannot be updated (both public and
                               private parts)</t>
                    <t>Bit 4 - If set, the credential is ready to be used </t>
                    <t>Bit 5 - If set, the credential was generated on the server</t>
                    <t>Bit 6 - If set, the Peer would like to update the credential even
                               if they are not expired</t>
                    <t>Bit 7 - Reserved</t>
                </list>
            </t>
        </list>
    </t>
    <t>CredType (uint8)
        <list>
            <t>
                This field provides the description of the type of credential. The type
                of credentials are listed in <xref target="iana_creds_type" />
            </t>
        </list>
    </t>
    <t>ProtoID (uint16)
        <list>
            <t>
                This field indicates the protocol that was used to retrieve the target
                credential. When the TLV is used in a Request by the Server, this field
                is ignored.
                The values for this field are listed in <xref target="iana_proto" />.
            </t>
        </list>
    </t>
    <t>IssuedOn (16 octets)
        <list>
            <t>
                This field carries the GMT date for when this credential was issued.
                This field is 16 bytes long (the last byte must be set to '0x00') and
                contains the NULL-terminated ASCII string that represents the timestamp
                where the credential was issued. When the value is not set, the field
                should be set to { 0x00 }. The format of the string is as follows:
            </t>
            <t>
                <list>
                    <t>YYYYMMDDHHmmssZ</t>
                </list>
            </t>
            <t>
                Where:
                <list>
                    <t>YYYY - is the 4 digits representation of the year</t>
                    <t>MM - is the 2 digits representation of the month</t>
                    <t>DD - is the 2 digits representation of the day of the month</t>
                    <t>HH - is the 2 digits representation of the hour of the day (24 hour format)</t>
                    <t>mm - is the 2 digits representation of the minutes of the hour</t>
                    <t>ss - is the 2 digits representation of the seconds of the minute</t>
                    <t>Z - is the character 'Z'</t>
                </list>
            </t>

        </list>
    </t>
    <t>ExpiresOn (16 octets)
        <list>
            <t>
                This field carries the GMT date for when this credential is to be considered
                expired. This field is 16 bytes long (the last byte must be set to '0x00') and
                contains the NULL-terminated ASCII string that represents the timestamp where
                the credential was issued. The format is the same as the ('IssuedOn') field.
                When the value is not set, the field should be set to { 0x00 }.
            </t>
        </list>
    </t>
    <t>Credentials Length (uint16)
        <list>
            <t>
                Length (in bytes) of the Credentials value. When used with a public-key
                type of credentials, this is the size of the key (e.g., for an RSA 2048
                bit keys, this field should carry the value of 256). When used with a
                symmetric secret, this field carries the size of the secred (in bytes).
            </t>
        </list>
    </t>
    <t>CredIDValue (> 1 octet)
        <list>
            <t>
                The binary value of the credentials' identifier. This identifier can be the
                binary value of the SHA-256 calculated over the certificate, a username, or
                it could be a random handle. As long as the ID allows the peer and the server to
                uniquely (in its context) identify the credentials, the value of this field
                can be calculated in any way.
            </t>
        </list>
    </t>

    <!--
    <t>ProviderIDLen (uint8)
        <list>
            <t>
                Length (in bytes) of the Provider's ID Value field.
            </t>
        </list>
    </t>
    <t>ProviderIDValue (> 1 octet)
        <list>
            <t>
                The binary value of the provider's identifier. This identifier can be the
                binary value of the SHA-256 calculated over the CA certificate, the text
                representation of a policy OID, or it could be a simple random handle. As
                long as the ID allows the Server to uniquely (in its context) identify the
                provider, the value of this field can be calculated in any way. This field
                is optional and, when not used, it should be omitted and its size should
                be set to zero ('ProviderIDLen').
            </t>
        </list>
    </t>
    <t>ProfileIDLen (uint8)
        <list>
            <t>
                Length (in bytes) of the Profile's ID Value field.
            </t>
        </list>
    </t>
    <t>ProfileIDValue (> 1 octet)
        <list>
            <t>
                The binary value of the profile's identifier. This identifier can be the
                binary value of a policy OID, a sequence number, or a printable text
                string. As long as the ID allows the Server to uniquely (in its context)
                identify the profile, the value of this field can be populated according
                to the provider's practices. This field is optional and, when not used,
                it should be omitted and its size should be set to zero ('ProfileIDLen').
            </t>
        </list>
    </t>
    -->

    </section>

<section anchor="tlv_credparams" title="The Credentials-Data TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Cred Type   |     Format    |    Encoding     |     Value  ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Credentials-Data TLV</t>
        </list>
    </t>
    <t>Length (uint24)
        <list>
            <t>Provides the length of the TLV (> 3 octets)</t>
        </list>
    </t>
    <t>Cred Type (uint8)
        <list>
            <t>
                Provides the indication of the type of credentials. The allowed
                values for this field are listed in <xref target="iana_creds_type" />.
            </t>
        </list>
    </t>
    <t>Format (uint8)
        <list>
            <t>
                Provides the indication of the Format the credentials are in. The
                allowed values for this field are listed in
                <xref target="iana_creds_data_type" />.
            </t>
        </list>
    </t>
    <t>Encoding (uint8)
        <list>
            <t>
                Provides the indication of the Encoding the credentials are in. The
                allowed values for this field are listed in 
                <xref target="iana_creds_encoding_type" />.
            </t>
        </list>
    </t>
    <t>Value (octet string)
        <list>
            <t>
                This field carries the data for the credentials.
            </t>
        </list>
    </t>
    </section>

    <section anchor="tlv_error" title="The Error TLV">
        <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |     EAP-CREDS Error Code      |      Secondary Error Code     |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                          Description                         ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
      <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Challenge-Response-Data TLV</t>
        </list>
    </t>
    <t>Length (uint24)
        <list>
            <t>3 octets</t>
        </list>
    </t>
    <t>EAP-CREDS Error Code (2 octets)
        <list>
            <t>
                This field carries the EAP-CREDS error code. These code are related
                to the EAP-CREDS operations only and it should not be used to carry
                the Provisioning-Protocol specific error codes.
            </t>
            <t>
                The error codes supported by this specifications are listed in
                <xref target="tlv_error" />.
            </t>
        </list>
    </t>
    <t>Secondary Error Code (2 octets)
        <list>
            <t>
                This field is used to convery an error at the encapsulation layer
                (i.e., the provisioning protocol error). 
                For example, this field can be used to convey a transport protocol
                error code (e.g., HTTP status code).
                Do not use this field to convery EAP-CREDS specific errors.
            </t>
        </list>
    </t>
    <t>Description ( > 1 octet)
        <list>
            <t>
                The Description field is optional (i.e., when the Description Size
                is set to zero) and carries information about the error that occurred.
                The message may or may not be used by a user or an automated process
                for debugging purposes.
            </t>
        </list>
    </t>
    </section>

    <section anchor="tlv_network_usage" title="The Network-Usage TLV">
      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |U| Desc Format |   Encoding    |   Network-Usage Data         ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
      <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Network-Usage TLV</t>
        </list>
    </t>
    <t>Length (uint24)
        <list>
            <t>Variable Length TLV (Value must be > 2 )</t>
        </list>
    </t>
    <t>Description Format (uint8)
        <list>
          <t>
            The Type of data encoded in the Peer Description Data. The initial values
            for this field are listed in <xref target="iana_usage_metadata_type" />.
          </t>
        </list>
    </t>
    <t>Encoding (uint8)
        <list>
            <t>
                Provides the indication of the Encoding the network usage description
                data is in. The allowed values for this field are listed in 
                <xref target="iana_creds_encoding_type" />.
            </t>
        </list>
    </t>
    <t>The 'U' field (1 bit)
      <list>
        <t>
          The 'URL' bit ('U') is used to indicate if the value of the Network-Usage Data field
          is to be interpreted as a URL or as the actual data. In particular, if the value in
          the 'URL' bit is '1', then the value in the Network-Usage Data field is to be
          interpreted as the URL where the actual data can be downloaded from. Otherwise, if
          the 'URL' bit is set to '0', then the value in the Netowrk-Usage Data field is to be
          interpreted as the actual data (not a URL referencing it).
        </t>
        <t>
          An example use of this bit is when the Peer wants to convey the URL of the MUD file
          <xref target="RFC8520" />. In this case, the Peer can set the Network-Usage Data field
          to the Url of the MUD file related to the Peer.
        </t>
      </list>
    </t>
    <t>Desc Format (7 bits)
      <list>
        <t>
          This field provide the expected data format for the Network-Usage Data. For example,
          the value in this field could be set to 'MUD' and have the 'U' bit set to '1' to
          provide the MUD-related information at credentials management time instead of at
          network-provisioning time (DHCP option). This possibility could help the Network
          controller to decide if the device shall be allowed to register its credentials
          or not.
        </t>
        <t>
          The list of initial values for this field is provided in <xref target="iana_net_usage_type" />.
        </t>
      </list>
    </t>
    <t>Network-Usage Data (octet string)
        <list>
            <t>
                This is additional information related to the device. In particular,
                this TLV can be used by the Peer to provide the Server with the description
                of the intended network usage or a URL that points to the same information.
            </t>
            <t>
                For example, this field can be used to convey a MUD file (Manufacturer
                Usage Description) or the latest firmware-update manifest.
            </t>
        </list>
    </t>
    </section>


<!--
    <section anchor="tlv_provider" title="The Provisioning-Provider TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                   Provider Identifying Data                  ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Provisioning-Providers TLV</t>
        </list>
    </t>
    <t>Length (uint24)
        <list>
            <t>3 octets</t>
        </list>
    </t>
    <t>Provider Identifying Data (octet string)
        <list>
            <t>
                The Provider Identifying Data is used to provide indication to
                the other party about which providers are supported. The data
                used in this field is left to be interpreted by the end-point
                and it is orthogonal to EAP-CREDS data types.
            </t>
            <t>
                For example, an end-point could use the string representation
                (i.e., dotted representation) of the Object Identifier (OID) that
                corresponds to the IANA's Private Enterprise Number (PEN) of the
                specific supported provider or of the Certificate Policy supported
                (e.g., the OID could be the OID of the supported Certificate Policy).
            </t>
        </list>
    </t>

    </section>
-->

<!--

<section anchor="tlv_control" title="The Phase-Control TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |     Flags     |     Phase     |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Phase-Control TLV</t>
        </list>
    </t>
    <t>TLV Type (uint24)
        <list>
            <t>Fixed Value (2).</t>
        </list>
    </t>
    <t>Flags (8 bit)
      <list>
        <t>
          Bit 0 ('S') - Start or End. If set to '0' (Start), this bit indicates that the message this
          TLV is embedded in, it is the first message for this phase (i.e., it marks the )
          If set to '1' (End), this bits indicates that the message this TLV
          is embedded in, it is the last message for this phase.
        </t>
        <t>
          Bit 1..7 - Reserved.
        </t>
      </list>
    </t>
    <t>Phase (uint8)
      <list>
        <t>
          The Phase field is used to indicate which of the phases is ending or
          starting. This field should use only '1', '2', and '3' values for the
          current version of the EAP-CREDS/SPP specifications.
        </t>
      </list>
    </t>
  </section>
-->

<section anchor="tlv_profiles" title="The Profile TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                    Profile Identifying Data                  ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Profile Identifying Data TLV</t>
        </list>
    </t>
    <t>Length (uint24)
        <list>
            <t>Length value should be >= 1</t>
        </list>
    </t>
    <t>Profile Identifying Data (octet string)
        <list>
            <t>
                The Profile Identifying Data is used to provide indication to
                the other party about which profiles are supported when requesting
                credentials management.
            </t>
            <t>
                Also in this case, the data used in this field is left to be
                interpreted by the end-point and it is orthogonal to EAP-CREDS data
                types.
            </t>
            <t>
                An example of values for this field, an end-point could use the
                string representation (i.e., dotted representation) of the
                Object Identifier (OID) of the specific profile supported (e.g., could
                be defined in the Certificate Policy of the credentials' provider).
            </t>
        </list>
    </t>
    </section>

    <section anchor="tlv_protocols" title="The Protocol TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |         Protocol ID           |             Version           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Protocol TLV</t>
        </list>
    </t>
    <t>TLV Length (uint24)
        <list>
            <t>Fixed TLV Length value of 4.</t>
        </list>
    </t>
    <t>Protocol ID (uint16)
        <list>
            <t>
                The Protocol ID value carries the id of a supported provisioning
                protocol. The initial list of values for the provisioning protocol
                identifiers can be found in <xref target="iana_proto" />.
            </t>
        </list>
    </t>
    <t>Version (uint16)
        <list>
            <t>
                The Version (Protocol Version) value represents the
                specific version of the identified provisioning protocol. 
                When no version is specified for a protocol (i.e., either it does
                not support multiple versions or it does not matter), the
                value of this field should be set to '0x0'.
            </t>
        </list>
    </t>
    </section>

    <section anchor="tlv_prov_data" title="The Provisioning-Data TLV">
      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                         Provisioning Data                    ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
      <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Provisioning-Data TLV</t>
        </list>
    </t>
    <t>Length (uint24)
        <list>
            <t>3 octets</t>
        </list>
    </t>
    <t>Headers Data (> 1 octet)
        <list>
            <t>
                This field carries the provisioning protocol's messages.
            </t>
        </list>
    </t>
    </section>

<section anchor="tlv_prov_headers" title="The Provisioning-Headers TLV">
      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                           Headers Data                       ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
      <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Provisioning-Headers TLV</t>
        </list>
    </t>
    <t>Length (uint24)
        <list>
            <t>3 octets</t>
        </list>
    </t>
    <t>Headers Data (> 1 octet)
        <list>
            <t>
                This field carries the meta-data (if any) that might be
                associated with the transport-layer normally used with the
                provisioning protocol. For example, this TLV can carry the
                set of HTTP headers required by EST or ACME.
            </t>
        </list>
    </t>
    </section>

<section anchor="tlv_prov_params" title="The Provisioning-Params TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |            Min Length         |          Max Length           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Algorithm   |     Flags     |     OBJECT IDENTIFIER (DER)  ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Provisioning-Params TLV</t>
        </list>
    </t>
    <t>Length (uint24)
        <list>
            <t>Provides the length of the TLV (>= 6 octets)</t>
        </list>
    </t>
    <t>Min Length (uint16)
        <list>
            <t>
                Provides the minimum allowed size size for the credentials. This
                value has meaning depending on the context of the credentials,
                however sizes are always expressed in bytes.
            </t>
            <t>
                For example, when used with a symmetric key or a password, the
                ('Min Length') and ('Max Length') refer to the minimum and
                maximum size of the password data. The ('Algor OID') field can
                be omitted in this case.
            </t>
            <t>
                On the other hand, when referring public-key credentials, this
                field should carry the size of the modulus of the key. For example,
                for an RSA 2048 bit keys, the field should carry the value of 256.
                For an ECDSA that uses the prime256r1 curve, this field should
                carry the value of 32 and the Algor OID should be the DER
                representation of the specific value of the curve (i.e., the DER
                representation of '1.2.840.10045.3.1.7').
            </t>
        </list>
    </t>
    <t>Max Length (uint16)
        <list>
            <t>
                Provides the indication maximum size of the credentials. This
                value has meaning depending on the context of the credentials,
                however sizes are always expressed in bytes.
            </t>
            <t>
                The same considerations apply to this field as well as the
                ('Min Length') one discussed above.
            </t>
        </list>
    </t>
    <t>Flags (uint8)
        <list>
            <t>
                Provides a BITMASK that can be used to provide information
                about the status of the credentials (e.g., if the use marks the
                credentials to be compromised). The bits have the following
                meaning:
                <list>
                    <t>Bit 0 - Credentials (or part of it) are to be generated on the server</t>
                    <t>Bit 1 - Credentials (or part of it) are to be generated on the peer</t>
                    <t>Bit 2 - Credentials are to be generated on dedicated hardware</t>
                    <t>Bit 3 - Reserved</t>
                    <t>Bit 4 - Reserved</t>
                    <t>Bit 5 - Reserved</t>
                    <t>Bit 6 - Reserved</t>
                    <t>Bit 7 - Reserved</t>
                </list>
            </t>
            <t>
              When using public-key based credentials, the bits 0 and 1 are mutually exclusive.
            </t>
            <t>
              When using passwords or shared secrets, if bit 0 is set, then the secret is generated
              by the server and then sent to the client. On the other hand, if bit 1 is set, then the
              secret is generated by the peer and then sent to the server. Ultimately, if both bits
              are set, then the Server generates the first part of the password and sends it to the
              Peer, while the Peer generates the second part of the password and sends it to the
              Server. The password to be used for future authentication is the concatenation of the
              two shares of the password: first the one from the Server, then the one from the Client.        
            </t>
            <t>
              <list>
                <t>
                  NOTE WELL:
                  Last but not least, since these passwords/secrets are meant to be used in a automated
                  fashion, there is no restriction around the character set to use or their interpretation.
                  Therefore,it is good practice to generate random passphrases that use the full 8-bit
                  character set (on client and server) to maximize the secret's search space.
                </t>
              </list>
            </t>
        </list>
    </t>
    <t>Algorithm (uint8)
        <list>
            <t>
                Provides the indication of the algorithm used for the generation of
                the credentials. The allowed values for this field are listed in 
                <xref target="iana_creds_algor_type" />.
            </t>
        </list>
    </t>
    <t>Object Identifier (binary; > 1 octet)
        <list>
            <t>
                Provides the indication of additional parameters that are needed to be
                encoded for the credentials. This value is used only when the
                credentials use public-key cryptography - this field carries
                additional information about the generation algorithm to be used.
                We provide some useful values that can be used as reference:
            </t>
        </list>
    </t>
    <texttable anchor="oid_table" title="Object Identifiers Examples">
      <ttcol align="left">OID Name</ttcol>
      <ttcol align="center">Dotted Representation</ttcol>
      <ttcol align="center">Binary Encoding</ttcol>
      <c>secp256r1 curve</c>
      <c>1.2.840.10045.3.1.7</c>
      <c>06 08 2A 86 48 CE 3D 03 01 07</c>
        
      <c>secp384r1 curve</c>
      <c>1.2.840.10045.3.1.34</c>
      <c>06 08 2A 86 48 CE 3D 03 01 22</c>

      <c>secp521r1 curve</c>
      <c>1.2.840.10045.3.1.35</c>
      <c>06 08 2A 86 48 CE 3D 03 01 23</c>
        
      <c>X25519 curve</c>
      <c>1.3.101.110</c>
      <c>06 03 2B 65 6E</c>

      <c>X25519 curve</c>
      <c>1.3.101.110</c>
      <c>06 03 2B 65 6E</c>

      <c>X448 curve</c>
      <c>1.3.101.111</c>
      <c>06 03 2B 65 6F</c>

      <c>Ed25519 curve</c>
      <c>1.3.101.112</c>
      <c>06 03 2B 65 70</c>

      <c>Ed448 curve</c>
      <c>1.3.101.113</c>
      <c>06 03 2B 65 71</c>
    </texttable>
    
    </section>

    <section anchor="tlv_cert_request" title="The Certificate-Request TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Encoding    |    Format     |            Value             ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Token-Data TLV</t>
        </list>
    </t>
    <t>TLV Length (uint24)
        <list>
            <t>Provides the length of the TLV (> 3 octets)</t>
        </list>
    </t>
    <t>Encoding (uint8)
        <list>
            <t>
                Provides the indication of the Encoding the credentials are in. The
                allowed values for this field are listed in 
                <xref target="iana_creds_encoding_type" />.
            </t>
        </list>
    </t>
    <t>Format (uint8)
        <list>
            <t>
                Provides the indication of the type of credentials. The allowed
                values for this field are listed in <xref target="iana_creds_data_type" />.
            </t>
        </list>
    </t>
    <t>Value (octet string)
        <list>
            <t>
                This field carries the data for the credentials.
            </t>
        </list>
    </t>
    </section>


<section anchor="tlv_storage_info" title="The Storage-Info TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |     Flags     |           Spare Slots         |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                          Available Memory                     |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>

    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Store-Info TLV</t>
        </list>
    </t>
    <t>Flags (8 bits)
        <list>
            <t>
              Provides information about the status and type of store and limited information
              about its capabilities. The bits have the following meaning:
              <list>
                  <t>Bit 0 - If set, the store supports RSA keys (software)</t>
                  <t>Bit 1 - If set, the store supports RSA keys (hardware)</t>
                  <t>Bit 2 - If set, the store supports ECDSA keys (software)</t>
                  <t>Bit 3 - If set, the store supports ECDSA keys (hardware)</t>
                  <t>Bit 4 - If set, the store supports symmetric keys</t>
                  <t>Bit 5 - If set, the store supports generic tokens</t>
                  <t>Bit 6 - If set, the store is immutable (no key generation or deletion)</t>
                  <t>Bit 7 - Not Used</t>
              </list>
            </t>
        </list>
    </t>
    <t>Spare Slots (uint16)
        <list>
            <t>
                Provides the number of available slots where to store credentials. When no more
                slots are available, the value of '0' should be used to indicate to the Server
                that a credential must be deleted before a new one can be created.
            </t>
            <t>
                When the number of slots is not fixed or not known, the value of { 0xFF, 0xFF }
                shall be used.
            </t>
        </list>
    </t>
    <t>Available Memory (uint32)
        <list>
            <t>
                This field carries the size (in bytes) of the spare memory on the Peer's secrets'
                store.
            </t>
        </list>
    </t>
    </section>

    <section anchor="tlv_suppoorted_formats" title="The Supported-Formats TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    TLV Type   |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |     Format    |
 +-+-+-+-+-+-+-+-+

]]></artwork></figure>

    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Supported-Format TLV</t>
        </list>
    </t>
    <t>TLV Length (uint24)
        <list>
            <t>Provides the length of the TLV. This field must be set to 1.</t>
        </list>
    </t>
    <t>Format (uint8)
        <list>
            <t>
                Provides the details about the supported format. Multiple formats
                TLVs can be used in the Peer's ('Init') message to provide the
                Server with the Peer's capabilities.
            </t>
        </list>
    </t>

    </section>

    <section anchor="tlv_supported_encoding" title="The Supported-Encoding TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Encoding    |
 +-+-+-+-+-+-+-+-+

]]></artwork></figure>

    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Store-Info TLV</t>
        </list>
    </t>
    <t>TLV Length (uint24)
        <list>
            <t>Provides the length of the TLV. The field has a fixed value of 1.</t>
        </list>
    </t>
    <t>Encoding (uint8)
        <list>
            <t>
                Provides the indication of the supported Encoding by the End Point.
                This provides the indication to the Server of the capability of the
                Peer. The allowed values for this field are listed in 
                <xref target="iana_creds_encoding_type" />.
            </t>
        </list>
    </t>
    </section>

    <section anchor="tlv_auth_token" title="The Token-Data TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  Token Type   |    Encoding   |             Value            ...
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork></figure>
    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Token-Data TLV</t>
        </list>
    </t>
    <t>TLV Length (uint24)
        <list>
            <t>Provides the length of the TLV (> 3 octets)</t>
        </list>
    </t>
    <t>Token Type (uint8)
        <list>
            <t>
                Provides the indication of the type of credentials. The allowed
                values for this field are listed in <xref target="iana_token" />.
            </t>
        </list>
    </t>
    <t>Encoding (uint8)
        <list>
            <t>
                Provides the indication of the Encoding the credentials are in. The
                allowed values for this field are listed in 
                <xref target="iana_creds_encoding_type" />.
            </t>
        </list>
    </t>
    <t>Value (octet string)
        <list>
            <t>
                This field carries the data for the credentials.
            </t>
        </list>
    </t>
    </section>

<section anchor="tlv_version" title="The Version TLV">

      <figure><artwork><![CDATA[

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   TLV Type    |                  TLV Length                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Version     |
 +-+-+-+-+-+-+-+-+

]]></artwork></figure>
    <t>TLV Type (uint8)
        <list>
            <t>&lt;TBD&gt; - Version TLV</t>
        </list>
    </t>
    <t>TLV Length (uint24)
        <list>
            <t>Provides the length of the TLV. The field has a fixed value of 1.</t>
        </list>
    </t>
    <t>Version (uint8)
        <list>
            <t>
                The Version field represents the specific
                version of the EAP-CREDS protocol that are supported by the end
                point. When multiple versions of EAP-CREDS are supported, multiple
                ('Version') TLVs can be used.
            </t>
            <t>
                When no version is specified (i.e., either it does
                not support multiple versions or it does not matter), the
                value of this field should be set to '0x0' (any version).
            </t>
        </list>
    </t>

    		</section>
  		</section>
  	</section>

  	<!--                   -->
  	<!-- End of MSG Format -->
  	<!--                   -->

    <section anchor="creds_msg_types" title="EAP-CREDS Messages">
        <t>
            This section describes each message and what TLVs are allowed or required.
            EAP-CREDS defines the following values for the Message Type (Type):
        </t>
        <texttable anchor="eap_creds_msgs_table" title="EAP-CREDS Message Types">
          <ttcol align="center">Message Type</ttcol>
          <ttcol align="left">Name</ttcol>
          <ttcol align="left">Description</ttcol>
          <c>0</c>
          <c>EAP-CREDS-Init</c>
          <c>Initialization Phase</c>
          <c>1</c>
          <c>EAP-CREDS-Provisioning</c>
          <c>Carries Provisioning Protocol Messages</c>
          <c>2</c>
          <c>EAP-CREDS-Validate</c>
          <c>Validates newly installed credentials</c>
        </texttable>

        <section anchor="creds_msg_init" title="The EAP-CREDS-Init Message">
            <t>
                The EAP-CREDS-Init message type is used in Phase One only of EAP-CREDS. The
                message flow is depicted in <xref target="creds_phase_one" />. This message
                supports the following TLVs: Version, Protocol, Credentials-Info, and Error.
            </t>

            <section anchor="creds_msg_server_init" title="EAP Server's Init Message">
                <t>
                    EAP-CREDS starts with an ('EAP-CREDS-Init') message from the server. This
                    message MAY contain zero, one, or more ('Version') TLVs and, optionally, a
                    ('Challenge-Data') TLV.
                </t>
                <t>
                    The first message from the server is the one that starts Phase One, therefore
                    the Server MUST set the headers' 'S' bit to '1' (Start) and the headers' 'Phase' value
                    to '1' (Phase One).
                </t>
                <t>
                    The Server uses one or more ('Version') TLVs in the EAP-Request/EAP-CREDS(Type=Init)
                    message to provide the Peer with the list of EAP-CREDS versions supported. If omitted,
                    the implict version of EAP-CREDS used in the session is one ('0x1').
                    If the Server detects multiple occurrences of this TLV in the reply from the Peer,
                    an error shall be issued and the EAP-CREDS session should be terminated.
                </t>
                <t>
                    In case Token-Based registration is enabled on the Server, the Server MUST
                    include, in its Init message, a ('Challenge-Data') field that can be used by
                    the client to provide challenge data for proof-of-possession of secrets.
                </t>
            </section>

            <section anchor="creds_msg_peer_init" title="EAP Peer's Init Message">
                <t>
                    The Peer MUST reply to the Server's ('EAP-CREDS-Init') message with its own
                    ('EAP-CREDS-Init') one. The Peer SHOULD include one ('Version') TLV
                    in its first message to indicate the version of EAP-CREDS that the client wants to use for the
                    session. The Peer MUST also provide the list of supported provisioning
                    protocols (via one or more the 'Protocol' TLV), the list and status of the installed
                    credentials (via the 'Credentials-Info' TLV). The Peer MAY include
                    authorization data when registering new credentials (e.g., an authorization
                    token or a device certifcate) via the ('Token-Data') and ('Challenge-Response')
                    TLV.
                </t>
                <t>
                    The Peer MUST include one ('Credentials-Info') TLV for each credential the
                    Network is authorized to manage. Typically, a Peer will include only one
                    ('Credentials-Info') TLV in its ('EAP-CREDS-Init') message, but there might
                    be cases where multiple types of credentials are available and selected depending on
                    the location and other factors (e.g., X.509 certificate and username/password combination).
                </t>
                <t>
                    In case the Peer does not have any credentials available yet, it does not
                    add any ('Credentials-Info') TLV - leaving the Server with the only action
                    possible: Registration. In this case, the Peer SHOULD include authorization information
                    via the ('Token-Data') TLV as described in <xref target="creds_msg_peer_init_token" />.
                    Additionally, the Peer can add the ('Profile') TLV to indicate a preferred profile
                    for the credentials.
                </t>

                <section anchor="creds_msg_peer_init_token" title="Bootstrapping Peer's Trustworthiness">
                    <t>
                        When the Peer does not have any valid credentials for the Network that it is
                        authenticating to, it does not provide any ('Credentials-Info') TLV. This indicates
                        to the Server that new credentials MUST be registered before the Peer is allowed
                        on the network.
                    </t>
                    <t>
                        The Registration process might rely on information exchanged during the
                        Provisioning Process in Phase Two. However, if an authorization mechanism
                        is not available from the supported provisioning protocol and no credentials
                        are available on the Peer, EAP-CREDS provides a simple machanism for the Peer to
                        leverage an out-of-band token/passphrase/ott that may be already available
                        on the Peer (e.g., a device certificate or a 'spendable' credentials token
                        like a kerberos ticket or a crypto-currency transaction) and that can be
                        verified by the Server.
                    </t>
                    <t>
                        In particular, when the Peer wants to register new credentials (and the Server
                        requires the use of additional authorization data) it may need to provide (a) a Token, (b) a challenge
                        value, and (c) a response to the challenge value. To do so, the Peer MUST
                        encode the token in a ('Token-Data') TLV, the challenge value in a ('Challenge-Data')
                        TLV, and, finally, the response to the challenge in the ('Challenge-Response')
                        TLV.
                    </t>
                    <t>
                        The use of ('Challenge-Data') and ('Challenge-Response') TLVs is optional, however
                        it is suggested that if a token is used for bootstrapping the trust, it should
                        provide a way to verify a secret associated with it.
                    </t>
                    <t>
                        It is also very important that the authorization token is disclosed only to
                        authorized servers - the Peer MUST NOT disclose authorization tokens that are
                        not meant for the network that is being accessed. This can be done, usually,
                        by verifying the identity of the Server first (in the outer mechanism) and then
                        verify that the target of the Token is the Server the Client is talking to.
                    </t>
                </section>

            </section>

<!--
            <section anchor="creds_msg_init_provider_tlv" title="The IdProvider TLV">
                <t>
                    The IdProvider TLV is used to convey the list of supported providers that can be
                    used for managing credentials (e.g., a list of identity providers).
                </t>
                <t>
                    The Server uses one or more IdProvider TLVs in the EAP-Request/EAP-CREDS(Type=Init)
                    message to provide the Peer with the list of supported credentials providers. The server
                    can omit the set of TLVs in case a single provider is supported (or if the selection of the
                    provider is done based on different factors - e.g., the authenticated credentials via
                    the tunneling mechanism).
                </t>
                <t>
                    The Peer, on the other hand, MAY include only one IdProvider TLV
                    in the EAP-Response/EAP-CREDS(Type=Init) message to indicate which provider
                    it wants the Server to use. The Peer MUST pick from the list provided in the
                    message from the server. If the client does not support any of the providers
                    listed in the Server's message or if no selection is provided and the Peer
                    requires a specific provider, then an EAP-Response/EAP-CREDS(Type=Init) with
                    an EAP-CREDS-Err TLV MUST be sent to the server as a response.
                </t>
            </section>
-->

        <section anchor="creds_msg_protoflow" title="The EAP-CREDS-Provisioning Message">

            <t>
                The EAP-CREDS-Provisioning message type is used in Phase Two only of EAP-CREDS. The
                message flow is depicted in <xref target="creds_phase_two" />. This message type
                supports the following TLVs: Protocol, Profile, Credentials-Info, Provisioning-Headers,
                Provisioning-Data, Token-Data, and Error.
            </t>
            <t>
                After the exchange of phase one messages, the Server
                MAY start phase two by issuing an ('EAP-CREDS-Provisioning') message for the Peer
                where it encodes all the required details for starting the provisioning process.
                In particular, the server sends the selected ('Action'), ('Protocol'), and metadata
                to the client in a EAP-Request/EAP-CREDS(Type=Provisioning) message.
                The header's 'S' bit MUST be set to '1' (Start) and the 'Phase' value set to '2'
                (Phase Two begins).
            </t>
            <t>
                <list>
                    <t>
                        NOTE WELL:
                        After the initial message, the only TLVs that are allowed in
                        messages coming from the server are the usual ('Provisioning-Headers')
                        ('Provisioning-Data'), and ('Error').
                   </t>
               </list>
            </t>
            <t>
                The client checks that all the selected parameters are supported for the selected
                credentials and, if no errors are detected, it sends its first ('EAP-CREDS-Provisioning')
                message to the Server with the ('Provisioning-Headers') and ('Provisioning-Data')
                TLVs only.
            </t>
            <t>
                From now on, the conversation between the Peer and the Server continues until
                an error is detected or the provisioning protocol completes successfully.
            </t>
            <t>
                If no other actions, the server MAY continue with phase three or issue a
                success message and terminate the EAP session.
            </t>
            <t>
                <list>
                    <t>
                        NOTE WELL:
                        When the SPP protocol is used, the protocol messages that are encoded
                        inside the ('Protocol-Data') TLV are composed of sets of TLVs as
                        defined in this document. The overall message size is provided by
                        the size of the ('Protocol-Data') TLV that encapsulates the SPP-specific
                        TLVs. This design choice provides symmetry in implementing support for
                        SPP when compared to other provisioning protocols. 
                    </t>
                </list>
            </t>

        </section>

        <section anchor="creds_msg_validate" title="The EAP-CREDS-Validate Message">
            <t>
                The EAP-CREDS-Validate message type is used in Phase Three only of EAP-CREDS. The
                message flow is depicted in <xref target="creds_phase_three" />. This message type
                supports the following TLVs: Protocol, Credentials-Info, Provisioning-Headers,
                Provisioning-Data, Token-Data, and Error.
            </t>
            <t>
                After Phase One (and/or Phase Two) ends, the Server MAY start phase three by issuing an
                ('EAP-CREDS-Validate') message for the Peer where it encodes all the required details
                for starting the validation process.
                In particular, the server sends the ('Credentials-Info'), a ('Challenge'),
                and the ('Phase-Control') TLVs in a EAP-Request/EAP-CREDS(Type=Validate) message.
                The ('Phase-Control') TLV should carry the '1' value for the 'S' bit (Start) and the
                number '3' for its value (Phase Three begins).
            </t>
            <t>
                The Peer generates the answer to the Challenge and sends back a EAP-Response/EAP-CREDS(Type=Validate)
                message with the ('Challenge-Response') and an optional ('Challenge') field (only for
                server-side validation of the symmetric credentials). If the Peer requested server-side
                validation of the credentials, the Server MUST include (if a symmetric secret) the
                response to the Peer-issued ('Challenge') TLV by computing the response and adding it
                to the ('Challenge-Response') TLV in its reply.
            </t>
            <t>
                Finally, in the last message, the Server (if Phase Three is to be ended) SHALL include
                the ('Phase-Control') TLV with the 'S' bit set to '0' (end of phase) and the value set
                to '3' (Phase Three ended).
            </t>
            <t>
                At this point, EAP-CREDS has terminated all possible operations and can be terminated.
                The Server can now terminate the EAP session successfully. In case the Peer was not
                authenticated during the tunnel establishment (i.e., no credentials were already
                available on the Peer), the Server should terminate the EAP session with a Failure
                (thus requiring the device to re-attach and authenticate to the network - phase two
                should have provided the Peer with the credentials to use for authenticating to the
                Network).
            </t>
        </section>

	    </section>

    </section>
    
    <!--                           -->
    <!-- End of EAP-CREDS Messages -->
    <!--                           -->

  <section anchor="err_handling" title="Error Handling in EAP-CREDS">
    <t>
      This section provides a description of the error handling by
      using the CREDS-Error-TLV in a CREDS message.
    </t>
  </section>

    <section anchor="eap_creds_creds" title="The Simple Provisioning Protocol (SPP)" >
      <t>
        EAP-CREDS supports a Simple Provisioning Protocol (SPP) which comprises of a series of
        messages that enable the management not only of certificates, but also of other types
        of credentials like username/password pairs, asymmetric keys, and symmetric keys.
      </t>
      <t>
        The Simple Provisioning Protocol (SPP), described in this section, behaves as any other
        provisioning protocol: its messages are encapsulated in the ('Provisioning-Data') TLVs
        in the second phase of the protocol. SPP does not make use of any ('Provisioning-Headers')
        TLVs because its messages are all self-contained (no transport-protocol specific options
        are needed).
      </t>
      <t>
        When no ('Credentials-Info') TLVs have been provided by the client, the Server knows
        that the device does not have valid credentials it wants to use to access the Network.
        In this case, EAP-CREDS/SPP supports the use of Tokens to kick-off the registration
        process. The type, format, or encoding of the Token is orthogonal to EAP-CREDS/SPP
        which treats the token as a black-box field (i.e., it SHOULD NOT try to interpret or
        parse its contents).
        <list>
            <t>
                NOTE WELL: During Phase One, the Peer MAY include the ('Token-Data') TLV
                in its EAP-CREDS-Init message to provide the needed authorization to
                register a new set of credentials. The Server might not allow the registration
                of new credentials if the required authorization (i.e., the Token) was not
                provided during the initialization phase.
            </t>
        </list>
        In the case where an authorization token is used, different usage patterns are supported.
        For tokens that require an associated verifiable proof-of-possession,
        the Peer can include a ('Challenge-Response') TLVs.
      </t>
      <t>
        The ('Challenge-Data') TLV provided by the Server MUST be used to convey the challenge data
        (usually some random value) to compute the contents of the ('Challenge-Response') TLV.
      </t>
      <t>
        The ('Challenge-Response') TLV is used, instead, to encode the response to the challenge data.
        The ('Challenge-Response') TLV is generated by the Peer and verified by the Server.
        At minimum, the ('Challenge-Response') TLV SHOULD be calculated over the values of the
        ('Token-Data') and the ('Challenge-Data') TLVs to make sure that the authentication
        covers the token's data as well.
      </t>
      <t>
        <list>
            <t>
                NOTE WELL: The use of the ('Token-Data'), ('Challenge-Data'), and ('Challenge-Response')
                TLVs in the Peer's Init message is be used only to bootstrap trust between the Server and
                the Peer. If the Server accepts the authorization information as valid, the Peer is
                enabled for registering new credentials. This should happen only when the Peer does not
                have valid credentials or when the server wants to provision a different type of
                credentials (i.e., Action=(Register)). Other methods to provide authorization information
                might be provided by the selected provisioning protocol: in this case, the Server MAY
                enable registration of new credentials when no authorization data is provided in the
                'Init' message from the client and delegate the validation of the authorization data
                during Phase Two.
            </t>
        </list>
     </t>

      <section anchor="eap_creds_spp_encoding" title="SPP Message Format">
        <t>
            The SPP Messages are constructed with zero, one, or more TLVs and encoded in the
            ('Provisioning-Data') TLV in EAP-CREDS/Provisioning message types.
            The size of the encpasulating ('Provisioning-Data') TLV
            provides the size of the whole message.
        </t>
      </section>

      <section anchor="eap_creds_spp_registration" title="SPP Message Flow">
        <figure><artwork><![CDATA[
            
 ,--------.                                 ,----------.
 |EAP Peer|                                 |EAP Server|
 `---+----'                                 `----+-----'
     | [1] EAP-Request/EAP-CREDS(Type=Provisioning) |      
     |   { Protocol(=SPP), Action,               |      
     |     [ CredsInfo ] [ Params ],             |      
     |     [ ProvData(=CredsData) ] }            |      
     | <------------------------------------------      
     |                                           |      
     | [2] EAP-Response/EAP-CREDS(Type=Provisioning)|      
     |   { [ ProvData(=CredsData) ] }            |      
     | ------------------------------------------>      
     |                                           |      
     | [3] EAP-Response/EAP-CREDS(Type=Provisioning)|      
     |   { [ ProvData(=CredsData) ] }            |      
     | <------------------------------------------      
     |                                           |      
     |                                           |      


]]></artwork></figure>

        <t>
          SPP was designed to provide an easy alternative to more complex provisioning protocols.
          When no extra flexibility is needed, SPP provides an easy-to-implement alternative that
          can handle not only certificates, but also symmetric secrets and access tokens provisioning.
          In this section we provide the generic flow of messages for SPP and specific examples for
          certificates, username/password, and token provisioning.
        </t>
        <t>
          EAP-CREDS defines several actions for a set of credentials and they are
          listed in <xref target="iana_creds_action" />.
        </t>
        <t>
          When a Peer wants to join a network it may or may not have have the needed credentials
          to do so. In case the Peer does not have valid credentials yet, the Server MAY start
          Phase Two with the intention of registering a new set of credentials. Alternatively, the
          Server MAY start Phase Two when the presented credentials information from the Peer
          triggers the Renew or the Remove action.
        </t>
        <t>[1] The Server sends EAP-Request/EAP-CREDS(Type=Provisioning)
          <list>
            <t>
              When registering new credentials, the first message from the Server, MUST not carry a ('Credentials-Info')
              TLV since there is no targeted credentials to apply the action on (i.e., for
              other actions - like 'renew' or 'remove' - the TLV would be required to identify the right set of
              credentials to renew or delete).
            </t>
            <t>
              In SPP, the Server sets the ('Protocol') TLV to SPP, the ('Action') TLV to 'Register',
              'Renew', or 'Remove'. When provisioning (or registering) new credentials for the Peer,
              the Server also sets the ('Provisioning-Params') TLV (or Params) to the
              type of credentials to be provisioned. The Server also sets any relevant constraints, and,
              optionally, the ('Profile') TLV.
            </t>
            <t>
              <list>
                <t>
                  NOTE WELL:
                  If the Peer is authorized to register a new set of credentials, then the first message
                  from the Server will have the ('Action') TLV set to 'register' and no ('Credentials-Info')
                  TLV is present in the Server's message. In case server-side generation is used, an
                  additional ('Credentials-Info') TLV MAY be encoded inside the ('Provisioning-Data') TLV.
                </t>
              </list>
            </t>
            <t>
              If the type of credentials is symmetric and the parameters call for server-side generation
              of a symmetric key share, the Server MUST also include its own generated share in a ('Credentials-Data')
              TLV inside the ('Provisioning-Data') one (the data for the provisioning protocol are
              encapsulated in the 'Provisioning-Data' TLV for any protocol used during Phase Two - SPP
              is no exception to this rule). 
            </t>
            <t>
              In case Server-side only is selected, the Server MUST send the new credentials in its message
              and include the ('Credentials-Info') TLV. If no other credentials need to be managed, the Server
              MUST end Phase Two by setting the appropriate bits in the EAP-CREDS headers as well.
            </t>
          </list>
        </t>
        <t>[2] The Peer sends EAP-Response/EAP-CREDS(Type=Provisioning)
          <list>
            <t>
              When Peer-generation is selected (either Peer-only or combined Peer and Server side) and Phase
              Two has not terminated yet, the Peer MUST
              reply to the Server's message with its own 'Provisioning' response. The response
              MUST carry either (a) its own generated share of the key in a ('Credentials-Data') TLV
              (if the credentials that are provisioned are symmetric and the configuration calls for a
              share of the key to be provided by the Peer) or (b) a PKCS#10 request in a ('Certificate-Request')
              TLV (also in this case, only if client-side generation was enabled by the Server) that
              is generated by using the parameters provided by the Server in the ('Provisioning-Params') TLV.
            </t>
          </list>
        </t>
        <t>[3] The Server sends EAP-Request/EAP-CREDS(Type=Provisioning)
          <list>
            <t>
              The last message of SPP is from the Server and it is used to deliver the finalized
              value of the credentials and/or associated metadata. In case the credentials being provisioned are
              Certificate-based, the Server MUST include the issued certificate in its reply. The
              issued credentials shall be encoded in a ('Credentials-Data') TLV inside the
              ('Provisioning-Data') one. In case that the selected format supported/selected by the Peer and
              the Server does not provide the possibility to encode the full chain (i.e., intermediate
              and Root CAs) in the response, the Server MUST add one ('Certificate-Data') TLV for each
              certificate in the chain (including the Root CA's certificate).
            </t>
            <t>
              The Server MUST include the ('Credentials-Info') TLV in its message. This provide the
              Peer with some additional data (e.g., the 'Profile' or the 'Identifier' associated
              with the credentials that were provisioned/managed).
            </t>
            <t>
              In the case where additional credentials need to be managed, the Server can continue
              Phase Two by issuing a new [1] message where the tuple Action/Credentials must be
              unique for the current EAP-CREDS session.
            </t>
            <t>
              The Server can now decide to start Phase Three (suggested if new credentials were
              provisioned or renewed) or to terminate the EAP session successfully.
            </t>
          </list>
        </t>

        <section anchor="eap_creds_spp_password" title="SPP Symmetric Secrets Management">
          <figure><artwork><![CDATA[

 ,--------.                                      ,----------.
 |EAP Peer|                                      |EAP Server|
 `---+----'                                      `----+-----'
     | [1] EAP-Request/EAP-CREDS(Type=Provisioning)      |      
     |   { Protocol(=SPP), Action, [ Creds-Info ],    |      
     |     [ Prov-Params ], [ Profile ]               |      
     |     [ Prov-Data(=[Creds-Info],[Creds-Data]) ] }|      
     | <-----------------------------------------------      
     |                                                |      
     |   [2] EAP-Response/EAP-CREDS(Type=Provisioning)   |      
     |     { [ Prov-Data(=[Creds-Data]) ] }           |      
     | ----------------------------------------------->      
     |                                                |      
     |  [3] EAP-Response/EAP-CREDS(Type=Provisioning)    |      
     |    { [ Prov-Data(=Creds-Info,[Creds-Data]) ] } |      
     | <-----------------------------------------------      
     |                                                |      
     |                                                |      

]]></artwork></figure>
          <t>
            EAP-CREDS/SPP can provision symmetric secrets (e.g, username/password, API keys, or
            SIM-based keys), tokens (e.g., username/password OAuth or Kerberos tokens), or
            asymmetric credentials (e.g., X.509 certificates or Key Pairs). This section focuses
            on provisioning symmetric secrets only.
            The message flow is provided in <xref target="eap_creds_spp_password" />
          </t>
          <t>
            EAP-CREDS/SPP provides the possibility for shared secret to be generated in different
            ways:
            <list style="numbers">
                <t>Server-Side Generated</t>
                <t>Client-Side Generated</t>
                <t>Both Client-Side and Server-Side Generated</t>
            </list>
            In particular, when initiating the second phase of the protocol, the ('Provisioning-Params')
            TLV is used to specify how to generate the secret (see <xref target="tlv_prov_params" />).
          </t>

          <section anchor="eap_creds_spp_server_side_only" title="Server Side Only Generation">
            <figure anchor="eap_creds_spp_server_side_only_fig"
              title="SPP Message Flow for Server-Side only secrets provisioning">
              <artwork><![CDATA[
[ TO BE EDITED ]
]]></artwork></figure>
            <t>
              The message flow for deploying a server-side only credential (i.e., during registration
              or renewal) consists of only one message from the server. The flow is depicted in
              <xref target="eap_creds_spp_server_side_only_fig" />.
            </t>
            <t>
              In this case, the Server sends the first Provisioning message (which is also the last one),
              which MUST carry, the following data:
              <list style="symbols">
                <t>The ('Credentials-Info') TLV that specifies the info for the provisioned secret, and</t>
                <t>The ('Protocol') TLV that specifies the provisioning protocol to be used, and</t>
                <t>The ('Action') TLV that provides the action to be performed ('Registration') or
                   ('Renew'), and</t>
                <t>The ('Provisioning-Params') TLV that provides the generation parameters to the Peer, and</t>
              </list>
              The Server also includes, encoded in the ('Provisioning-Data') TLV, the following data:
              <list>
                <t>The ('Credentials-Info') TLV that provides the metadata associated with teh generated secret</t>
                <t>The ('Credentials-Data') TLV that provides the secret that is provisioned to the Peer</t>
              </list>
              Server-side secrets' generation can be used to generate username/password combinations, API Keys,
              SIM-based credentials, or tokens.
            </t>
          </section>

          <section anchor="eap_creds_spp_client_side_only" title="Client Side Only Generation">
            <figure anchor="eap_creds_spp_client_side_only_fig" 
              title="SPP Message Flow for Client-Side only secrets provisioning">
              <artwork><![CDATA[
[ TO BE EDITED ]
]]></artwork></figure>
            <t>
              The message flow for deploying a client-side only credential (i.e., during registration
              or renewal) consists of the full three messages exchange. The flow is depicted in
              <xref target="eap_creds_spp_client_side_only_fig" />.
            </t>
            <t>
              In this case, the Server MUST include, in its first Provisioning message and encoded in the ('Provisioning-Data') TLV, the following data:
              <list style="symbols">
                <t>The ('Credentials-Info') TLV that specifies the target credentials, and</t>
                <t>The ('Protocol') TLV that specifies the provisioning protocol to be used, and</t>
                <t>The ('Action') TLV that provides the action to be performed ('Registration') or
                   ('Renew'), and</t>
                <t>The ('Provisioning-Params') TLV that provides the generation parameters to the Peer, and</t>
              </list>
              Notice that the Server does not include any ('Credentials-Data') TLV in its first message
              because the Server is not involved in the secret generation (client-side only).
            </t>
            <t>
              The Peer MUST reply with its own Provisioning message where the Peer MUST encode the following
              data in the ('Provisioning-Data') TLV:
              <list>
                <t>The ('Credentials-Data') TLV that provides the secret that is being registered</t>
              </list>
              The credentials data MUST conform to the specifications the Server provided in the
              ('Provisioning-Params') TLV.
            </t>
            <t>
              The final message is from the Server and it MUST contain (if no errors were detected), the
              following TLVs encoded, as usual, in the ('Provisioning-Data') TLV:
              <list>
                <t>The ('Credentials-Info') TLV that specifies the metadata associated with the generated secret, and</t>
                <t>The ('Credentials-Data') TLV that provides the secret that is provisioned to the Peer</t>
              </list>
            </t>
            <t>
            Client-side secrets' generation should be used with caution and an evaluation of the quality of
            the generated credentials MUST be performed to make sure that the security of the generated
            secret is adequate for accessing the network. Since evaluating the quality of a secret is
            quite a difficult tasks, the use of this generation mode MUST be evaluated carefully and
            selected accordingly to acceptable risk profiles.
          </t>
          </section>

          <section anchor="eap_creds_spp_both_side_only" title="Client and Server Side Generation">
            <t>
              When registering or renewing credentials and the secret generation is split between the Server
              (1st share) and the Peer (2nd share), the message flow is the same as 
              <xref target="eap_creds_spp_client_side_only" /> with the following exceptions:
              <list style="symbols">
                <t>
                  The Server MUST send its own share of the secret by including a ('Credentials-Data') TLV
                  in its first message.
                </t>
              </list>
              All other parameters remain the same.
            </t>
            <t>
              Co-generation of the secret is the most secure option because both parties can provide the
              required randomness in their own share of the secret.
            </t>
          </section>

      </section>


      <section anchor="eap_creds_spp_certificate" title="SPP Key Pair Provisioning">
        <t>
            EAP-CREDS/SSP defines the following flow of messages for requesting the provisioning
            of key pairs (public and private keys). 
        </t>

        <section anchor="eap_creds_spp_keys_server_side_only" title="Server Side Only Generation">
          <t>
            [ This case covers the server-side generation of KeyPair and Certificate ]
          </t>
        </section>

        <section anchor="eap_creds_spp_keys_client_side_only" title="Client Side Only Generation">
          <t>
            [ This case covers the registration of a self-signed or already available (e.g., device) certificate ]
          </t>
        </section>

        <section anchor="eap_creds_spp_keys_both_side_only" title="Client and Server Side Generation">
          <t>
            This use-case is not supported. In other words, for the provisioning of Key Pairs, the
            ('Provisioning-Params') can not have both the peer-generation and server-generation bits
            set.
          </t>
        </section>

      </section>

      <section anchor="eap_creds_spp_cert" title="SPP Certificate Provisioning">
        <t>
            EAP-CREDS/SSP defines the following flow of messages for requesting the provisioning
            of credentials. 
        </t>

        <section anchor="eap_creds_spp_cert_server_side_only" title="Server Side Only Generation">
          <t>
            [ This case covers the server-side generation of KeyPair and Certificate ]
          </t>
        </section>

        <section anchor="eap_creds_spp_cert_client_side_only" title="Client Side Only Generation">
          <t>
            [ This case covers the registration of a self-signed or already available (e.g., device) certificate ]
          </t>
        </section>

        <section anchor="eap_creds_spp_cert_both_side_only" title="Client and Server Side Generation">
          <t>
            [ This case covers the generation of the KeyPair on the Peer and the generation of the certificate
            on the Server ]
          </t>
        </section>

      </section>

      <section anchor="eap_creds_spp_token" title="SPP Token Provisioning">
        <t>
            EAP-CREDS/SSP defines the following flow of messages for requesting the provisioning
            of token-based credentials. 
        </t>

        <section anchor="eap_creds_spp_token_server_side_only" title="Server Side Only Generation">
          <t>
            [ This case covers the server-side generation of the Token and possibly associated key ]
          </t>
        </section>

        <section anchor="eap_creds_spp_token_client_side_only" title="Client Side Only Generation">
          <t>
            [ This case covers the registration of a self-signed or already available (e.g., device) certificate ]
          </t>
        </section>

        <section anchor="eap_creds_spp_token_both_side_only" title="Client and Server Side Generation">
          <t>
            [ This case covers the generation of the KeyPair on the Peer and the generation of the Token
              that cointains the reference to the key on the Server ]
          </t>
        </section>

      </section>

    </section>

  </section>

  <!--                    -->
  <!-- End of SPP Section -->
  <!--                    -->

    <section anchor="iana" title="IANA Considerations">
        <t>
            This document uses a new EAP type, EAP-CREDS, whose value (TBD) MUST be allocated by IANA from
            the EAP TYPEs subregistry of the RADIUS registry.
            This section provides guidance to the Internet Assigned Numbers Authority (IANA) regarding
            registration of values related to the EAP-CREDS protocol, in accordance with <xref target="RFC8126" />.
        </t>

        <t>
            The EAP Method Type number for EAP-CREDS needs to be assigned.
        </t>

        <t>
            This document also requires IANA to create new registries as defined in
            the following subsections.
        </t>

        <section anchor="iana_proto" title="Provisioning Protocols">

            <texttable anchor="iana_proto_table" title="EAP-CREDS Inner Protocol Identifiers">
                <ttcol align="center">Message Type</ttcol>
                <ttcol align="left">Purpose</ttcol>
                <c>0</c>
                <c>Unspecified</c>
                <c>1</c>
                <c>Simple Provisioning Protocol (SPP)</c>
                <c>2</c>
                <c>Basic Certificate Management Protocol (CMP-S)</c>
                <c>3</c>
                <c>Full Certificate Management Protocol (CMP-F)</c>
                <c>4</c>
                <c>Enrollment over Secure Transport (EST)</c>
                <c>5</c>
                <c>Certificate Management over CMS (CMC)</c>
                <c>6</c>
                <c>Automatic Certificate Management Environment (ACME)</c>
                <c>...</c>
                <c>...</c>
                <c>49141 ... 65534</c>
                <c>Vendor Specific</c>
            </texttable>

            <t>
                Assignment of new values for new cryptosuites MUST be done through
                IANA with "Specification Required" and "IESG Approval" as defined
                in <xref target="RFC8126" />.
            </t>

        </section>

        <section anchor="iana_token" title="Token Types">

            <texttable anchor="iana_token_table" title="Token Types">
                <ttcol align="center">Token Type</ttcol>
                <ttcol align="left">Description</ttcol>
                <c>0</c>
                <c>Unspecified</c>
                <c>1</c>
                <c>JWT</c>
                <c>2</c>
                <c>Kerberos</c>
                <c>3</c>
                <c>OAuth</c>
                <c>4</c>
                <c>Certificate</c>
                <c>200..254</c>
                <c>Vendor Specific</c>
            </texttable>

            <t>
                Assignment of new values for new Message Types MUST be done through
                IANA with "Expert Review" as defined in <xref target="RFC8126" />.
            </t>
        </section>

        <section anchor="iana_creds_type" title="Credentials Types">

            <texttable anchor="iana_creds_type_table" title="Credentials Types">
                <ttcol align="center">Credentials Type</ttcol>
                <ttcol align="left">Description</ttcol>
                <c>0</c>
                <c>X.509 Certificate</c>
                <c>1</c>
                <c>Public Key</c>
                <c>2</c>
                <c>Symmetric Key</c>
                <c>3</c>
                <c>Username and Password</c>
                <c>4</c>
                <c>AKA Subscriber Key</c>
                <c>5</c>
                <c>Bearer Token</c>
                <c>6</c>
                <c>One-Time Token</c>
                <c>7</c>
                <c>API Key</c>
            </texttable>

            <t>
                Assignment of new values for new Message Types MUST be done through
                IANA with "Expert Review" as defined in <xref target="RFC8126" />.
            </t>

        </section>

        <section anchor="iana_creds_algor_type" title="Credentials Algorithms">

            <texttable anchor="iana_creds_algor_type_table" title="Credentials Algorithms">
                <ttcol align="center">ID</ttcol>
                <ttcol align="left">Algorithm</ttcol>
                <c>0</c>
                <c>None</c>
                <c>1</c>
                <c>RSA</c>
                <c>2</c>
                <c>ECDSA</c>
                <c>3</c>
                <c>XMMS</c>
                <c>4</c>
                <c>AKA Subscriber Key</c>
                <c>5</c>
                <c>OAuth</c>
                <c>6</c>
                <c>Kerberos4</c>
                <c>7</c>
                <c>Kerberos5</c>
                <c>200-254</c>
                <c>Reserved</c>
            </texttable>

            <t>
                Assignment of new values for new Message Types MUST be done through
                IANA with "Expert Review" as defined in <xref target="RFC8126" />.
            </t>

        </section>

        <section anchor="iana_creds_data_type" title="Credentials Datatypes">

            <texttable anchor="iana_creds_data_type_table" title="Credentials Datatypes">
                <ttcol align="center">ID</ttcol>
                <ttcol align="left">Data Type</ttcol>
                <c>0</c>
                <c>None (Binary)</c>
                <c>1</c>
                <c>PKCS#8</c>
                <c>2</c>
                <c>PKCS#10</c>
                <c>3</c>
                <c>PKCS#12</c>
                <c>4</c>
                <c>PublicKeyInfo</c>
                <c>200-254</c>
                <c>Reserved</c>
            </texttable>

            <t>
                Assignment of new values for new Message Types MUST be done through
                IANA with "Expert Review" as defined in <xref target="RFC8126" />.
            </t>

        </section>

        <section anchor="eap_creds_challenge_types" title="Challenge Types">

            <texttable anchor="eap_creds_challenge_types_table" title="Challenge Type">
                <ttcol align="center">ID</ttcol>
                <ttcol align="left">Data Type</ttcol>
                <c>0</c>
                <c>Not Specified</c>

                <c>1</c>
                <c>EAP-CREDS-ASYMMETRIC</c>

                <c>2</c>
                <c>EAP-CREDS-SYMMETRIC</c>
            </texttable>

            <t>
                Assignment of new values for new Message Types MUST be done through
                IANA with "Expert Review" as defined in <xref target="RFC8126" />.
            </t>

        </section>

        <section anchor="iana_net_usage_type" title="Network Usage Datatypes">

            <texttable anchor="iana_net_usage_table" title="Network Usage Datatypes">
                <ttcol align="center">ID</ttcol>
                <ttcol align="left">Data Type</ttcol>
                <c>0</c>
                <c>Vendor-Specific</c>
                <c>1</c>
                <c>Manufacturer Usage Description <xref target="RFC8520" /></c>
                <c>2</c>
                <c>Network Access Granting System </c>
                <c>3</c>
                <c>Firmware Manifest</c>
                <c>4..127</c>
                <c>Reserved for Future Use</c>
            </texttable>

            <t>
                Assignment of new values for new Message Types MUST be done through
                IANA with "Expert Review" as defined in <xref target="RFC8126" />.
            </t>

        </section>

        <section anchor="iana_creds_encoding_type" title="Credentials Encoding">

            <texttable anchor="iana_creds_encoding_type_table" title="Credentials Encoding">
                <ttcol align="center">ID</ttcol>
                <ttcol align="left">Encoding</ttcol>
                <c>0</c>
                <c>None (Raw)</c>
                <c>1</c>
                <c>DER</c>
                <c>2</c>
                <c>PEM</c>
                <c>3</c>
                <c>Base64</c>
                <c>4</c>
                <c>JSON</c>
                <c>5</c>
                <c>XML</c>
                <c>6</c>
                <c>ASCII</c>
                <c>7</c>
                <c>UTF-8</c>
                <c>200-254</c>
                <c>Reserved</c>
            </texttable>

            <t>
                Assignment of new values for new Message Types MUST be done through
                IANA with "Expert Review" as defined in <xref target="RFC8126" />.
            </t>

        </section>

        <section anchor="iana_creds_action" title="Action Types">

            <texttable anchor="iana_action_table" title="Action Types">
                <ttcol align="center">ID</ttcol>
                <ttcol align="left">Data Type</ttcol>
                <ttcol align="left">Description</ttcol>
                <c>0</c>
                <c>Registration</c>
                <c>Registers New Credentials</c>
                <c>1</c>
                <c>Renewal</c>
                <c>Renew an Existing Credential</c>
                <c>2</c>
                <c>Remove</c>
                <c>Removes an Existing Credential</c>
                <c>200-254</c>
                <c>n/a</c>
                <c>Reserved</c>
            </texttable>

            <t>
                Assignment of new values for new Message Types MUST be done through
                IANA with "Expert Review" as defined in <xref target="RFC8126" />.
            </t>

        </section>

        <section anchor="iana_usage_metadata_type" title="Usage Metadata Types">

            <texttable anchor="iana_usage_metadata_type_table" title="Usage Metadata Types">
                <ttcol align="center">Type</ttcol>
                <ttcol align="left">Description</ttcol>
                <c>0</c>
                <c>Binary (Unspecified)</c>
                <c>1</c>
                <c>MUD File</c>
                <c>2</c>
                <c>TEEP Manifest</c>
            </texttable>

            <t>
                Assignment of new values for new Message Types MUST be done through
                IANA with "Expert Review" as defined in <xref target="RFC8126" />.
            </t>

        </section>

    </section>

    <section anchor="security" title="Security Considerations">
        <t>
            Several security considerations need to be explicitly considered for the system administrators
            and application developers to understand the weaknesses of the overall architecture.
        </t>
        <t>
            The most important security consideration when deploying EAP-CREDS is related to the
            security of the outer channel. In particular, EAP-CREDS assumes that the communication
            channel has been properly authenticated and that the information exchanged between
            the Peer and the Server are protected (i.e., confidentiality and integrity).
        </t>
        <t>
          For example, if certificate-based authentication is used, the server presents a
          certificate to the peer as part of the trust establishment (or negotiation).
          The peer SHOULD verify the validity of the EAP server certificate and SHOULD also
          examine the EAP server name presented in the certificate in order to determine
          whether the EAP server can be trusted.  When performing server certificate validation,
          implementations MUST provide support for the rules in <xref target="RFC5280" /> for
          validating certificates against a known trust anchor.
        </t>

    </section>

    <section anchor="acks" title="Acknowledgments">
        <t>
            The authors would like to thank everybody who provided insightful comments and helped in the
            definition of the deployment considerations.
        </t>
    </section>

</middle>

<back>
<references title='Normative References'>

    &rfc2119;
    &rfc3748;
    <!-- &rfc3986; -->
    <!-- &rfc4501; -->
    &rfc4210;
    <!-- &rfc5019; -->
    <!-- &rfc5234; -->
    &rfc5272;
    &rfc5280;
    &rfc6402;
    &rfc7030;
    <!-- &rfc7170; -->
    &rfc8126;
    &rfc8520;

</references>

<!--
<references title='Informative References'>

&ietf-acme-acme;

</references>
-->

<!--
<section anchor="ann_examples" title="EAP-CREDS Example Message Flow for Provisioning Standards">

  <section title="EAP-CREDS and CMP">
      <t>
          Describe how to use EAP-CREDS with CMP.
      </t>
  </section>

  <section title="EAP-CREDS and EST">
      <t>
          Describe how to use EAP-CREDS with EST.
      </t>
  </section>

  <section title="EAP-CREDS and CMS">
      <t>
          Describe how to use EAP-CREDS with CMS.
      </t>
  </section>

  <section title="EAP-CREDS and ACME">
      <t>
          Describe how to use EAP-CREDS with ACME.
      </t>
  </section>
</section>
-->

</back>
</rfc>



