TEEP                                                              M. Pei
Internet-Draft                                                  Symantec
Intended status: Informational                             H. Tschofenig
Expires: January 9, June 8, 2020                                        Arm Limited
                                                              D. Wheeler
                                                                   Intel
                                                                A. Atyeo
                                                               Intercede
                                                               L. Dapeng
                                                           Alibaba Group
                                                           July 08,
                                                       December 06, 2019

     Trusted Execution Environment Provisioning (TEEP) Architecture
                    draft-ietf-teep-architecture-03
                    draft-ietf-teep-architecture-04

Abstract

   A Trusted Execution Environment (TEE) is designed to provide a
   hardware-isolation mechanism to separate a regular operating system
   from security-sensitive application components. an environment that enforces
   that only authorized code can execute with that environment, and that
   any data used by such code cannot be read or tampered with by any
   code outside that environment.  This architecture document motivates
   the design and standardization of a protocol for managing the
   lifecycle of trusted applications running inside a TEE.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/. http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on January 9, June 8, 2020.

Copyright Notice

   Copyright (c) 2019 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info)
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

   This document may contain material from IETF Documents or IETF
   Contributions published or made publicly available before November
   10, 2008.  The person(s) controlling the copyright in some of this
   material may not have granted the IETF Trust the right to allow
   modifications of such material outside the IETF Standards Process.
   Without obtaining an adequate license from the person(s) controlling
   the copyright in such materials, this document may not be modified
   outside the IETF Standards Process, and derivative works of it may
   not be created outside the IETF Standards Process, except to format
   it for publication as an RFC or to translate it into languages other
   than English.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   5
   3.  Assumptions . . . . . . . . . . . . . . . . . . . . . . . . .   8
   4.  Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . .   8
     4.1.   7
     3.1.  Payment . . . . . . . . . . . . . . . . . . . . . . . . .   8
     4.2.   7
     3.2.  Authentication  . . . . . . . . . . . . . . . . . . . . .   9
     4.3.   7
     3.3.  Internet of Things  . . . . . . . . . . . . . . . . . . .   9
     4.4.   7
     3.4.  Confidential Cloud Computing  . . . . . . . . . . . . . .   9
   5.   8
   4.  Architecture  . . . . . . . . . . . . . . . . . . . . . . . .   9
     5.1.   8
     4.1.  System Components . . . . . . . . . . . . . . . . . . . .   9
     5.2.   8
     4.2.  Different Renditions of TEEP Architecture . . . . . . . .  12
     5.3.  10
     4.3.  Multiple TAMs and Relationship to TAs . . . . . . . . . .  14
     5.4.  Client  12
     4.4.  Untrusted Apps, Trusted Apps, and Personalization Data  . . .  15
     5.5.  13
     4.5.  Examples of Application Delivery Mechanisms in Existing
           TEEs  . . . . . . . . . . . . . . . . . . . . . . . . . .  16
     5.6.  TEEP Architectural Support for Client App, TA, and
           Personalization Data Delivery  14
     4.6.  Entity Relations  . . . . . . . . . . . . . . .  17
     5.7.  Entity Relations . . . . .  15
   5.  Keys and Certificate Types  . . . . . . . . . . . . . . . . .  17
     5.8.
     5.1.  Trust Anchors in TEE  . . . . . . . . . . . . . . . . . .  20
     5.9.  18
     5.2.  Trust Anchors in TAM  . . . . . . . . . . . . . . . . . .  20
     5.10. Keys and Certificate Types  . . . . . . . . . . . . . . .  21
     5.11.  18
     5.3.  Scalability . . . . . . . . . . . . . . . . . . . . . . .  23
     5.12.  18
     5.4.  Message Security  . . . . . . . . . . . . . . . . . . . .  23
     5.13. Security Domain . . . . . . . . . . .  19
   6.  TEEP Broker . . . . . . . . . .  23
     5.14. A Sample Device Setup Flow . . . . . . . . . . . . . . .  23
   6.  19
     6.1.  Role of the TEEP Broker . . . . . . . . . . . . . . . . .  20
     6.2.  TEEP Broker Implementation Consideration  . . . . . . . .  24
     6.1.  Role of the  20
       6.2.1.  TEEP Broker APIs  . . . . . . . . . . . . . . . . .  25
     6.2.  TEEP Broker Implementation Consideration  . . . . . . . .  25
       6.2.1.  20
       6.2.2.  TEEP Broker Distribution  . . . . . . . . . . . . . .  26
       6.2.2.  21
       6.2.3.  Number of TEEP Brokers  . . . . . . . . . . . . . . .  26  21
   7.  Attestation . . . . . . . . . . . . . . . . . . . . . . . . .  26  21
     7.1.  Attestation Cryptographic Properties  Information Required in TEEP Claims . . . . . . . . . .  28
     7.2.  TEEP .  23
   8.  Algorithm and Attestation Structure Agility . . . . . . . . . . . . . .  24
   9.  Security Considerations .  29
     7.3.  TEEP Attestation Claims . . . . . . . . . . . . . . . . .  31
     7.4.  TEEP Attestation Flow .  24
     9.1.  TA Trust Check at TEE . . . . . . . . . . . . . . . . .  31
     7.5.  Attestation Key Example .  24
     9.2.  One TA Multiple SP Case . . . . . . . . . . . . . . . .  31
       7.5.1.  Attestation Hierarchy Establishment: Manufacture  . .  32
       7.5.2.  Attestation Hierarchy Establishment: Device Boot  . .  32
       7.5.3.  Attestation Hierarchy Establishment: TAM  . . . . . .  32
   8.  Algorithm and Attestation Agility . . . . . . . . . . . . . .  32
   9.  Security Considerations . . . . . . . . . . . . . . . . . . .  33
     9.1.  TA Trust Check at TEE . . . . . . . .  25
     9.3.  Broker Trust Model  . . . . . . . . . .  33
     9.2.  One TA Multiple SP Case . . . . . . . . . . . . . . . . .  33
     9.3.  Broker Trust Model  . . . . . . . . . . . . . . . . . . .  34  25
     9.4.  Data Protection at TAM and TEE  . . . . . . . . . . . . .  34  25
     9.5.  Compromised CA  . . . . . . . . . . . . . . . . . . . . .  34  25
     9.6.  Compromised TAM . . . . . . . . . . . . . . . . . . . . .  34  25
     9.7.  Certificate Renewal . . . . . . . . . . . . . . . . . . .  34
   10. IANA Considerations . . . . . . . . . . .  26
     9.8.  Keeping Secrets from the TAM  . . . . . . . . . .  35
   11. Acknowledgements . . . .  26
   10. IANA Considerations . . . . . . . . . . . . . . . . . .  35
   12. References . . .  26
   11. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .  35
     12.1.  Normative  26
   12. Informative References  . . . . . . . . . . . . . . . . . .  35
     12.2.  Informative References . . . . . . . . . . . . . . . . .  35  26
   Appendix A.  History  . . . . . . . . . . . . . . . . . . . . . .  37  28
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  37  28

1.  Introduction

   Applications executing in a device are exposed to many different
   attacks intended to compromise the execution of the application, or
   reveal the data upon which those applications are operating.  These
   attacks increase with the number of other applications on the device,
   with such other applications coming from potentially untrustworthy
   sources.  The potential for attacks further increase with the
   complexity of features and applications on devices, and the
   unintended interactions among those features and applications.  The
   danger of attacks on a system increases as the sensitivity of the
   applications or data on the device increases.  As an example,
   exposure of emails from a mail client is likely to be of concern to
   its owner, but a compromise of a banking application raises even
   greater concerns.

   The Trusted Execution Environment (TEE) concept is designed to
   execute applications in a protected environment that separates
   applications inside the TEE from the regular enforces that
   only authorized code can execute with that environment, and that any
   data used by such code cannot be read or tampered with by any code
   outside that environment, including a commodity operating system and
   from other applications on the device. (if
   present).

   This separation reduces the possibility of a successful attack on
   application components and the data contained inside the TEE.
   Typically, application components are chosen to execute inside a TEE
   because those application components perform security sensitive
   operations or operate on sensitive data.  An application component
   running inside a TEE is referred to as a Trusted Application (TA),
   while a normal an application running in the
   regular operating system outside any TEE is referred to as an
   Untrusted Application (UA).

   The TEE typically uses hardware to enforce protections on the TA and
   its data, but also presents a more limited set of services to
   applications inside the TEE than is normally available to UA's running in the
   normal operating system. Untrusted
   Applications.

   But not all TEEs are the same, and different vendors may have
   different implementations of TEEs with different security properties,
   different features, and different control mechanisms to operate on
   TAs.  Some vendors may themselves market multiple different TEEs with
   different properties attuned to different markets.  A device vendor
   may integrate one or more TEEs into their devices depending on market
   needs.

   To simplify the life of developers and service providers interacting
   with TAs in a TEE, an interoperable protocol for managing TAs running
   in different TEEs of various devices is needed.  In this TEE
   ecosystem, there often arises a need for an external trusted party to
   verify the identity, claims, and rights of Service Providers(SP), Providers (SP),
   devices, and their TEEs.  This trusted third party is the Trusted
   Application Manager (TAM).

   This

   The Trusted Execution Provisioning (TEEP) protocol addresses the
   following problems:

   -  A Service Provider (SP) intending to provide services through a TA
      to users of a device needs to determine security-relevant
      information of a device before provisioning their TA to the TEE
      within the device.  Examples include  An example is the verification of the
      device 'root of trust' and the type of
      TEE included in a device.

   -  A TEE in a device needs to determine whether a Service Provider
      (SP) that wants to manage a TA in the device is authorized to
      manage TAs in the TEE, and what TAs the SP is permitted to manage.

   -  The parties involved in the protocol must be able to attest that a
      TEE is genuine and capable of providing the security protections
      required by a particular TA.

   -  A Service Provider (SP) must be able to determine if a TA exists
      (is installed) on a device (in the TEE), and if not, install the
      TA in the TEE.

   -  A Service Provider (SP) must be able to check whether a TA in a
      device's TEE is the most up-to-date version, and if not, update
      the TA in the TEE.

   -  A Service Provider (SP) must be able to remove a TA in a device's
      TEE if the SP is no longer offering such services or the services
      are being revoked from a particular user (or device).  For
      example, if a subscription or contract for a particular service
      has expired, or a payment by the user has not been completed or
      has been rescinded.

   -  A Service Provider (SP) must be able to define the relationship
      between cooperating TAs under the SP's control, and specify
      whether the TAs can communicate, share data, and/or share key
      material.

2.  Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document following terms are to be interpreted as described in BCP
   14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

   The following terms are used:

   -  Client Application: An application running used:

   -  Untrusted Application: An application running in a Rich Execution
      Environment, such as an Android, Windows, or iOS application.  We
      sometimes refer to this as the 'Client App'.

   -  Trusted Application Manager (TAM): An entity that manages Trusted
      Applications (TAs) running in different TEEs of various devices.

   -  Device: A physical piece of hardware that hosts a TEE one or more TEEs,
      often along with a Rich Execution Environment.  A Device contains
      a default list of Trust Anchors that identify entities (e.g.,
      TAMs) that are trusted by the Device.  This list is normally set
      by the Device Manufacturer, and may be governed by the Device's
      network carrier.  The list of Trust Anchors is normally modifiable
      by the Device's owner or Device Administrator.  However the Device
      manufacturer and network carrier may restrict some modifications,
      for example, by not allowing the manufacturer or carrier's Trust
      Anchor to be removed or disabled.

   -  Rich Execution Environment (REE): An environment that is provided
      and governed by a typical OS (e.g., Linux, Windows, Android, iOS),
      potentially in conjunction with other supporting operating systems
      and hypervisors; it is outside of the any TEE.  This environment and
      applications running on it are considered un-trusted. untrusted.

   -  Service Provider (SP): An entity that wishes to provide a service
      on Devices that requires the use of one or more Trusted
      Applications.  A Service Provider requires the help of a TAM in
      order to provision the Trusted Applications to remote devices.

   -  Device User: A human being that uses a device.  Many devices have
      a single device user.  Some devices have a primary device user
      with other human beings as secondary device users (e.g., parent
      allowing children to use their tablet or laptop).  Other devices
      are not used by a human being and hence have no device user.
      Relates to Device Owner and Device Administrator.

   -  Device Owner: A device is always owned by someone.  It  In some cases,
      it is common for the (primary) device user to also own the device,
      making the device user/owner also the device administrator.  In
      enterprise environments it is more common for the enterprise to
      own the device, and any device users have user has no or limited
      administration rights.  In this case, the enterprise appoints a
      device administrator that is not the device owner.

   -  Device Administrator (DA): An entity that is responsible for
      administration of a Device, which could be the device owner.  A
      Device Administrator has privileges on the Device to install and
      remove applications and TAs, approve or reject Trust Anchors, and
      approve or reject Service Providers, among possibly other
      privileges on the Device.  A Device Administrator can manage the
      list of allowed TAMs by modifying the list of Trust Anchors on the
      Device.  Although a Device Administrator may have privileges and
      Device-specific controls to locally administer a device, the
      Device Administrator may choose to remotely administrate a device
      through a TAM.

   -  Trust Anchor: A public key As defined in [RFC6024] and
      [I-D.ietf-suit-manifest], "A trust anchor represents an
      authoritative entity via a device whose corresponding private public key and associated data.  The
      public key is held by an entity implicitly trusted by used to verify digital signatures, and the device.
      associated data is used to constrain the types of information for
      which the trust anchor is authoritative."  The Trust Anchor may be
      a certificate or it may be a raw public key along with additional
      data if necessary such as its public key algorithm and parameters.  The

   -  Trust Anchor Store: As defined in [RFC6024], "A trust anchor store
      is normally a set of one or more trust anchors stored in a location that resists device.  A
      device may have more than one trust anchor store, each of which
      may be used by one or more applications."  As noted in
      [I-D.ietf-suit-manifest], a trust anchor store must resist
      modification against unauthorized modification, insertion, or
      replacement.  The digital fingerprint of deletion, and
      modification.

   -  Trusted Application (TA): An application component that runs in a Trust Anchor may
      TEE.

   -  Trusted Execution Environment (TEE): An execution environment that
      enforces that only authorized code can execute within the TEE, and
      data used by that code cannot be
      stored along read or tampered with by code
      outside the Trust Anchor certificate or public key. TEE.  A TEE also generally has a device unique
      credential that cannot be cloned.  There are multiple technologies
      that can use the fingerprint be used to uniquely identify implement a Trust
      Anchor.  The Trust Anchor private key owner can sign certificates TEE, and the level of other public keys, which conveys trust about those keys security
      achieved varies accordingly.  In addition, TEEs typically use an
      isolation mechanism between Trusted Applications to the
      device.  A certificate signed by the Trust Anchor communicates ensure that
      one TA cannot read, modify or delete the private key holder data and code of the signed certificate is trusted
      by the Trust Anchor holder, another
      TA.

3.  Use Cases

3.1.  Payment

   A payment application in a mobile device requires high security and can therefore be trusted by
   trust about the hosting device.  Trust Anchors in  Payments initiated from a mobile
   device may be updated by an authorized
      party when a Trust Anchor should be deprecated or can use a new Trust
      Anchor should be added.

   - Trusted Application (TA): An application component that runs in a
      TEE.

   -  Trusted Execution Environment (TEE): An execution environment that
      runs alongside of, but is isolated from, an REE.  A TEE has
      security capabilities and meets certain security-related
      requirements.  It protects TEE assets from general software
      attacks, defines rigid safeguards as to data and functions that a
      program can access, provide strong identification
   and resists a set proof of defined threats.  It
      should have at least the following three properties:

      (a) A device unique credential that cannot transaction.

   For a mobile payment application, some biometric identification
   information could also be cloned;

      (b) Assurance that only authorized code can run stored in the TEE;

      (c) Memory that cannot be read by code outside the a TEE.

      There are multiple technologies that  The mobile payment
   application can use such information for authentication.

   A secure user interface (UI) may be used to implement a
      TEE, and the level of security achieved varies accordingly.

   -  Root-of-Trust (RoT): A hardware or software component in a device
      that is inherently trusted to perform a certain security-critical
      function.  A RoT should be secure by design, small, and protected
      by hardware against modification or interference.  Examples of
      RoTs include software/firmware measurement and verification using
      a Trust Anchor (RoT for Verification), provide signed assertions
      using a protected attestation key (RoT for Reporting), or protect
      the storage and/or use of cryptographic keys (RoT for Storage).
      Other RoTs are possible, including RoT for Integrity, and RoT for
      Measurement.  Reference: NIST SP800-164 (Draft).

   -  Trusted Firmware (TFW): A firmware in a device that can be
      verified with a Trust Anchor by RoT for Verification.

   -  Bootloader key: This symmetric key is protected by
      electronic fuse (eFUSE) technology.  In this context it is used to
      decrypt a
      TFW private key, which belongs to a device-unique private/public
      key pair.  Not every device is equipped with a bootloader key.

   This document uses the following abbreviations:

   -  CA: Certificate Authority

   -  REE: Rich Execution Environment

   -  RoT: Root of Trust

   -  SD: Security Domain

   -  SP: Service Provider

   -  TA: Trusted Application

   -  TAM: Trusted Application Manager

   -  TEE: Trusted Execution Environment

   -  TFW: Trusted Firmware

3.  Assumptions

   This specification assumes that an applicable device is equipped with
   one or more TEEs and each TEE is pre-provisioned with a device-unique
   public/private key pair, which is securely stored.

   A TEE uses an isolation mechanism between Trusted Applications to
   ensure that one TA cannot read, modify or delete the data and code of
   another TA.

4.  Use Cases

4.1.  Payment

   A payment application in a mobile device requires high security and
   trust about the hosting device.  Payments initiated from a mobile
   device can use a Trusted Application to provide strong identification
   and proof of transaction.

   For a mobile payment application, some biometric identification
   information could also be stored in a TEE.  The mobile payment
   application can use such information for authentication.

   A secure user interface (UI) may be used in a mobile mobile device to
   prevent malicious software from stealing sensitive user input data.
   Such an application implementation often relies on a TEE for user
   input protection.

4.2.

3.2.  Authentication

   For better security of authentication, a device may store its
   sensitive authentication keys inside a TEE, providing hardware-
   protected TEE-protected
   security key strength and trusted code execution.

4.3.

3.3.  Internet of Things

   The Internet of Things (IoT) has been posing threats to networks and
   national infrastructures because of existing weak security in
   devices.  It is very desirable that IoT devices can prevent malware
   from manipulating actuators (e.g., unlocking a door), or stealing or
   modifying sensitive data such as authentication credentials in the
   device.  A TEE can be the best way to implement such IoT security
   functions.

   TEEs could be used to store variety of sensitive data for IoT
   devices.  For example, a TEE could be used in smart door locks to
   store a user's biometric information for identification, and for
   protecting access the locking mechanism.

4.4.

3.4.  Confidential Cloud Computing

   A tenant can store sensitive data in a TEE in a cloud computing
   server such that only the tenant can access the data, preventing the
   cloud hosting provider from accessing the data.  A tenant can run TAs
   inside a server TEE for secure operation and enhanced data security.
   This provides benefits not only to tenants with better data security
   but also to cloud hosting provider for reduced liability and
   increased cloud adoption.

5.

4.  Architecture

5.1.

4.1.  System Components

   The following are the main components in the system.  Full
   descriptions of components not previously defined are provided below.
   Interactions of all components are further explained in the following
   paragraphs.

   +-------------------------------------------+
   | Device                                    |
   |                          +--------+       |        Service Provider
   |    +-------------+       |        |----------+               |
   |    | TEE-1       |       | TEEP   |---------+|               |
   |    | +--------+  |  +----| Broker |       | ||   +--------+  |
   |    | | TEEP   |  |  |    |        |<---+  | |+-->|        |<-+
   |    | | Agent  |<----+    |        |    |  | |  +-|  TAM-1 |
   |    | +--------+  |       |        |<-+ |  | +->| |        |<-+
   |    |             |       +--------+  | |  |    | +--------+  |
   |    | +---+ +---+ |                   | |  |    | TAM-2  |    |
   |  +-->|TA1| |TA2| |        +-------+  | |  |    +--------+    |
   |  | | |   | |   |<---------| App-2 |--+ |  |                  |
   |  | | +---+ +---+ |    +-------+   |    |  |    Device Administrator
   |  | +-------------+    | App-1 |   |    |  |
   |  |                    |       |   |    |  |
   |  +--------------------|       |---+    |  |
   |                       |       |--------+  |
   |                       +-------+           |
   +-------------------------------------------+

                  Figure 1: Notional Architecture of TEEP

   -  Service Providers (SP) and Device Administrators (DA) utilize the
      services of a TAM to manage TAs on Devices.  SPs do not directly
      interact with devices.  DAs may elect to use a TAM for remote
      administration of TAs instead of managing each device directly.

   -  TAM:  Trusted Application Manager (TAM): A TAM is responsible for
      performing lifecycle management activity on TA's on behalf of
      Service Providers and Device Administrators.  This includes
      creation and deletion of TA's, and may include, for example, over-the-air over-
      the-air updates to keep an SP's TAs up-to-date and clean up when a
      version should be removed.  TAMs may provide services that make it
      easier for SPs or DAs to use the TAM's service to manage multiple
      devices, although that is not required of a TAM.

      The TAM performs its management of TA's through an interaction
      with a Device's TEEP Broker.  As shown in #notionalarch, Figure 1, the TAM cannot
      directly contact a Device, but must wait for a the TEEP Broker or a Client Application to
      contact the TAM requesting a particular service.  This
      architecture is intentional in order to accommodate network and
      application firewalls that normally protect user and enterprise
      devices from arbitrary connections from external network entities.

      A TAM may be publicly available for use by many SPs, or a TAM may
      be private, and accessible by only one or a limited number of SPs.
      It is expected that manufacturers and carriers will run their own
      private TAM.  Another example of a private TAM is a TAM running as
      a Software-as-a-Service (SaaS) within an SP.

      A SP or Device Administrator chooses a particular TAM based on
      whether the TAM is trusted by a Device or set of Devices.  The TAM
      is trusted by a device if the TAM's public key is an authorized
      Trust Anchor in the Device.  A SP or Device Administrator may run
      their own TAM, however the Devices they wish to manage must
      include this TAM's pubic key in the Trust Anchor list.

      A SP or Device Administrator is free to utilize multiple TAMs.
      This may be required for a SP to manage multiple different types
      of devices from different manufacturers, or devices on different
      carriers, since the Trust Anchor list on these different devices
      may contain different TAMs.  A Device Administrator may be able to
      add their own TAM's public key or certificate to the Trust Anchor
      list on all their devices, overcoming this limitation.

      Any entity is free to operate a TAM.  For a TAM to be successful,
      it must have its public key or certificate installed in Devices
      Trust Anchor list.  A TAM may set up a relationship with device
      manufacturers or carriers to have them install the TAM's keys in
      their device's Trust Anchor list.  Alternatively, a TAM may
      publish its certificate and allow Device Administrators to install
      the TAM's certificate in their devices as an after-market-action.

   -  TEEP Broker: The TEEP Broker is an application component running
      in a Rich Execution Environment (REE) that enables the message
      protocol exchange between a TAM and a TEE in a device.  The TEEP
      Broker does not process messages on behalf of a TEE, but merely is
      responsible for relaying messages from the TAM to the TEE, and for
      returning the TEE's responses to the TAM.

      A Client Application is expected to communicate with a TAM to
      request TAs that it needs to use.  The Client Application needs to
      pass the messages from the TAM to TEEs in the device.  This calls
      for a component in the REE that Client Applications can use to
      pass messages to TEEs.  The TEEP Broker is thus an application in
      the REE or software library that can relay messages from a Client
      Application to a TEE in the device.  A device usually comes with
      only one active TEE.  A TEE may provide such a Broker to the
      device manufacturer to be bundled in devices.  Such a TEE must
      also include a Broker counterpart, namely, a TEEP Agent inside the
      TEE, to parse TAM messages sent through the Broker.  A TEEP Broker
      is generally acting as a dummy relaying box with just the TEE
      interacting capability; it doesn't need and shouldn't parse
      protocol messages.

   -  TEEP Agent: the TEEP Agent is a processing module running inside a
      TEE that receives TAM requests that are relayed via a TEEP Broker
      that runs in an REE.  A TEEP Agent in the TEE may parse requests
      or forward requests to other processing modules in a TEE, which is
      up to a TEE provider's implementation.  A response message
      corresponding to a TAM request is sent by a TEEP Agent back to a
      TEEP Broker.

   -  Certification Authority (CA): Certificate-based credentials used
      for authenticating a device, a TAM and an SP.  A device embeds a
      list of root certificates (Trust Anchors), from trusted CAs that a
      TAM will be validated against.  A TAM will remotely attest a
      device by checking whether a device comes with a certificate from
      a CA that the TAM trusts.  The CAs do not need to be the same;
      different CAs can be chosen by each TAM, and different device CAs
      can be used by different device manufacturers.

5.2.

4.2.  Different Renditions of TEEP Architecture

   There is nothing prohibiting a device from implementing multiple
   TEEs.  In addition, some TEEs (for example, SGX) present themselves
   as separate containers within memory without a controlling manager
   within the TEE.  In these cases, the rich operating system Rich Execution Environment hosts
   multiple TEEP brokers, where each broker Broker manages a particular TEE or
   set of TEEs.  Enumeration and access to the appropriate broker TEEP Broker
   is up to the rich OS Rich Execution Environment and the applications. Untrusted
   Applications.  Verification that the correct TA has been reached then
   becomes a matter of properly verifying TA attestations, which are
   unforgeable.  The multiple TEE approach is shown in the diagram
   below.  For brevity, TEEP Broker 2 is shown interacting with only one
   TAM and UA, but no such limitation is intended to be implied in the
   architecture.

   +-------------------------------------------+
   | Device                                    |
   |                          +--------+       |        Service Provider
   |                          |        |----------+               |
   |    +-------------+       | TEEP   |---------+|               |
   |    | TEE-1       |   +---| Broker |       | ||   +--------+  |
   |    |             |   |   | 1      |<---+  | |+-->|        |<-+
   |    | +-------+   |   |   |        |    |  | |    |        |
   |    | | TEEP  |   |   |   |        |    |  | |    |        |
   |    | | Agent |<------+   |        |    |  | |    |        |
   |    | | 1     |   |       |        |    |  | |    |        |
   |    | +-------+   |       |        |    |  | |    |        |
   |    |             |       |        |    |  | |    |        |
   |    | +---+ +---+ |       |        |    |  | |  +-|  TAM-1 |
   |    | |TA1| |TA2| |       |        |<-+ |  | +->| |        |<-+
   |  +-->|   | |   |<---+    +--------+  | |  |    | +--------+  |
   |  | | +---+ +---+ |  |                | |  |    | TAM-2  |    |
   |  | |             |  |     +-------+  | |  |    +--------+    |
   |  | +-------------+  +-----| App-2 |--+ |  |       ^          |
   |  |                    +-------+   |    |  |       |        Device
   |  +--------------------| App-1 |   |    |  |       |   Administrator
   |                +------|       |   |    |  |       |
   |    +-----------|-+    |       |---+    |  |       |
   |    | TEE-2     | |    |       |--------+  |       |
   |    | +------+  | |    |       |------+    |       |
   |    | | TEEP |  | |    +-------+      |    |       |
   |    | | Agent|<-----+                 |    |       |
   |    | | 2    |  | | |                 |    |       |
   |    | +------+  | | |                 |    |       |
   |    |           | | |                 |    |       |
   |    | +---+     | | |                 |    |       |
   |    | |TA3|<----+ | |  +----------+   |    |       |
   |    | |   |       | |  | TEEP     |<--+    |       |
   |    | +---+       | +--| Broker   |----------------+
   |    |             |    | 2        |        |
   |    +-------------+    +----------+        |
   |                                           |
   +-------------------------------------------+

        Figure 2: Notional Architecture of TEEP wtih with multiple TEEs

   In the diagram above, TEEP Broker 1 controls interactions with the
   TA's in TEE-1, and TEEP Broker 2 controls interactions with the TA's
   in TEE-2.  This presents some challenges for a TAM in completely
   managing the device, since a TAM may not interact with all the TEEP
   Brokers on a particular platform.  In addition, since TEE's may be
   physically separated, with wholly different resources, there may be
   no need for TEEP Brokers to share information on installed TAs or
   resource usage.  However, the architecture guarantees that the TAM
   will receive all the relevant information from the TEEP Broker to
   which it communicates.

5.3.

4.3.  Multiple TAMs and Relationship to TAs

   As shown in Figure 2, the TEEP Broker provides connections from the
   TEE and the Client App Untrusted Application to one or more TAMs.  The selection
   of which TAM to communicate with is dependent on information from the Client
   App
   Untrusted Application and is directly related to the TA.

   When a SP offers a service which requires a TA, the SP associates
   that service with a specific TA.  The TA itself is digitally signed,
   protecting its integrity, but the signature also links the TA back to
   the signer.  The signer is usually the SP, but in some cases may be
   another party that the SP trusts.  The SP selects one or more TAMs
   through which to offer their service, and communicates the
   information of the service and the specific client apps Untrusted Applications
   and TAs to the TAM.

   The SP chooses TAMs based upon the markets into which the TAM can
   provide access.  There may be TAMs that provide services to specific
   types of mobile devices, or mobile device operating systems, or
   specific geographical regions or network carriers.  A SP may be
   motivated to utilize multiple TAMs for its service in order to
   maximize market penetration and availability on multiple types of
   devices.  This likely means that the same service will be available
   through multiple TAMs.

   When the SP publishes the Client App Untrusted Application to an app store or
   other app repositories, the SP binds the Client App Untrusted Application with a
   manifest that identifies what TAMs can be contacted for the TA.  In
   some situations, an SP may use only a single TAM - this is likely the
   case for enterprise applications or SPs serving a closed community.
   For broad public apps, there will likely be multiple TAMs in the
   manifest - one servicing one brand of mobile device and another
   servicing a different manufacturer, etc.  Because different devices
   and different manufacturers trust different TAMs, the manifest will
   include different TAMs that support this SP's client app Untrusted Application
   and TA.  Multiple TAMs allow the SP to provide thier their service and this
   app (and TA) to multiple different devices.

   When the a TEEP Broker receives a request to contact the TAM for a
   Client App in order from an Untrusted Application
   to install a TA, a list of TAMs TAM URIs may be provided.
   The provided for that TA, and
   the request is passed to the TEEP Broker Agent.  If the TEEP Agent decides
   that the TA needs to be installed, the TEEP Agent selects a single
   TAM URI that is consistent with the list of trusted TAMs (trust anchors) provisioned
   on the device.  For any
   client app, there should be only a single TAM for device invokes the HTTP transport for TEEP Broker to
   contact.  This is also connect to the case when
   TAM URI and begins a Client App uses multiple TAs,
   or when one TEEP protocol exchange.  When the TEEP Agent
   subsequently receives the TA depends to install and the TA's manifest
   indicates dependencies on anther TA in a software any other trusted components, each
   dependency (see
   section TBD).  The reason is can include a list of TAM URIs for the relevant
   dependency.  If such dependencies exist that are prerequisites to
   install the SP should provide TA, then the TEEP Agent recursively follows the same
   procedure for each dependency that needs to be installed or updated,
   including selecting a TAM URI that
   it places in the Client App's manifest all is consistent with the TAs that list of
   trusted TAMs provisioned on the app
   requires.  There is no benefit to going to multiple different TAMs, device, and there is no need for beginning a special TEEP
   exchange.  If multiple TAM URIs are considered trusted, only one
   needs to be contacted for a specific
   TA.

   [Note: This should always and they can be attempted in some order until
   one responds.

   Separate from the case.  When a particular device or Untrusted Application's manifest, this framework
   relies on the use of the manifest format in [I-D.ietf-suit-manifest]
   for expressing how to install the TA as well as dependencies on other
   TEE supports only a special proprietary attestation mechanism, then a
   specific TAM will components and versions.  That is, dependencies from TAs on other
   TEE components can be needed that supports that attestation scheme.
   The TAM should expressed in a SUIT manifest, including
   dependencies on any other TAs, or trusted OS code (if any), or
   trusted firmware.  Installation steps can also support standard atttestation signatures as well.
   It is highly unlikely that be expressed in a set SUIT
   manifest.

   For example, TEE's compliant with Global Platform may have a notion
   of TAs would use different
   proprietary attestation mechanisms since a TEE "security domain" (which is likley to support
   only a grouping of one such proprietary scheme.]

   [Note: This situation gets or more complex in situations where TAs
   installed on a Client
   App expects another application or device, that can share information within such a device to already have
   group) that must be created and into which one or more TAs can then
   be installed.  It is thus up to the SUIT manifest to express a
   dependency on having such a security domain existing or being created
   first, as appropriate.

   Updating a
   specific TA installed.  This situation does not occur may cause compatibility issues with SGX, but
   could occur in situations where any Untrusted
   Applications or other components that depend on the secure world maintains updated TA, just
   like updating the OS or a shared library could impact an trusted
   operating system and runs Untrusted
   Application.  Thus, an entire trusted system with multiple TAs
   running.  This requires more discussion.]

5.4.  Client implementation needs to take into account such
   issues.

4.4.  Untrusted Apps, Trusted Apps, and Personalization Data

   In TEEP, there is an explicit relationship and dependence between the
   client app
   Untrusted Application in the REE and one or more TAs in the TEE, as
   shown in Figure 2.  From the perspective of a device user, a client app  For most purposes, an Untrusted Application that
   uses one or more TA's in a TEE appears no different from any other
   untrusted application
   Untrusted Application in the REE.  However, the way the client app Untrusted
   Application and its corresponding TA's are packaged, delivered, and
   installed on the device can vary.  The variations depend on whether
   the client app Untrusted Application and TA are bundled together or are provided
   separately, and this has implications to the management of the TAs in
   the TEE.  In addition to the client app Untrusted Application and TA, the TA
   and/or TEE may require some additional data to personalize the TA to
   the service provider or the device or a user.  This personalization
   data is dependent on the TEE, the TA and the SP; an example of
   personalization data might be username and password of the device user's an account
   with the SP, or a secret symmetric key used to by the TA to communicate
   with the SP.  The personalization data must be encrypted to preserve
   the confidentiality of potentially sensitive data contained within
   it.  Other than this requirement to support confidentiality, TEEP
   place no limitations or requirements on the personalization data.

   There are three possible cases for bundling of the Client App, Untrusted
   Application, TA, and personalization data:

   1.  The Client App, Untrusted Application, TA, and personalization data are all
       bundled together in a single package by the SP and provided to
       the TEEP Broker through the TAM.

   2.  The Client App Untrusted Application and the TA are bundled together in a
       single
       binary, package, which the a TAM or a publicly accessible app store
       maintains in repository,
       maintains, and the personalization data is separately provided by
       the SP.  In this case, the personalization
       data is collected by the TAM and included in the InstallTA
       message to the TEEP Broker. SP's TAM.

   3.  All components are independent.  The device user installs the
       Client App Untrusted Application is
       installed through some independent or device-specific mechanism,
       and the TAM provides the TA and personalization data from the SP.
       Delivery of the TA and personalization data may be combined or
       separate.

5.5.

   The TEEP protocol treats the TA, any dependencies the TA has, and
   personalization data as separate components with separate
   installation steps that are expressed in SUIT manifests, and a SUIT
   manifest might contain or reference multiple binaries (see {{I-
   D.ietf-suit-manifest} for more details).  The TEEP Agent is
   responsible for handling any installation steps that need to be
   performed inside the TEE, such as decryption of private TA bianries
   or personalization data.

4.5.  Examples of Application Delivery Mechanisms in Existing TEEs

   In order to better understand these cases, it is helpful to review
   actual implementations of TEEs and their application delivery
   mechanisms.

   In Intel Software Guard Extensions (SGX), the Client App Untrusted Application
   and TA are typically bound bundled into the same binary package (Case 2).  The TA is compiled
   into the Client App binary using SGX tools, and
   exists in the binary package as a shared library (.so or .dll).  The Client App
   Untrusted Application loads the TA into an SGX enclave when the client
   Untrusted Application needs the TA.  This organization makes it easy
   to maintain compatibility between the Client App Untrusted Application and the
   TA, since they are updated together.  It is entirely possible to
   create a
   Client App an Untrusted Application that loads an external TA into an SGX
   enclave and use that TA (Case 3).  In this case, the Client App Untrusted
   Application would require a reference to an external file or download
   such a file dynamically, place the contents of the file into memory,
   and load that as a TA.  Obviously, such file or downloaded content
   must be properly formatted and signed for it to be accepted by the
   SGX TEE.  In SGX, for Case 2 and Case 3, the personalization data is
   normally loaded into the SGX enclave (the TA) after the TA has
   started.  Although Case 1 is possible with SGX, there are no
   instances of this known to be in use at this time, since such a
   construction would required require a special installation program and SGX TA
   to recieve receive the encrypted binary, decrypt it, separate it into the
   three different elements, and then install all three.  This
   installation is complex, because the Client App Untrusted Application decrypted
   inside the TEE must be passed out of the TEE to an installer in the
   REE which would install the Client App; Untrusted Application; this assumes that
   the Client App binary Untrusted Application package includes the TA code also, since
   otherwise there is a significant problem in getting the SGX encalve enclave
   code (the TA) from the TEE, through the installer and into the Client App
   Untrusted Application in a trusted fashion.  Finally, the
   personalization data would need to be sent out of the TEE (encrypted
   in an SGX encalve-to-enclave manner) to the REE's installation app,
   which would pass this data to the installed Client App, Untrusted Application,
   which would in turn send this data to the SGX enclave (TA).  This
   complexity is due to the fact that each SGX enclave is separate and
   does not have direct communication to one another.

   [NOTE: Need to add an equivalent discussion for an ARM/TZ
   implementation]

5.6.  TEEP Architectural Support for Client App, TA, other SGX enclaves.

   In ARM TrustZone based environments, the Untrusted Application and Personalization
      Data Delivery TA
   may or may not be bundled together.  This section defines TEEP support for the three different cases for
   delivery of differs from SGX since in
   TrustZone the Client App, TA, and personalization data.

   [Note: discussion of format of this single binary, and who/what TA lifetime is
   responsible for splitting these things apart, and installing not inherently tied to a specific
   Untrused Application process lifetime as occurs in SGX.  A TA is
   loaded by a trusted OS running in the
   client app into TEE, where the REE, trusted OS is
   separate from the TA into OS in the TEE, REE.  Thus Cases 2 and 3 are equally
   applicable.  In addition, it is possible for TAs to communicate with
   each other without involving the personalization
   data into the TEE or TA.  Obviously Untrusted Application, and so the decryption must be done by
   complexity of Case 1 is lower than in the TEE but this may not be supported by all TAs.]

5.7. SGX example, and so Case 1
   is possible as well though still more complex than Cases 2 and 3.

4.6.  Entity Relations

   This architecture leverages asymmetric cryptography to authenticate a
   device to a TAM.  Additionally, a TEE in a device authenticates a TAM
   and TA signer.  The provisioning of Trust Anchors to a device may be
   different from one use case to the other.  A device administrator may
   want to have the capability to control what TAs are allowed.  A
   device manufacturer enables verification of the TA signers and TAM
   providers; it may embed a list of default Trust Anchors that the
   signer of an allowed TA's signer certificate should chain to.  A
   device administrator may choose to accept a subset of the allowed TAs
   via consent or action of downloading.

   PKI    CA    -- CA                                 CA --
           |    |                                         |
           |    |                                         |
           |    |                                         |
   Device  |    |   ---    Agent / Client App   ---       |
   SW      |    |   |                             |       |
           |    |   |                             |       |
           |    |   |                             |       |
           |    -- TEE                           TAM-------
           |
           |
          FW

                            Figure 3: Entities

    (App Developer)    (App Store)    (TAM)     (Device with TEE)  (CAs)
           |                                            |
           |                               --> (Embedded TEE cert) <--
           |                                            |
           | <------------------------------  Get an app cert ----- |
           |                           | <--  Get a TAM cert ------ |
           |
   1. Build two apps:
       Client App
      Untrusted Application
          TA
           |
           |
      Client App
      Untrusted Application -- 2a. --> | ----- 3. Install -------> |
          TA ------- ----------------- 2b. Supply ------> | 4. Messaging-->|
           |                           |          |                |

                      Figure 4: 3: Developer Experience

   Figure 4 3 shows an application developer building two applications: 1)
   a rich Client
   an Untrusted Application; 2) a TA that provides some security
   functions to be run inside a TEE.  At step 2, the application
   developer uploads the Client Untrusted Application (2a) to an Application
   Store.  The Client Untrusted Application may optionally bundle the TA
   binary.  Meanwhile, the application developer may provide its TA to a
   TAM provider that will be managing the TA in various devices. 3.  A
   user will go to an Application Store to download the Client Untrusted
   Application.  The Client Untrusted Application will trigger TA installation
   by initiating communication with a TAM.  This is the step 4.  The Client
   Untrusted Application will get messages from TAM, and interacts with
   device TEE via an Agent.

   The following diagram shows a system diagram about the entity
   relationships between CAs, TAMs, SPs and devices.

           ------- Message Protocol  -----
           |                             |
           |                             |
    --------------------           ---------------   ----------
    |  REE   |  TEE    |           |    TAM      |   |  SP    |
    |  ---   |  ---    |           |    ---      |   |  --    |
    |        |         |           |             |   |        |
    | Client | TEEP    |           |      TA     |   |  TA    |
    |  Apps  | Agent   |           |     Mgmt    |   |        |
    |   |    |         |           |             |   |        |
    |   |    |  TAs    |           |             |   |        |
    |  TEEP  |         |           |             |   |        |
    | Broker | List of |           |  List of    |   |        |
    |        | Trusted |           |  Trusted    |   |        |
    |        |  TAM/SP |           |   FW/TEE    |   |        |
    |        |   CAs   |           |    CAs      |   |        |
    |        |         |           |             |   |        |
    |        |TEE Key/ |           |  TAM Key/   |   |SP Key/ |
    |        |  Cert   |           |    Cert     |   | Cert   |
    |        | FW Key/ |           |             |   |        |
    |        |  Cert   |           |             |   |        |
    --------------------           ---------------   ----------
                 |                        |              |
                 |                        |              |
           -------------              ----------      ---------
           | TEE CA    |              | TAM CA |      | SP CA |
           -------------              ----------      ---------

                              Figure 5: Keys

   In the previous diagram, different CAs can be used for different
   types of certificates.  Messages are always signed, where the signer
   key is the message originator's private key such as that of a TAM,
   the private key of trusted firmware (TFW), or a TEE's private key.

   The main components consist of main components consist of a set of standard messages created by
   a TAM to deliver TA management commands to a device, and device
   attestation and response messages created by a TEE that responds to a
   TAM's message.

   It should be noted that network communication capability is generally
   not available in TAs in today's TEE-powered devices.  The networking
   functionality must be delegated to a rich Client Application.  Client  Trusted
   Applications will need to rely on an agent a broker in the REE to interact with a
   TEE for network message exchanges.  Consequently, a TAM generally
   communicates with a Client an Untrusted Application about how it gets messages
   that originate from a TEE inside a device.  Similarly, a TA or TEE
   generally gets messages from a TAM via some Client Application,
   namely, a TEEP Broker in this protocol
   architecture, not directly from the network.

   It is imperative to have an interoperable protocol to communicate
   with different TAMs and different TEEs in different devices.  This is
   the role of the Broker, which is a software component that bridges
   communication between a TAM and a TEE.  Furthermore the Broker
   communicates with a Agent inside a TEE that is responsible to process
   TAM requests.  The Broker in REE does not need to know the actual
   content of messages except for the TEE routing information.

5.8.  Trust Anchors in TEE

   Each TEE comes with a trust store that contains a whitelist of Trust
   Anchors that are used to validate a TAM's certificate.  A TEE will
   accept

5.  Keys and Certificate Types

   This architecture leverages the following credentials, which allow
   delivering end-to-end security between a TAM to create new Security Domains and install new TAs a TEEP Agent,
   without relying on
   behalf of an SP only if any transport security.

   Figure 4 summarizes the TAM's relationships between various keys and where
   they are stored.  Each public/private key identifies an SP, TAM, or
   TEE, and gets a certificate is chained that chains up to one some CA.  A list of
   the root CA
   trusted certificates in the TEE's trust store.

   A TEE's trust store is typically preloaded at manufacturing time.  It is out of the scope in this document then used to specify how the trust anchors
   should be updated when check a new root presented certificate should be added or
   existing one should
   against.

   Different CAs can be updated or removed.  A device manufacturer is
   expected to provide its TEE trust anchors live update or out-of-band
   update to Device Administrators.

   When trust anchor update is carried out, it used for different types of certificates.  TEEP
   messages are always signed, where the signer key is imperative the message
   originator's private key such as that any
   update must maintain integrity where only authentic trust anchor list
   from of a device manufacturer TAM, or a Device Administrator is accepted.
   This calls for a complete lifecycle flow in authorizing who can make
   trust anchor update and whether a given trust anchor list are non-
   tampered from TEE's private
   key.  In addition to the original provider.  The signing of a trust anchor
   list keys shown in Figure 4, there may be
   additional keys used for integrity check and update authorization methods are
   desirable attestation.  Refer to be developed.  This can be addressed outside the RATS Architecture
   for more discussion.

                       Cardinality &                    Location of this
   architecture document.

   Before a
                        Location of    Private Key     Corresponding
   Purpose              Private Key       Signs          CA Certs
   ------------------   -----------   -------------    -------------
   Authenticating TEE    1 per TEE    TEEP responses       TAM can begin operation in

   Authenticating TAM    1 per TAM    TEEP requests     TEEP Agent

   Code Signing          1 per SP       TA binary          TEE

                              Figure 4: Keys

   The TEE key pair and certificate are used for authenticating the marketplace TEE
   to support a
   device remote TAM.  Often, the key pair is burned into the TEE by the
   TEE manufacturer and the key pair and its certificate are valid for
   the expected lifetime of the TEE.  A TAM provider is responsible for
   configuring its TAM with the manufacturer certificates or CAs that
   are used to sign TEE keys.

   The TAM key pair and certificate are used for authenticating a particular TEE, it must obtain TAM to
   a remote TEE.  A TAM provider is responsible for acquiring a
   certificate from a CA that is listed in trusted by the trust store of TEEs it manages.

   The SP key pair and certificate are used to sign TAs that the TEE.

5.9. TEE
   will consider authorized to execute.  TEEs must be configured with
   the CAs that it considers authorized to sign TAs that it will
   execute.

5.1.  Trust Anchors in TAM

   The TEE

   A TEEP Agent's Trust Anchor store in a TAM consists of contains a list of Trust Anchors,
   which are CA certificates that sign various device TEE certificates.  A TAM will accept a
   device for TA management if certificates.  The
   list is typically preloaded at manufacturing time, and can be updated
   using the TEE in TEEP protocol if the device uses a TEE
   certificate has some form of "Trust Anchor
   Manager TA" that is chained has Trust Anchors in its configuration data.  Thus,
   Trust Anchors can be updated similar to a CA that updating the TAM trusts.

5.10.  Keys and Certificate Types

   This architecture leverages the following credentials, which allow
   delivering end-to-end security without relying on any transport
   security.

   +-------------+----------+--------+-------------------+-------------+
   | Key Entity  | Location | Issuer | Checked Against   | Cardinality |
   | Name        |          |        |                   |             |
   +-------------+----------+--------+-------------------+-------------+
   | 1. TFW key  | Device   | FW CA  | A whitelist of    | 1 per       |
   | pair and    | secure   |        | FW root CA        | device      |
   | certificate | storage  |        | trusted by TAMs   |             |
   |             |          |        |                   |             |
   | 2. TEE key  | Device   | TEE CA | A whitelist of    | 1 per       |
   | pair and    | TEE      | under  | TEE root CA       | device      |
   | certificate |          | a root | trusted by TAMs   |             |
   |             |          | CA     |                   |             |
   |             |          |        |                   |             |
   | 3. TAM key  | TAM      | TAM CA | A whitelist of    | 1 or        |
   | pair and    | provider | under  | TAM root CA       | multiple    |
   | certificate |          | a root | embedded in TEE   | can be used |
   |             |          | CA     |                   | by a TAM    |
   |             |          |        |                   |             |
   | 4. SP key   | SP       | SP     | A SP uses a TAM.  | 1 or        |
   | pair and    |          | signer | TA is signed by a | multiple    |
   | certificate |          | CA     | SP signer. TEE    | can be used |
   |             |          |        | delegates trust   | by a TAM    |
   |             |          |        | of TA to TAM. SP  |             |
   |             |          |        | signer is         |             |
   |             |          |        | associated with a |             |
   |             |          |        | TA as the owner.  |             |
   +-------------+----------+--------+-------------------+-------------+

                    Figure 6: Key and Certificate Types

   1.  TFW key pair and certificate: A key pair and certificate for
       evidence of trustworthy firmware in a device.  This key pair is
       optional for TEEP architecture.  Some TEE may present its trusted
       attributes to a TAM using signed attestation with a TFW key.  For
       example, a platform that uses a hardware based TEE can have
       attestation data signed by a hardware protected TFW key.

       o  Location: Device secure storage

       o  Supported Key Type: RSA and ECC

       o  Issuer: OEM CA
       o  Checked Against: A whitelist of FW root CA trusted by TAMs

       o  Cardinality: One per device

   2.  TEE key pair and certificate: It is used for device attestation
       to a remote TAM and SP.

       o  This key pair is burned into the device by the device
          manufacturer.  The key pair and its certificate are valid for
          the expected lifetime of the device.

       o  Location: Device TEE

       o  Supported Key Type: RSA and ECC

       o  Issuer: A CA that chains to a TEE root CA

       o  Checked Against: A whitelist of TEE root CAs trusted by TAMs

       o  Cardinality: One per device

   3.  TAM key pair and certificate: A TAM provider acquires a
       certificate from a CA that a TEE trusts.

       o  Location: TAM provider

       o  Supported Key Type: RSA and ECC.

       o  Supported Key Size: RSA 2048-bit, ECC P-256 and P-384.  Other
          sizes should be anticipated in future.

       o  Issuer: TAM CA that chains to a root CA

       o  Checked Against: A whitelist of TAM root CAs embedded in a TEE

       o  Cardinality: One or multiple can be used by a TAM

   4.  SP key pair and certificate: An SP uses its own key pair and
       certificate to sign a TA.

       o  Location: SP

       o  Supported Key Type: RSA and ECC

       o  Supported Key Size: RSA 2048-bit, ECC P-256 and P-384.  Other
          sizes should be anticipated in future.

       o  Issuer: An SP signer CA that chains to a root CA
       o  Checked Against: An SP uses a TAM.  A TEE trusts an SP by
          validating trust against a TAM that the SP uses.  A TEE trusts
          a TAM to ensure that a TA is trustworthy.

       o  Cardinality: One or multiple can be used by an SP

5.11.  Scalability

   This architecture uses a PKI.  Trust Anchors exist on the devices to
   enable the TEE to authenticate TAMs, and TAMs use Trust Anchors to
   authenticate TEEs.  Since a PKI is used, many intermediate CA
   certificates can chain to a root certificate, each of which can issue
   many certificates.  This makes the protocol highly scalable.  New
   factories that produce TEEs can join the ecosystem.  In this case,
   such a factory can get an intermediate CA certificate from one of the
   existing roots without requiring that TAMs are updated with
   information about the new device factory.  Likewise, new TAMs can
   join the ecosystem, providing they are issued a TAM certificate that
   chains to an existing root whereby existing TEEs will be allowed to
   be personalized by the TAM without requiring changes to the TEE
   itself.  This enables the ecosystem to scale, and avoids the need for
   centralized databases of all TEEs produced or all TAMs that exist.

5.12.  Message Security

   Messages created by a TAM are used to deliver TA management commands
   to a device, and device attestation and messages created by the
   device TEE to respond to TAM messages.

   These messages are signed end-to-end and are typically encrypted such
   that only the targeted device TEE or TAM is able to decrypt and view
   the actual content.

5.13.  Security Domain

   No security domain (SD) is explicitly assumed in a TEE for TA
   management.  Some TEE, for example, some TEE compliant with Global
   Platform (GP), may continue to choose to use SD to organize resource
   partition and security boundaries.  It is up to a TEE implementation
   to decide how a SD is attached to a TA installation, for example, one
   SD could be created per TA.

5.14.  A Sample Device Setup Flow

   Step 1: Prepare Images for Devices

   1.  [TEE vendor] Deliver TEE Image (CODE Binary) to device OEM
   2.  [CA] Deliver root CA Whitelist

   3.  [Soc] Deliver TFW Image

   Step 2: Inject Key Pairs and Images to Devices

   1.  [OEM] Generate TFW Key Pair (May be shared among multiple
       devices)

   2.  [OEM] Flash signed TFW Image and signed TEE Image onto devices
       (signed by TFW Key)

   Step 3: Set up attestation key pairs in devices

   1.  [OEM] Flash TFW Public Key and a bootloader key.

   2.  [TFW/TEE] Generate a unique attestation key pair and get a
       certificate for the device.

   Step 4: Set up Trust Anchors in devices

   1.  [TFW/TEE] Store the key and certificate encrypted with the
       bootloader key

   2.  [TEE vendor or OEM] Store trusted CA certificate list into
       devices

6.  TEEP Broker

   A TEE and TAs do not generally have the capability to communicate to
   the outside of the hosting device.  For example, GlobalPlatform
   [GPTEE] specifies one such architecture.  This calls for a software
   module in the REE world to handle the network communication.  Each
   Client Application in the REE might carry this communication
   functionality but such functionality must also interact with the TEE
   for the message exchange.
   The TEE interaction will vary according to different TEEs.  In order
   for a Client Application to transparently support different TEEs, it
   is imperative to have a common interface for a Client Application to
   invoke for exchanging messages with TEEs.

   A shared module in REE comes to meet this need.  A TEEP broker is an
   application running in the REE of the device or an SDK that
   facilitates communication between a TAM and a TEE.  It also provides
   interfaces for Client Applications to query and trigger TA
   installation that the application needs to use.

   It isn't always that a Client Application directly calls such a
   Broker to interact with a TEE.  A REE Application Installer might
   carry out TEE and TAM interaction to install all required TAs that a
   Client Application depends.  A Client Application may have a metadata
   file that describes the TAs it depends on and the associated TAM that
   each TA installation goes to use.  The REE Application Installer can
   inspect the application metadata file and installs TAs on behalf of
   the Client Application without requiring the Client Application to
   run first.

   This interface for Client Applications or Application Installers may
   be commonly in a form of an OS service call for an REE OS.  A Client
   Application or an Application Installer interacts with the device TEE
   and the TAMs.

6.1.  Role of the TEEP Broker

   A TEEP Broker abstracts the message exchanges with a TEE in a device.
   The input data is originated from a TAM or the first initialization
   call to trigger a TA installation.

   The Broker doesn't need to parse a message content received from a
   TAM that should be processed by a TEE.  When a device has more than
   one TEE, one TEEP Broker per TEE could be present in REE.  A TEEP
   Broker interacts with a TEEP Agent inside a TEE.

   A TAM message may indicate the target TEE where a TA should be
   installed.  A compliant TEEP protocol should include a target TEE
   identifier for a TEEP Broker when multiple TEEs are present.

   The Broker relays the response messages generated from a TEEP Agent
   in a TEE to the TAM.  The Broker is not expected to handle any
   network connection with an application or TAM.

   The Broker only needs to return an error message if the TEE is not
   reachable for some reason.  Other errors are represented as response
   messages returned from the TEE which will then be passed to the TAM.

6.2.  TEEP Broker Implementation Consideration

   A Provider should consider methods of distribution, scope and
   concurrency on devices and runtime options when implementing a TEEP
   Broker.  Several non-exhaustive options are discussed below.
   Providers are encouraged to take advantage of the latest
   communication and platform capabilities to offer the best user
   experience.

6.2.1.  TEEP Broker Distribution

   The Broker installation is commonly carried out at OEM time.  A user
   can dynamically download and install a Broker on-demand.

6.2.2.  Number of TEEP Brokers

   There should be generally only one shared TEEP Broker in a device.
   The device's TEE vendor will most probably supply one Broker.  When
   multiple TEEs are present in a device, one TEEP Broker per TEE may be
   used.

   When only one Broker is used per device, the Broker provider is
   responsible to allow multiple TAMs and TEE providers to achieve
   interoperability.  With a standard Broker interface, each TAM can
   implement its own SDK configuration
   data for its SP Client Applications to work with
   this Broker.

   Multiple independent Broker providers can be used as long as they
   have standard interface to a Client Application or TAM SDK.  Only one
   Broker is generally expected in a device.

7.  Attestation

   Attestation any other TA.

   When Trust Anchor update is the process through which one entity (an attestor)
   presents a series of claims to another entity (a verifier), and
   provides sufficient proof that the claims are true.  Different
   verifiers may have different standards for attestation proofs and not
   all attestations are acceptable to every verifier.  TEEP attestations
   are based upon the use of an asymmetric key pair under the control of
   the TEE to create digital signatures across a well-defined claim set.

   In TEEP, the primary purpose of an attestation carried out, it is to allow a device
   to prove to TAMs and SPs imperative that any
   update must maintain integrity where only authentic Trust Anchor list
   from a TEE in the device has particular
   properties, was built by a particular manufacturer, or is executing a
   particular TA.  Other claims are possible; this architecture
   specification does not limit the attestation claims, but defines a
   minimal set of claims required device manufacturer or a Device Administrator is accepted.
   This calls for TEEP to operate properly.
   Extensions to these claims are possible, but are not defined a complete lifecycle flow in the
   TEEP specifications.  Other standards or groups may define the format authorizing who can make
   Trust Anchor update and semantics of extended claims.  The TEEP specification defines the
   claims format such that these extended claims may be easily included
   in whether a TEEP attestation message.

   As of the writing of this specification, device and TEE attestations
   have not been standardized across the market.  Different devices,
   manufacturers, and TEEs support different attestation algorithms and
   mechanisms.  In order for TEEP to be inclusive, given Trust Anchor list are non-
   tampered from the attestation
   format shall allow for both proprietary attestation signatures, as
   well as a standardized form of attestation signature.  Either form original provider.  The signing of
   attestation signature may be applied to a set of TEEP claims, Trust Anchor
   list for integrity check and
   both forms of attestation shall be considered conformant with TEEP.
   However, it should be recognized that not all TAMs or SPs may be able update authorization methods are
   desirable to process all proprietary forms of attestations.  All TAMs and SPs
   MUST be able to process the TEEP standard attestation format and
   attached signature.

   The attestation formats and mechanisms described and mandated by TEEP
   shall convey a particular set developed.  This can be addressed outside of cryptographic properties based on
   minimal assumptions.  The cryptographic properties are conveyed by
   the attestation; however the assumptions are not conveyed within the
   attestation itself.

   The assumptions which may apply to an attestation have this
   architecture document.

   Before a TAM can begin operation in the marketplace to do support a
   device with a particular TEE, it must obtain a TAM certificate from a
   CA that is listed in the
   quality Trust Anchor store of the attestation and the quality and security provided by
   the TEE, the device, TEE.

5.2.  Trust Anchors in TAM

   The Trust Anchor store in a TAM consists of a list of Trust Anchors,
   which are CA certificates that sign various device TEE certificates.
   A TAM will accept a device for TA management if the manufacturer, or others involved TEE in the device or
   uses a TEE ecosystem.  Some of the assumptions certificate that might apply is chained to
   an attestations include (this may not be a comprehensive list):

   -  Assumptions regarding CA that the security measures TAM trusts.

5.3.  Scalability

   This architecture uses a manufacturer takes
      when provisioning keys into devices/TEEs;

   -  Assumptions regarding what hardware and software components have
      access PKI.  Trust Anchors exist on the devices to
   enable the Attestation keys TEE to authenticate TAMs, and TAMs use Trust Anchors to
   authenticate TEEs.  Since a PKI is used, many intermediate CA
   certificates can chain to a root certificate, each of which can issue
   many certificates.  This makes the TEE;

   -  Assumptions related to protocol highly scalable.  New
   factories that produce TEEs can join the source or local verification ecosystem.  In this case,
   such a factory can get an intermediate CA certificate from one of claims
      within the
   existing roots without requiring that TAMs are updated with
   information about the new device factory.  Likewise, new TAMs can
   join the ecosystem, providing they are issued a TAM certificate that
   chains to an attestation prior existing root whereby existing TEEs will be allowed to a TEE signing a set of claims;

   -  Assumptions regarding
   be personalized by the level of protection afforded TAM without requiring changes to
      attestation keys against exfiltration, modification, and side
      channel attacks;

   -  Assumptions regarding the limitations of use applied to TEE
      Attestation keys;

   -  Assumptions regarding
   itself.  This enables the processes in place ecosystem to discover or detect
      TEE breeches; scale, and

   -  Assumptions regarding avoids the revocation and recovery process need for
   centralized databases of TEE
      attestation keys. all TEEs produced or all TAMs and SPs must be comfortable with the assumptions that are
   inherently part of any attestation they accept.  Alternatively, any exist.

5.4.  Message Security

   Messages created by a TAM or SP may choose not are used to accept an deliver TA management commands
   to a device, and device attestation generated from and messages created by the
   device TEE to respond to TAM messages.

   These messages are signed end-to-end between a
   particular manufacturer or device's TEEP Agent and a TAM,
   and are typically encrypted such that only the targeted device TEE based on or
   TAM is able to decrypt and view the inherent
   assumptions.  The choice actual content.

6.  TEEP Broker

   A TEE and policy decisions are left up TAs often do not have the capability to directly
   communicate outside of the
   particular TAM/SP.

   Some TAMs or SPs may require additional claims hosting device.  For example,
   GlobalPlatform [GPTEE] specifies one such architecture.  This calls
   for a software module in order the REE world to properly
   authorize handle network
   communication with a TAM.

   A TEEP Broker is an application component running in the REE of the
   device or an SDK that facilitates communication between a TAM and a
   TEE.  These additional claims may help clear up
   any assumptions  It also provides interfaces for which the TAM/SP wants Untrusted Applications to alleviate.  The
   specific format for these additional claims are outside query
   and trigger TA installation that the scope of
   this specification, but application needs to use.

   An Untrusted Application might communicate with the OTrP protocol SHALL allow these
   additional claims TEEP Broker at
   runtime to be included in trigger TA installation itself.  Or an Untrusted
   Application might simply have a metadata file that describes the attestation messages.

   The following sub-sections define TAs
   it depends on and the cryptographic properties
   conveyed by associated TAM(s) for each TA, and an REE
   Application Installer can inspect this application metadata file and
   invoke the TEEP attestation, Broker to trigger TA installation on behalf of the basic set
   Untrusted Application without requiring the Untrusted Application to
   run first.

6.1.  Role of TEEP claims
   required in a TEEP attestation, the TEEP attestation flow between the
   TAM Broker

   A TEEP Broker abstracts the device TEE, and some implementation examples of how an
   attestation key may be realized message exchanges with a TEE in a real TEEP device.

7.1.  Attestation Cryptographic Properties
   The attestation constructed by TEEP must convey certain cryptographic
   properties input data is originated from a TAM or the attestor first initialization
   call to the verifier; in the case of TEEP,
   the attestation must convey properties from the device trigger a TA installation.

   The Broker doesn't need to the parse a message content received from a
   TAM
   and/or SP.  The properties required that should be processed by a TEE.  When a device has more than
   one TEE, one TEEP include:

   -  Non-repudiation, Unique Proof of Source - the cryptographic
      digital signature across the attestation, and optionally along
      with information Broker per TEE could be present in REE.  A TEEP
   Broker interacts with a TEEP Agent inside a TEE.

   A TAM message may indicate the attestion itself SHALL uniquely identify target TEE where a
      specific TA should be
   installed.  A compliant TEEP protocol should include a target TEE in
   identifier for a specific device.

   -  Integrity of claims - the cryptographic digital signature across
      the attestation SHALL cover the entire attestation including all
      meta data and all TEEP Broker when multiple TEEs are present.

   The Broker relays the claims response messages generated from a TEEP Agent
   in a TEE to the attestation, ensuring that TAM.  The Broker is not expected to handle any
   network connection with an application or TAM.

   The Broker only needs to return an error message if the
      attestation has TEE is not be modified since
   reachable for some reason.  Other errors are represented as response
   messages returned from the TEE signed which will then be passed to the
      attestation.

   Standard public key algorithms such as RSA TAM.

6.2.  TEEP Broker Implementation Consideration

   A Provider should consider methods of distribution, scope and ECDSA digital
   signatures convey these properties.  Group public key algorithms such
   as EPID can also convey these properties, if the attestation includes
   a unique device identifier
   concurrency on devices and an identifier for the TEE.  Other
   cryptographic operations used in other attestation schemes may also
   convey these properties.

   The runtime options when implementing a TEEP standard attestation format SHALL use one
   Broker.  Several non-exhaustive options are discussed below.
   Providers are encouraged to take advantage of the latest
   communication and platform capabilities to offer the best user
   experience.

6.2.1.  TEEP Broker APIs

   The following
   digital signature formats:

   -  RSA-2048 with SHA-256 or SHA-384 in RSASSA-PKCS1-v1_5 or PSS
      format

   -  RSA-3072 with SHA-256 conceptual APIs exist from a TEEP Broker to a TEEP
   Agent:

   1.  RequestTA: A notification from an REE application (e.g., an
       installer, or SHA-384 in RSASSA-PKCS1-v1_5 a normal application) that it depends on a given
       TA, which may or PSS
      format

   -  ECDSA-256 using NIST P256 curve using SHA-256

   -  ECDSA-384 using NIST P384 curve using SHA-384

   -  HashEdDSA using Ed25519 with SHA-512 (Ed25519ph in RFC8032) and
      context="TEEP Attestation"

   -  EdDSA using Ed448 with SHAK256 (Ed448ph may not already be installed in RFC8032) and
      context="TEEP Attestation"

   All TAMs and SPs MUST the TEE.

   2.  ProcessTeepMessage: A message arriving from the network, to be able
       delivered to accept attestations using these
   algorithms, contingent on their acceptance of the assumptions implied
   by the attestations.

7.2. TEEP Attestation Structure

   For Agent for processing.

   3.  RequestPolicyCheck: A hint (e.g., based on a timer) that the TEEP attestation
       Agent may wish to be useful, it must contain an information
   set allowing contact the TAM and/or SP for any changes, without the
       device itself needing any particular change.

   4.  ProcessError: A notification that the TEEP Broker could not
       deliver an outbound TEEP message to assess a TAM.

   For comparison, similar APIs may exist on the attestation and make TAM side, where a
   related security policy decision.  The structure of
   Broker may or may not exist (depending on whether the TAM uses a TEE
   or not):

   1.  ProcessConnect: A notification that an incoming TEEP
   attestation session is shown in
       being requested by a TEEP Agent.

   2.  ProcessTeepMessage: A message arriving from the diagram below.

                      +------(Signed By)-----------+
                      |                            |
        /--------------------------\               V
      +---------------+-------------+--------------------------+
      | Attestation   | The         | network, to be
       delivered to the TAM for processing.

   For further discussion on these APIs, see
   [I-D.ietf-teep-otrp-over-http].

6.2.2.  TEEP Broker Distribution

   The                      |
      | Header        | Claims      | Attestation Signature(s) |
      +---------------+-------------+--------------------------+
                          |
                          |
             +------------+--(Contains)------+-----------------+--------------+
             |            |                  |                 |              |
             V            V                  V                 V              V
      +-------------+  +-------------+  +----------+   +-----------------+  +------------+
      | Device      |  | TEE         |  |          |   | Action or       |  | Additional |
      | Identifying |  | Identifying |  | Liveness |   | Operation       |  | or optional|
      | Info        |  | Info        |  | Proof    |   | Specific claims |  | Claims     |
      +-------------+  +-------------+  +----------+   +-----------------+  +------------+

                  Figure 7: Structure Broker installation is commonly carried out at OEM time.  A user
   can dynamically download and install a Broker on-demand.

6.2.3.  Number of TEEP Attestation Brokers

   There should be generally only one shared TEEP Broker in a device.
   The Attestation Header SHALL identify device's TEE vendor will most probably supply one Broker.  When
   multiple TEEs are present in a device, one TEEP Broker per TEE may be
   used.

   When only one Broker is used per device, the "Attestation Type" Broker provider is
   responsible to allow multiple TAMs and the
   "Attestation Signature Type" along TEE providers to achieve
   interoperability.  With a standard Broker interface, each TAM can
   implement its own SDK for its SP Untrusted Applications to work with
   this Broker.

   Multiple independent Broker providers can be used as long as they
   have standard interface to an "Attestation Format
   Version Number."  The "Attestation Type" identifies Untrusted Application or TAM SDK.  Only
   one Broker is generally expected in a device.

7.  Attestation

   Attestation is the minimal set
   of claims that MUST be included process through which one entity (an Attester)
   presents "evidence", in the attestation; this is an
   identifier for form of a profile series of claims, to another
   entity (a Verifier), and provides sufficient proof that defines the claims that should be
   included
   are true.  Different verifiers may have different standards for
   attestation proofs and not all attestations are acceptable to every
   verifier.  A third entity (a Relying Party) can then use "attestation
   results", in the attestation as part form of another series of claims, from a Verifier to
   make authorization decisions.

   In TEEP, as depicted in Figure 5, the "Action or Operation
   Specific Claims."  The "Attestation Signature Type" identifies the
   type primary purpose of an
   attestation signature that is attached.  The type of
   attestation signature SHALL be one of the standard signatures types
   identified by an IANA number, to allow a proprietary signature type identified
   by an IANA number, or the generic "Proprietary Signature" with an
   accompanying proprietary identifier.  Not all TAMs may be able device (the Attester) to
   process proprietary signatures.

   The claims prove to TAMs (the
   Relying Parties) that a TEE in the attestation device has particular properties,
   was built by a particular manufacturer, or is executing a particular
   TA.  Other claims are set of mandatory and optional
   claims.  The possible; TEEP does not limit the claims themselves SHALL be defined that
   may appear in an evidence or attestation
   claims dictionary.  See the next section on TEEP Attestation Claims.
   Claims are grouped in profiles under an identifier (Attestation
   Type), however all attestations require results, but defines a minimal
   set of attestation result claims which
   includes:

   -  Device Identifying Info: required for TEEP attestations must uniquely identify
      a device to the TAM and SP.  This identifier allows the TAM/SP to
      provide services unique to the device, such as managing installed
      TAs, and providing subscriptions to services, and locating device-
      specific keying material operate
   properly.  Extensions to communicate wiht these claims are possible.  Other standards
   or authenticate groups may define the
      device.  Additionally, device manufacturer information must be
      provided to provide better universal uniqueness qualities without
      requiring globally unique identifiers for all devices.

   -  TEE Identifying info: The type format and semantics of extended claims.

   +----------------+
   | Device         |            +----------+
   | +------------+ |  Evidence  |   TAM    |   Evidence    +----------+
   | |     TEE that generated this
      attestation must be identified.  Standard TEE types are identified
      by an IANA number, but also must include version identification
      information such as the hardware, firmware, and software version    |------------->| (Relying |-------------->| Verifier |
   | | (Attester) | |            |  Party)  |<--------------|          |
   | +------------+ |            +----------+  Attestation  +----------+
   +----------------+                             Result

                     Figure 5: TEEP Attestation Roles

   As of the TEE, as applicable by the writing of this specification, device and TEE type.  Structure to attestations
   have not been standardized across the
      version number is required.TEE manufacturer information market.  Different devices,
   manufacturers, and TEEs support different attestation algorithms and
   mechanisms.  In order for the
      TEE TEEP to be inclusive, it is required in order agnostic to disambiguate the same
   format of evidence, allowing proprietary or standardized formats to
   be used between a TEE type created
      by different manufacturers and resolve potential assumptions
      around manufacturer provisioning, keying and support for the TEE.

   -  Liveness Proof: a claim that includes liveness information SHALL
      be included which verifier (which may be a large nonce or may not be a timestamp and
      short nonce.

   -  Action Specific Claims: Certain
   colocated in the TAM).  However, it should be recognized that not all
   verifiers may be able to process all proprietary forms of attestation types shall include
      specific claims.  For example an
   evidence.  Similarly, the TEEP protocol is agnostic as to the format
   of attestation from a specific TA
      shall include a measurement, version results, and signing public key for the TA.

   -  Additional Claims: (Optional - May be empty set) A protocol (if any) used between the
   TAM or SP may
      require specific additional and a verifier, as long as they convey at least the required set
   of claims in order some format.

   The assumptions which may apply to address potential
      assumptions, such as an attestation have to do with the requirement that a device's REE performed
      a secure boot,
   quality of the attestation and the quality and security provided by
   the TEE, the device, the manufacturer, or that others involved in the
   device is not currenlty in a debug or
      non-productions state.  A TAM TEE ecosystem.  Some of the assumptions that might apply to
   an attestations include (this may require not be a device to provide comprehensive list):

   -  Assumptions regarding the security measures a
      device health attestation that may include some claims or
      measurements about manufacturer takes
      when provisioning keys into devices/TEEs;

   -  Assumptions regarding what hardware and software components have
      access to the Attestation keys of the TEE;

   -  Assumptions related to the REE.  These claims are TAM specific.

7.3.  TEEP Attestation Claims

   TEEP requires a set source or local verification of attestation claims that provide sufficient
   evidence
      within an attestation prior to the TAM and/or SP that the device and its a TEE meet
   certain minimal requirements.  Because attestation formats are not
   yet broadly standardized across signing a set of claims;

   -  Assumptions regarding the industry, standardization work is
   currently ongoing, and it is expected that extensions level of protection afforded to the
      attestation claims will be required as new TEEs keys against exfiltration, modification, and devices are
   created, side
      channel attacks;

   -  Assumptions regarding the set limitations of attestation claims required by TEEP SHALL be
   defined in an IANA registry.  That registry SHALL be defined in the
   OTrP protocol with sufficient elements use applied to address basic TEEP claims,
   expected new standard claims (for example from
   https://www.ietf.org/id/draft-mandyam-eat-01.txt), and proprietary
   claim sets.

7.4.  TEEP TEE
      Attestation Flow

   Attesations are required in TEEP under keys;

   -  Assumptions regarding the following flows: processes in place to discover or detect
      TEE breeches; and

   -  When a  Assumptions regarding the revocation and recovery process of TEE responds
      attestation keys.

   TAMs must be comfortable with device state information (dsi) to the assumptions that are inherently
   part of any attestation result they accept.  Alternatively, any TAM
      or SP, including a "GetDeviceState" response, "InstallTA"
      response, etc.

   -  When a new key pair is
   may choose not to accept an attestation result generated for using
   evidence from a TA-to-TAM particular manufacturer or TA-to-SP
      communication, device's TEE based on the keypair must be covered by an attestation,
      including "CreateSecurityDomain" response, "UpdateSecurityDomain"
      response, etc.

7.5.  Attestation Key Example
   inherent assumptions.  The attestation hierarchy choice and seed required for TAM protocol
   operation must be built into policy decisions are left up to
   the particular TAM.

   Some TAMs may require additional claims in order to properly
   authorize a device at manufacture.  Additional
   TEEs can be added post-manufacture using or TEE.  These additional claims may help clear up
   any assumptions for which the scheme proposed, but it
   is TAM wants to alleviate.  The specific
   format for these additional claims are outside of the current scope of this document
   specification, but the TEEP protocol allows these additional claims
   to detail that.

   It should be noted that included in the attestation scheme described is based on
   signatures.  The only decryption that may take place is through the
   use of messages.

7.1.  Information Required in TEEP Claims

   -  Device Identifying Info: TEEP attestations must uniquely identify
      a bootloader key.

   A boot module generated attestation can be optional where the
   starting point of device attestation can be at TEE certificates.  A to the TAM can define its policies on what kinds of TEE it trusts if TFW
   attestation is not included during and SP.  This identifier allows the TEE attestation.

7.5.1.  Attestation Hierarchy Establishment: Manufacture

   During manufacture TAM to
      provide services unique to the following steps are required:

   1.  A device-specific TFW key pair device, such as managing installed
      TAs, and certificate are burnt into providing subscriptions to services, and locating device-
      specific keying material to communicate with or authenticate the
      device.  This key pair will  Additionally, device manufacturer information must be used
      provided to provide better universal uniqueness qualities without
      requiring globally unique identifiers for signing operations
       performed by the boot module.

   2.  TEE images are loaded and include a all devices.

   -  TEE instance-specific key
       pair and certificate.  The key pair and certificate are included
       in the image and covered by the code signing hash.

   3. Identifying info: The process for TEE images is repeated for any subordinate TEEs,
       which are additional TEEs after the root type of TEE that some devices
       have.

7.5.2.  Attestation Hierarchy Establishment: Device Boot

   During device boot the following steps generated this
      attestation must be identified.  Standard TEE types are required:

   1.  The boot module releases the TFW private key identified
      by decrypting it
       with the bootloader key.

   2.  The boot module verifies an IANA number, but also must include version identification
      information such as the code-signing signature hardware, firmware, and software version
      of the active TEE, as applicable by the TEE and places its type.  TEE public key into a signing buffer, along
       with its identifier manufacturer
      information for later access.  For a TEE non-compliant to
       this architecture, the boot module leaves the TEE public key
       field blank.

   3.  The boot module signs the signing buffer with the TFW private
       key.

   4.  Each active TEE performs is required in order to disambiguate the
      same operation as the boot module,
       building up their own signed buffer containing subordinate TEE
       information.

7.5.3.  Attestation Hierarchy Establishment: TAM

   Before a TAM can begin operation in type created by different manufacturers and resolve
      potential assumptions around manufacturer provisioning, keying and
      support for the marketplace, it TEE.

   -  Liveness Proof: A claim that includes liveness information must obtain be
      included, such as a
   TAM certificate from nonce or timestamp.

   -  Requested Components: A list of zero or more components (TAs or
      other dependencies needed by a CA TEE) that is registered are requested by some
      depending app, but which are not currently installed in the trust store of
   devices.  In this way, the TEE can check the intermediate and root CA
   and verify that it trusts this TAM to perform operations on the TEE.

8.  Algorithm and Attestation Agility

   RFC 7696 [RFC7696] outlines the requirements to migrate from one
   mandatory-to-implement algorithm suite to another over time.  This
   feature is also known as crypto agility.  Protocol evolution is
   greatly simplified when crypto agility is already considered during
   the design of the protocol.  In the case of the Open Trust Trusted Execution
   Provisioning (TEEP) Protocol
   (OTrP) the diverse range of use cases, from
   trusted app updates for smart phones and tablets to updates of code
   on higher-end IoT devices, creates the need for different mandatory-to-implement mandatory-
   to-implement algorithms already from the start.

   Crypto agility in the OTrP TEEP concerns the use of symmetric as well as
   asymmetric algorithms.  Symmetric algorithms are used for encryption
   of content whereas the asymmetric algorithms are mostly used for
   signing messages.

   In addition to the use of cryptographic algorithms in OTrP TEEP there is
   also the need to make use of different attestation technologies.  A
   Device must provide techniques to inform a TAM about the attestation
   technology it supports.  For many deployment cases it is more likely
   for the TAM to support one or more attestation techniques whereas the
   Device may only support one.

9.  Security Considerations

9.1.  TA Trust Check at TEE

   A TA binary is signed by a TA signer certificate.  This TA signing
   certificate/private key belongs to the SP, and may be self-signed
   (i.e., it need not participate in a trust hierarchy).  It is the
   responsibility of the TAM to only allow verified TAs from trusted SPs
   into the system.  Delivery of that TA to the TEE is then the
   responsibility of the TEE, using the security mechanisms provided by
   the protocol.

   We allow a way for an (untrusted) application Untrusted Application to check the
   trustworthiness of a TA.  A TEEP Broker has a function to allow an
   application to query the information about a TA.

   An application in the Rich O/S Untrusted Application may perform verification of the TA by
   verifying the signature of the TA.  The GetTAInformation function is
   available to return the TEE supplied TA signer and TAM signer
   information to the application.  An application can do additional
   trust checks on the certificate returned for this TA.  It might trust
   the TAM, or require additional SP signer trust chaining.

9.2.  One TA Multiple SP Case

   A TA for multiple SPs must have a different identifier per SP.  They
   should appear as different TAs when they are installed in the same
   device.

9.3.  Broker Trust Model

   A TEEP Broker could be malware in the vulnerable REE.  A Client  An Untrusted
   Application will connect its TAM provider for required TA
   installation.  It gets command messages from the TAM, and passes the
   message to the Broker.

   The architecture enables the TAM to communicate with the device's TEE
   to manage TAs.  All TAM messages are signed and sensitive data is
   encrypted such that the TEEP Broker cannot modify or capture
   sensitive data.

9.4.  Data Protection at TAM and TEE

   The TEE implementation provides protection of data on the device.  It
   is the responsibility of the TAM to protect data on its servers.

9.5.  Compromised CA

   A root CA for TAM certificates might get compromised.  Some TEE trust
   anchor Trust
   Anchor update mechanism is expected from device OEMs.  A compromised
   intermediate CA is covered by OCSP stapling and OCSP validation check
   in the protocol.  A TEE should validate  TEEs are
   responsible for validating certificate revocation about a TAM
   certificate chain.

   If the root CA of some TEE device certificates is compromised, these
   devices might be rejected by a TAM, which is a decision of the TAM
   implementation and policy choice.  Any intermediate CA  TAMs are responsible for TEE device
   certificates SHOULD be validated by TAM with a Certificate Revocation
   List (CRL) or Online Certificate Status Protocol (OCSP) method.
   validating any intermediate CA for TEE device certificates.

9.6.  Compromised TAM

   The TEE SHOULD use validation of

   Device TEEs are responsible for validating the supplied TAM
   certificates and
   OCSP stapled data to validate determine that the TAM is trustworthy.

   Since PKI is used, the integrity of the clock within the TEE
   determines the ability of the TEE to reject an expired TAM
   certificate, or revoked TAM certificate.  Since OCSP stapling
   includes signature generation time, certificate validity dates are
   compared to the current time.

9.7.  Certificate Renewal

   TFW and

   TEE device certificates are expected to be long lived, longer than
   the lifetime of a device.  A TAM certificate usually has a moderate
   lifetime of 2 to 5 years.  A TAM should get renewed or rekeyed
   certificates.  The root CA certificates for a TAM, which are embedded
   into the Trust Anchor store in a device, should have long lifetimes
   that don't require device Trust Anchor update.  On the other hand, it
   is imperative that OEMs or device providers plan for support of Trust
   Anchor update in their shipped devices.

9.8.  Keeping Secrets from the TAM

   In some scenarios, it is desirable to protect the TA binary or
   configuration from being disclosed to the TAM that distributes them.
   In such a scenario, the files can be encrypted end-to-end between an
   SP and a TEE.  However, there must be some means of provisioning the
   decryption key into the TEE and/or some means of the SP securely
   learning a public key of the TEE that it can use to encrypt.  One way
   to do this is for the SP to run its own TAM, merely to distribute the
   decryption key via the TEEP protocol, and the key file can be a
   dependency in the manifest of the encrypted TA.  Thus, the TEEP Agent
   would look at the TA manifest, determine there is a dependency with a
   TAM URI of the SP's TAM.  The Agent would then install the
   dependency, and then continue with the TA installation steps,
   including decrypting the TA binary with the relevant key.

10.  IANA Considerations

   This document does not require actions by IANA.

11.  Acknowledgements

   The authors thank Dave Thaler for his very thorough review and many
   important suggestions.  Most

   Some content of this document is split from based on text in a
   previously combined previous OTrP
   protocol document [I-D.ietf-teep-opentrustprotocol].  We thank the
   former co-authors Nick Cook and Minho Yoo for the initial document
   content, and contributors Brian Witten, Tyler Kim, and Alin Mutu.

12.  References

12.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

12.2.  Informative References

   [GPTEE]    Global Platform, "GlobalPlatform Device Technology: TEE
              System Architecture, v1.1", Global Platform GPD_SPE_009,
              January 2017, <https://globalplatform.org/specs-library/
              tee-system-architecture-v1-1/>.

   [I-D.ietf-suit-manifest]
              Moran, B., Tschofenig, H., and H. Birkholz, "A Concise
              Binary Object Representation (CBOR)-based Serialization
              Format for the Software Updates for Internet of Things
              (SUIT) Manifest", draft-ietf-suit-manifest-02 (work in
              progress), November 2019.

   [I-D.ietf-teep-opentrustprotocol]
              Pei, M., Atyeo, A., Cook, N., Yoo, M., and H. Tschofenig,
              "The Open Trust Protocol (OTrP)", draft-ietf-teep-
              opentrustprotocol-03 (work in progress), May 2019.

   [I-D.ietf-teep-otrp-over-http]
              Thaler, D., "HTTP Transport for Trusted Execution
              Environment Provisioning: Agent-to- TAM Communication",
              draft-ietf-teep-otrp-over-http-03 (work in progress),
              November 2019.

   [RFC6024]  Reddy, R. and C. Wallace, "Trust Anchor Management
              Requirements", RFC 6024, DOI 10.17487/RFC6024, October
              2010, <https://www.rfc-editor.org/info/rfc6024>.

   [RFC7696]  Housley, R., "Guidelines for Cryptographic Algorithm
              Agility and Selecting Mandatory-to-Implement Algorithms",
              BCP 201, RFC 7696, DOI 10.17487/RFC7696, November 2015,
              <https://www.rfc-editor.org/info/rfc7696>.

Appendix A.  History

   RFC EDITOR: PLEASE REMOVE THIS SECTION

   IETF Drafts

   draft-00: - Initial working group document

Authors' Addresses

   Mingliang Pei
   Symantec

   EMail: mingliang_pei@symantec.com

   Hannes Tschofenig
   Arm Limited

   EMail: hannes.tschofenig@arm.com

   David Wheeler
   Intel

   EMail: david.m.wheeler@intel.com

   Andrew Atyeo
   Intercede

   EMail: andrew.atyeo@intercede.com

   Liu Dapeng
   Alibaba Group

   EMail: maxpassion@gmail.com