idnits 2.17.1 draft-ietf-teep-opentrustprotocol-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (May 15, 2019) is 1808 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'CA' is mentioned on line 502, but not defined == Missing Reference: 'Soc' is mentioned on line 504, but not defined == Missing Reference: 'OEM' is mentioned on line 516, but not defined ** Obsolete normative reference: RFC 7159 (Obsoleted by RFC 8259) == Outdated reference: A later version (-19) exists of draft-ietf-teep-architecture-02 Summary: 1 error (**), 0 flaws (~~), 5 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 TEEP M. Pei 3 Internet-Draft Symantec 4 Intended status: Informational A. Atyeo 5 Expires: November 16, 2019 Intercede 6 N. Cook 7 ARM Ltd. 8 M. Yoo 9 IoTrust 10 H. Tschofenig 11 ARM Ltd. 12 May 15, 2019 14 The Open Trust Protocol (OTrP) 15 draft-ietf-teep-opentrustprotocol-03.txt 17 Abstract 19 This document specifies the Open Trust Protocol (OTrP), a protocol 20 that follows the Trust Execution Environment Provisioning (TEEP) 21 architecture and provides a message protocol that provisions and 22 manages Trusted Applications into a device with a Trusted Execution 23 Environment (TEE). 25 Status of This Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at https://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on November 16, 2019. 42 Copyright Notice 44 Copyright (c) 2019 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (https://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 60 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 6 61 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6 62 3.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 6 63 3.2. Abbreviations . . . . . . . . . . . . . . . . . . . . . . 6 64 4. OTrP Entities and Trust Model . . . . . . . . . . . . . . . . 6 65 4.1. System Components . . . . . . . . . . . . . . . . . . . . 6 66 4.2. Trust Anchors in TEE . . . . . . . . . . . . . . . . . . 7 67 4.3. Trust Anchors in TAM . . . . . . . . . . . . . . . . . . 7 68 4.4. Keys and Certificate Types . . . . . . . . . . . . . . . 7 69 5. Protocol Scope and Entity Relations . . . . . . . . . . . . . 10 70 5.1. A Sample Device Setup Flow . . . . . . . . . . . . . . . 12 71 5.2. Derived Keys in The Protocol . . . . . . . . . . . . . . 12 72 5.3. Security Domain Hierarchy and Ownership . . . . . . . . . 13 73 5.4. SD Owner Identification and TAM Certificate Requirements 13 74 5.5. Service Provider Container . . . . . . . . . . . . . . . 14 75 6. OTrP Broker . . . . . . . . . . . . . . . . . . . . . . . . . 15 76 6.1. Role of OTrP Broker . . . . . . . . . . . . . . . . . . . 15 77 6.2. OTrP Broker and Global Platform TEE Client API . . . . . 16 78 6.3. OTrP Broker Implementation Consideration . . . . . . . . 16 79 6.3.1. OTrP Broker Distribution . . . . . . . . . . . . . . 16 80 6.3.2. Number of OTrP Broker . . . . . . . . . . . . . . . . 16 81 6.4. OTrP Broker Interfaces for Client Applications . . . . . 17 82 6.4.1. ProcessOTrPMessage call . . . . . . . . . . . . . . . 17 83 6.4.2. GetTAInformation call . . . . . . . . . . . . . . . . 17 84 6.5. Sample End-to-End Client Application Flow . . . . . . . . 20 85 6.5.1. Case 1: A New Client Application Uses a TA . . . . . 20 86 6.5.2. Case 2: A Previously Installed Client Application 87 Calls a TA . . . . . . . . . . . . . . . . . . . . . 21 88 7. OTrP Messages . . . . . . . . . . . . . . . . . . . . . . . . 22 89 7.1. Message Format . . . . . . . . . . . . . . . . . . . . . 22 90 7.2. Message Naming Convention . . . . . . . . . . . . . . . . 22 91 7.3. Request and Response Message Template . . . . . . . . . . 23 92 7.4. Signed Request and Response Message Structure . . . . . . 23 93 7.4.1. Identifying Signing and Encryption Keys for JWS/JWE 94 Messaging . . . . . . . . . . . . . . . . . . . . . . 25 95 7.5. JSON Signing and Encryption Algorithms . . . . . . . . . 25 96 7.5.1. Supported JSON Signing Algorithms . . . . . . . . . . 27 97 7.5.2. Support JSON Encryption Algorithms . . . . . . . . . 27 98 7.5.3. Supported JSON Key Management Algorithms . . . . . . 27 99 7.6. Common Errors . . . . . . . . . . . . . . . . . . . . . . 28 100 7.7. OTrP Message List . . . . . . . . . . . . . . . . . . . . 28 101 7.8. OTrP Request Message Routing Rules . . . . . . . . . . . 29 102 7.8.1. SP Anonymous Attestation Key (SP AIK) . . . . . . . . 29 103 8. Transport Protocol Support . . . . . . . . . . . . . . . . . 29 104 9. Detailed Messages Specification . . . . . . . . . . . . . . . 30 105 9.1. GetDeviceState . . . . . . . . . . . . . . . . . . . . . 30 106 9.1.1. GetDeviceStateRequest message . . . . . . . . . . . . 30 107 9.1.2. Request processing requirements at a TEE . . . . . . 31 108 9.1.3. Firmware Signed Data . . . . . . . . . . . . . . . . 32 109 9.1.3.1. Supported Firmware Signature Methods . . . . . . 33 110 9.1.4. Post Conditions . . . . . . . . . . . . . . . . . . . 33 111 9.1.5. GetDeviceStateResponse Message . . . . . . . . . . . 33 112 9.1.6. Error Conditions . . . . . . . . . . . . . . . . . . 38 113 9.1.7. TAM Processing Requirements . . . . . . . . . . . . . 39 114 9.2. Security Domain Management . . . . . . . . . . . . . . . 40 115 9.2.1. CreateSD . . . . . . . . . . . . . . . . . . . . . . 40 116 9.2.1.1. CreateSDRequest Message . . . . . . . . . . . . . 40 117 9.2.1.2. Request Processing Requirements at a TEE . . . . 43 118 9.2.1.3. CreateSDResponse Message . . . . . . . . . . . . 44 119 9.2.1.4. Error Conditions . . . . . . . . . . . . . . . . 45 120 9.2.2. UpdateSD . . . . . . . . . . . . . . . . . . . . . . 46 121 9.2.2.1. UpdateSDRequest Message . . . . . . . . . . . . . 46 122 9.2.2.2. Request Processing Requirements at a TEE . . . . 49 123 9.2.2.3. UpdateSDResponse Message . . . . . . . . . . . . 51 124 9.2.2.4. Error Conditions . . . . . . . . . . . . . . . . 52 125 9.2.3. DeleteSD . . . . . . . . . . . . . . . . . . . . . . 52 126 9.2.3.1. DeleteSDRequest Message . . . . . . . . . . . . . 53 127 9.2.3.2. Request Processing Requirements at a TEE . . . . 55 128 9.2.3.3. DeleteSDResponse Message . . . . . . . . . . . . 56 129 9.2.3.4. Error Conditions . . . . . . . . . . . . . . . . 57 130 9.3. Trusted Application Management . . . . . . . . . . . . . 57 131 9.3.1. InstallTA . . . . . . . . . . . . . . . . . . . . . . 58 132 9.3.1.1. InstallTARequest Message . . . . . . . . . . . . 59 133 9.3.1.2. InstallTAResponse Message . . . . . . . . . . . . 61 134 9.3.1.3. Error Conditions . . . . . . . . . . . . . . . . 62 135 9.3.2. UpdateTA . . . . . . . . . . . . . . . . . . . . . . 63 136 9.3.2.1. UpdateTARequest Message . . . . . . . . . . . . . 64 137 9.3.2.2. UpdateTAResponse Message . . . . . . . . . . . . 66 138 9.3.2.3. Error Conditions . . . . . . . . . . . . . . . . 67 139 9.3.3. DeleteTA . . . . . . . . . . . . . . . . . . . . . . 68 140 9.3.3.1. DeleteTARequest Message . . . . . . . . . . . . . 68 141 9.3.3.2. Request Processing Requirements at a TEE . . . . 70 142 9.3.3.3. DeleteTAResponse Message . . . . . . . . . . . . 70 143 9.3.3.4. Error Conditions . . . . . . . . . . . . . . . . 71 144 10. Response Messages a TAM May Expect . . . . . . . . . . . . . 72 145 11. Basic Protocol Profile . . . . . . . . . . . . . . . . . . . 73 146 12. Attestation Implementation Consideration . . . . . . . . . . 73 147 12.1. OTrP Trusted Firmware . . . . . . . . . . . . . . . . . 74 148 12.1.1. Attestation signer . . . . . . . . . . . . . . . . . 74 149 12.1.2. TFW Initial Requirements . . . . . . . . . . . . . . 74 150 12.2. TEE Loading . . . . . . . . . . . . . . . . . . . . . . 74 151 12.3. Attestation Hierarchy . . . . . . . . . . . . . . . . . 75 152 12.3.1. Attestation Hierarchy Establishment: Manufacture . . 75 153 12.3.2. Attestation Hierarchy Establishment: Device Boot . . 75 154 12.3.3. Attestation Hierarchy Establishment: TAM . . . . . . 76 155 13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 76 156 13.1. Error Code List . . . . . . . . . . . . . . . . . . . . 77 157 13.1.1. TEE Signed Error Code List . . . . . . . . . . . . . 77 158 14. Security Consideration . . . . . . . . . . . . . . . . . . . 78 159 14.1. Cryptographic Strength . . . . . . . . . . . . . . . . . 78 160 14.2. Message Security . . . . . . . . . . . . . . . . . . . . 79 161 14.3. TEE Attestation . . . . . . . . . . . . . . . . . . . . 79 162 14.4. TA Protection . . . . . . . . . . . . . . . . . . . . . 79 163 14.5. TA Personalization Data . . . . . . . . . . . . . . . . 80 164 14.6. TA Trust Check at TEE . . . . . . . . . . . . . . . . . 80 165 14.7. One TA Multiple SP Case . . . . . . . . . . . . . . . . 81 166 14.8. OTrP Broker Trust Model . . . . . . . . . . . . . . . . 81 167 14.9. OCSP Stapling Data for TAM Signed Messages . . . . . . . 81 168 14.10. Data Protection at TAM and TEE . . . . . . . . . . . . . 81 169 14.11. Privacy Consideration . . . . . . . . . . . . . . . . . 82 170 14.12. Threat Mitigation . . . . . . . . . . . . . . . . . . . 82 171 14.13. Compromised CA . . . . . . . . . . . . . . . . . . . . . 83 172 14.14. Compromised TAM . . . . . . . . . . . . . . . . . . . . 83 173 14.15. Certificate Renewal . . . . . . . . . . . . . . . . . . 83 174 15. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 83 175 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 84 176 16.1. Normative References . . . . . . . . . . . . . . . . . . 84 177 16.2. Informative References . . . . . . . . . . . . . . . . . 84 178 Appendix A. Sample Messages . . . . . . . . . . . . . . . . . . 85 179 A.1. Sample Security Domain Management Messages . . . . . . . 85 180 A.1.1. Sample GetDeviceState . . . . . . . . . . . . . . . . 85 181 A.1.1.1. Sample GetDeviceStateRequest . . . . . . . . . . 85 182 A.1.1.2. Sample GetDeviceStateResponse . . . . . . . . . . 85 183 A.1.2. Sample CreateSD . . . . . . . . . . . . . . . . . . . 89 184 A.1.2.1. Sample CreateSDRequest . . . . . . . . . . . . . 89 185 A.1.2.2. Sample CreateSDResponse . . . . . . . . . . . . . 92 186 A.1.3. Sample UpdateSD . . . . . . . . . . . . . . . . . . . 93 187 A.1.3.1. Sample UpdateSDRequest . . . . . . . . . . . . . 94 188 A.1.3.2. Sample UpdateSDResponse . . . . . . . . . . . . . 95 189 A.1.4. Sample DeleteSD . . . . . . . . . . . . . . . . . . . 95 190 A.1.4.1. Sample DeleteSDRequest . . . . . . . . . . . . . 95 191 A.1.4.2. Sample DeleteSDResponse . . . . . . . . . . . . . 97 192 A.2. Sample TA Management Messages . . . . . . . . . . . . . . 99 193 A.2.1. Sample InstallTA . . . . . . . . . . . . . . . . . . 99 194 A.2.1.1. Sample InstallTARequest . . . . . . . . . . . . . 99 195 A.2.1.2. Sample InstallTAResponse . . . . . . . . . . . . 100 196 A.2.2. Sample UpdateTA . . . . . . . . . . . . . . . . . . . 102 197 A.2.2.1. Sample UpdateTARequest . . . . . . . . . . . . . 102 198 A.2.2.2. Sample UpdateTAResponse . . . . . . . . . . . . . 103 199 A.2.3. Sample DeleteTA . . . . . . . . . . . . . . . . . . . 106 200 A.2.3.1. Sample DeleteTARequest . . . . . . . . . . . . . 106 201 A.2.3.2. Sample DeleteTAResponse . . . . . . . . . . . . . 108 202 A.3. Example OTrP Broker Option . . . . . . . . . . . . . . . 110 203 Appendix B. Contributors . . . . . . . . . . . . . . . . . . . . 110 204 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 110 206 1. Introduction 208 The Trusted Execution Environment (TEE) concept has been designed to 209 separate a regular operating system, also referred as a Rich 210 Execution Environment (REE), from security-sensitive applications. 211 In an TEE ecosystem, different device vendors may use different TEE 212 implementations. Different application providers or device 213 administrators may choose to use different TAM providers. There 214 calls for an interoperable protocol for managing TAs running in 215 different TEEs of various devices is needed. 217 The Trusted Execution Environment Provisioning (TEEP) architecture 218 document [TEEPArch] has set to provide a design guidance for such an 219 interoperable protocol. This document specifies an Open Trust 220 Protocol (OTrP) that follows the architecture guidance. 222 OTrP defines a mutual trust message protocol between a TAM and a TEE 223 and relies on IETF-defined end-to-end security mechanisms, namely 224 JSON Web Encryption (JWE), JSON Web Signature (JWS), and JSON Web Key 225 (JWK). Other message encoding methods may be supported. 227 This specification defines message payloads exchanged between devices 228 and a TAM. The messages are designed in anticipation of the use of 229 the most common transport methods such as HTTPS. 231 Each TA binary and configuration data can be from either of two 232 sources: 234 1. A TAM supplies the signed and encrypted TA binary and any 235 required configuration data 237 2. A Client Application supplies the TA binary 239 This specification considers the first case where TA binary and 240 configuration data are encrypted by recipient's public key that TAM 241 has to be involved. The second case will also be addressed 242 separately. 244 2. Requirements Language 246 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 247 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 248 document are to be interpreted as described in [RFC2119]. 250 3. Terminology 252 3.1. Definitions 254 The definitions provided below are defined as used in this document. 255 All the terms defined in the TEEP Architecture document [TEEPArch] 256 will be used, which are not repeated in this document. 258 OTrP Broker: It is the Broker as defined in the TEEP Architecture 259 document [TEEPArch]. 261 3.2. Abbreviations 263 CA Certificate Authority 265 OTrP Open Trust Protocol 267 REE Rich Execution Environment 269 SD Security Domain 271 SP Service Provider 273 TA Trusted Application 275 TEE Trusted Execution Environment 277 TFW Trusted Firmware 279 TAM Trusted Application Manager 281 4. OTrP Entities and Trust Model 283 4.1. System Components 285 The same system components as defined in the TEEP Architecture 286 document [TEEPArch] are used in OTrP, including TAM, CA, TEE, REE, 287 and OTrP Broker (a.k.a Broker). 289 Secure boot (for the purposes of OTrP) is optional in enabling 290 authenticity checking of TEEs by the TAM. A TAM provider can choose 291 it policy whether it trusts a TEE if the underlying firmware 292 attestation information is not included. 294 OTrP uses trust anchors to establish trust between TEEs and TAMs and 295 verifies that they communicate in a trusted way when performing 296 lifecycle management transactions. 298 4.2. Trust Anchors in TEE 300 This assumes the Trust Anchor specification defined in the TEEP 301 Architecture document [TEEPArch]. 303 Each TEE comes with a trust store that contains a whitelist of root 304 CA certificates that are used to validate a TAM's certificate. A TEE 305 will accept a TAM to create new Security Domains and install new TAs 306 on behalf of a SP only if the TAM's certificate is chained to one of 307 the root CA certificates in the TEE's trust store. 309 4.3. Trust Anchors in TAM 311 The Trust Anchor set in a TAM consists of a list of Certificate 312 Authority certificates that signs various device TEE certificates. A 313 TAM decides what TEE and optionally TFW it will trust when TFW 314 signature data is present in an attestation. 316 4.4. Keys and Certificate Types 318 OTrP leverages the following list of trust anchors and identities in 319 generating signed and encrypted command messages that are exchanged 320 between a device's TEE and a TAM. With these security artifacts, 321 OTrP Messages are able to deliver end-to-end security without relying 322 on any transport security. 324 +-------------+----------+--------+-------------------+-------------+ 325 | Key Entity | Location | Issuer | Trust Implication | Cardinality | 326 | Name | | | | | 327 +-------------+----------+--------+-------------------+-------------+ 328 | 1. TFW key | Device | FW CA | A whitelist of FW | 1 per | 329 | pair and | secure | | root CA trusted | device | 330 | certificate | storage | | by TAMs | | 331 | | | | | | 332 | 2. TEE key | Device | TEE CA | A whitelist of | 1 per | 333 | pair and | TEE | under | TEE root CA | device | 334 | certificate | | a root | trusted by TAMs | | 335 | | | CA | | | 336 | | | | | | 337 | 3. TAM key | TAM | TAM CA | A whitelist of | 1 or | 338 | pair and | provider | under | TAM root CA | multiple | 339 | certificate | | a root | embedded in TEE | can be used | 340 | | | CA | | by a TAM | 341 | | | | | | 342 | 4. SP key | SP | SP | TAM manages SP. | 1 or | 343 | pair and | | signer | TA trust is | multiple | 344 | certificate | | CA | delegated to TAM. | can be used | 345 | | | | TEE trusts TAM to | by a TAM | 346 | | | | ensure that a TA | | 347 | | | | is trustworthy. | | 348 +-------------+----------+--------+-------------------+-------------+ 350 Table 1: Key and Certificate Types 352 1. TFW key pair and certificate: A key pair and certificate for 353 evidence of trustworthy firmware in a device. This key pair is 354 optional. Some TEE may present its trusted attributes to a TAM 355 using signed attestation with a TFW key. For example, a platform 356 that uses a hardware based TEE can have attestation data signed 357 by a hardware protected TFW key. 359 Location: Device secure storage 361 Supported Key Type: RSA and ECC 363 Issuer: OEM CA 365 Trust Implication: A whitelist of FW root CA trusted by TAMs 367 Cardinality: One per device 369 2. TEE key pair and certificate: It is used for device attestation 370 to a remote TAM and SP. 372 This key pair is burned into the device at device manufacturer. 373 The key pair and its certificate are valid for the expected 374 lifetime of the device. 376 Location: Device TEE 378 Supported Key Type: RSA and ECC 380 Issuer: A CA that chains to a TEE root CA 382 Trust Implication: A whitelist of TEE root CA trusted by TAMs 384 Cardinality: One per device 386 3. TAM key pair and certificate: A TAM provider acquires a 387 certificate from a CA that a TEE trusts. 389 Location: TAM provider 391 Supported Key Type: RSA and ECC. 393 Supported Key Size: RSA 2048-bit, ECC P-256 and P-384. Other 394 sizes should be anticipated in future. 396 Issuer: TAM CA that chains to a root CA 398 Trust Implication: A whitelist of TAM root CA embedded in TEE 400 Cardinality: One or multiple can be used by a TAM 402 4. SP key pair and certificate: an SP uses its own key pair and 403 certificate to sign a TA. 405 Location: SP 407 Supported Key Type: RSA and ECC 409 Supported Key Size: RSA 2048-bit, ECC P-256 and P-384. Other 410 sizes should be anticipated in future. 412 Issuer: an SP signer CA that chains to a root CA 414 Trust Implication: TAM manages SP. TA trusts an SP by 415 validating trust against a TAM that the SP uses. A TEE trusts 416 TAM to ensure that a TA from the TAM is trustworthy. 418 Cardinality: One or multiple can be used by an SP 420 5. Protocol Scope and Entity Relations 422 This document specifies messages and key properties that can 423 establish mutual trust between a TEE and a TAM. The protocol 424 provides specifications for the following three entities: 426 1. Key and certificate types required for device firmware, TEEs, 427 TAs, SPs, and TAMs 429 2. Data message formats that should be exchanged between a TEE in a 430 device and a TAM 432 3. An OTrP Broker in the REE that can relay messages between a 433 Client Application and TEE 435 Figure 1: Protocol Scope and Entity Relationship 437 PKI CA -- CA CA -- 438 | | | 439 | | | 440 | | | 441 Device | | --- OTrP Broker / Client App --- | 442 SW | | | | | 443 | | | | | 444 | | | | | 445 OTrP | -- TEE TAM------- 446 | 447 | 448 FW 450 Figure 2: OTrP System Diagram 451 -------OTrP Message Protocol--- 452 | | 453 | | 454 -------------------- --------------- ---------- 455 | REE | TEE | | TAM | | SP | 456 | --- | --- | | --- | | -- | 457 | | | | | | | 458 | Client | SD (TAs)| | SD / TA | | TA | 459 | Apps | | | Mgmt | | | 460 | | | | | | | | 461 | | | List of | | List of | | | 462 | OTrP | Trusted | | Trusted | | | 463 | Broker | TAM/SP | | FW/TEE | | | 464 | | CAs | | CAs | | | 465 | | | | | | | 466 | |TEE Key/ | | TAM Key/ | | SP Key/| 467 | | Cert | | Cert | | Cert | 468 | | FW Key/ | | | | | 469 | | Cert | | | | | 470 -------------------- --------------- ---------- 471 | | | 472 | | | 473 ------------- ---------- --------- 474 | TEE CA | | TAM CA | | SP CA | 475 ------------- ---------- --------- 477 In the previous diagram, different Certificate Authorities can be 478 used respectively for different types of certificates. OTrP Messages 479 are always signed, where the signer keys is the message creator's 480 private key such as a FW's private key, a TEE's private key, or a 481 TAM's private key. 483 The main OTrP component consists of a set of standard JSON messages 484 created by a TAM to deliver device SD and TA management commands to a 485 device, and device attestation and response messages created by a TEE 486 that responds to a TAM's OTrP message. 488 The communication method of OTrP Messages between a TAM and TEE in a 489 device may vary between TAM and TEE providers. A mandatory transport 490 protocol is specified for a compliant TAM and a device TEE. 492 An OTrP Broker is used to bridge communication between a TAM and a 493 TEE. The OTrP Broker doesn't need to know the actual content of OTrP 494 Messages except for the TEE routing information. 496 5.1. A Sample Device Setup Flow 498 Step 1: Prepare Images for Devices 500 1. [TEE vendor] Deliver TEE Image (CODE Binary) to device OEM 502 2. [CA] Deliver root CA Whitelist 504 3. [Soc] Deliver TFW Image 506 Step 2: Inject Key Pairs and Images to Devices 508 1. [OEM] Generate Secure Boot Key Pair (May be shared among multiple 509 devices) 511 2. [OEM] Flash signed TFW Image and signed TEE Image onto devices 512 (signed by Secure Boot Key) 514 Step 3: Setup attestation key pairs in devices 516 1. [OEM] Flash TFW Public Key and a bootloader key. 518 2. [TFW/TEE] Generate a unique attestation key pair and get a 519 certificate for the device. 521 Step 4: Setup trust anchors in devices 523 1. [TFW/TEE] Store the key and certificate encrypted with the eFuse 524 key 526 2. [TEE vendor or OEM] Store trusted CA certificate list into 527 devices 529 5.2. Derived Keys in The Protocol 531 The protocol generates one key pair in run time to assist message 532 communication and anonymous verification between a TAM and a TEE. 534 TEE SP Anonymous Key (AIK): one derived key pair per SP in a device 536 The purpose of the key pair is to sign data by a TEE without using 537 its TEE device key for anonymous attestation to a Client Application. 538 This key pair is generated in the first SD creation for an SP. It is 539 deleted when all SDs are removed for a SP in a device. The public 540 key of the key pair is given to the caller Client Application and TAM 541 for future TEE returned data validation. The public key of this AIK 542 is also used by a TAM to encrypt TA binary data and personalization 543 data when it sends a TA to a device for installation. 545 5.3. Security Domain Hierarchy and Ownership 547 The primary job of a TAM is to help an SP to manage its trusted 548 application components. A TA is typically installed in an SD. An SD 549 is commonly created for an SP. 551 When an SP delegates its SD and TA management to a TAM, an SD is 552 created on behalf of a TAM in a TEE and the owner of the SD is 553 assigned to the TAM. An SD may be associated with an SP but the TAM 554 has full privilege to manage the SD for the SP. 556 Each SD for an SP is associated with only one TAM. When an SP 557 changes TAM, a new SP SD must be created to associate with the new 558 TAM. The TEE will maintain a registry of TAM ID and SP SD ID 559 mapping. 561 From an SD ownership perspective, the SD tree is flat and there is 562 only one level. An SD is associated with its owner. It is up to TEE 563 implementation how it maintains SD binding information for a TAM and 564 different SPs under the same TAM. 566 It is an important decision in this protocol specification that a TEE 567 doesn't need to know whether a TAM is authorized to manage the SD for 568 an SP. This authorization is implicitly triggered by an SP Client 569 Application, which instructs what TAM it wants to use. An SD is 570 always associated with a TAM in addition to its SP ID. A rogue TAM 571 isn't able to do anything on an unauthorized SP's SD managed by 572 another TAM. 574 Since a TAM may support multiple SPs, sharing the same SD name for 575 different SPs creates a dependency in deleting an SD. An SD can be 576 deleted only after all TAs associated with this SD is deleted. An SP 577 cannot delete a Security Domain on its own with a TAM if a TAM 578 decides to introduce such sharing. There are cases where multiple 579 virtual SPs belong to the same organization, and a TAM chooses to use 580 the same SD name for those SPs. This is totally up to the TAM 581 implementation and out of scope of this specification. 583 5.4. SD Owner Identification and TAM Certificate Requirements 585 There is a need of cryptographically binding proof about the owner of 586 an SD in a device. When an SD is created on behalf of a TAM, a 587 future request from the TAM must present itself as a way that the TEE 588 can verify it is the true owner. The certificate itself cannot 589 reliably used as the owner because TAM may change its certificate. 591 To this end, each TAM will be associated with a trusted identifier 592 defined as an attribute in the TAM certificate. This field is kept 593 the same when the TAM renew its certificates. A TAM CA is 594 responsible to vet the requested TAM attribute value. 596 This identifier value must not collide among different TAM providers, 597 and one TAM shouldn't be able to claim the identifier used by another 598 TAM provider. 600 The certificate extension name to carry the identifier can initially 601 use SubjectAltName:registeredID. A dedicated new extension name may 602 be registered later. 604 One common choice of the identifier value is the TAM's service URL. 605 A CA can verify the domain ownership of the URL with the TAM in the 606 certificate enrollment process. 608 A TEE can assign this certificate attribute value as the TAM owner ID 609 for the SDs that are created for the TAM. 611 An alternative way to represent an SD ownership by a TAM is to have a 612 unique secret key upon SD creation such that only the creator TAM is 613 able to produce a Proof-of-Possession (POP) data with the secret. 615 5.5. Service Provider Container 617 A sample Security Domain hierarchy for the TEE is shown below. 619 ---------- 620 | TEE | 621 ---------- 622 | 623 | ---------- 624 |----------| SP1 SD1 | 625 | ---------- 626 | ---------- 627 |----------| SP1 SD2 | 628 | ---------- 629 | ---------- 630 |----------| SP2 SD1 | 631 ---------- 633 OTrP segregates SDs and TAs such that a TAM can only manage or 634 retrieve data for SDs and TAs that it previously created for the SPs 635 it represents. 637 6. OTrP Broker 639 A TEE and TAs that run inside the TEE don't generally have capability 640 to communicate to the outside of the hosting device, for example, the 641 TEE specified by Global Platform groups [GPTEE]. This calls for a 642 software module in the REE world to handle the network communication. 643 Each Client Application in REE may carry this communication 644 functionality but it must also interact with the TEE for the message 645 exchange. The TEE interaction will vary according to different TEEs. 646 In order for a Client Application to transparently support different 647 TEEs, it is imperative to have a common interface for a Client 648 Application to invoke for exchanging messages with TEEs. 650 A shared OTrP Broker comes to meed this need. An OTrP Broker is a 651 Rich Application or SDK that facilitates communication between a TAM 652 and TEE. It also provides interfaces for TAM SDK or Client 653 Applications to query and trigger TA installation that the 654 application needs to use. 656 This interface for Client Applications may be commonly an Android 657 service call for an Android powered device. A Client Application 658 interacts with a TAM, and turns around to pass messages received from 659 TAM to OTrP Broker. 661 In all cases, a Client Application needs to be able to identify an 662 OTrP Broker that it can use. 664 6.1. Role of OTrP Broker 666 An OTrP Broker abstracts the message exchanges with the TEE in a 667 device. The input data is originated from a TAM that a Client 668 Application connects. A Client Application may also directly call 669 OTrP Broker for some TA query functions. 671 OTrP Broker may internally process a request from TAM. At least, it 672 needs to know where to route a message, e.g. TEE instance. It 673 doesn't need to process or verify message content. 675 OTrP Broker returns TEE / TFW generated response messages to the 676 caller. OTrP Broker isn't expected to handle any network connection 677 with an application or TAM. 679 OTrP Broker only needs to return an OTrP Broker error message if the 680 TEE is not reachable for some reason. Other errors are represented 681 as response messages returned from the TEE which will then be passed 682 to the TAM. 684 6.2. OTrP Broker and Global Platform TEE Client API 686 A Client Application may use Global Platform (GP) TEE API for TA 687 communication. OTrP may use the GP TEE Client API but it is internal 688 to OTrP implementation that converts given messages from TAM. More 689 details can be found at [GPTEECLAPI]. 691 6.3. OTrP Broker Implementation Consideration 693 A Provider should consider methods of distribution, scope and 694 concurrency on device and runtime options when implementing an OTrP 695 Broker. Several non-exhaustive options are discussed below. 696 Providers are encouraged to take advantage of the latest 697 communication and platform capabilities to offer the best user 698 experience. 700 6.3.1. OTrP Broker Distribution 702 OTrP Broker installation is commonly carried out at OEM time. A user 703 can dynamically download and install an OTrP Broker on-demand. 705 It is important to ensure a legitimate OTrP Broker is installed and 706 used. If an OTrP Broker is compromised it may send rogue messages to 707 TAM and TEE and introduce additional risks. 709 6.3.2. Number of OTrP Broker 711 We anticipate only one shared OTrP Broker instance in a device. The 712 device's TEE vendor will most probably supply one OTrP Broker. 713 Potentially we expect some open source. 715 With one shared OTrP Broker, the OTrP Broker provider is responsible 716 to allow multiple TAMs and TEE providers to achieve interoperability. 717 With a standard OTrP Broker interface, TAM can implement its own SDK 718 for its SP Client Applications to work with this OTrP Broker. 720 Multiple independent OTrP Broker providers can be used as long as 721 they have standard interface to a Client Application or TAM SDK. 722 Only one OTrP Broker is expected in a device. 724 TAM providers are generally expected to provide SDK for SP 725 applications to interact with an OTrP Broker for the TAM and TEE 726 interaction. 728 6.4. OTrP Broker Interfaces for Client Applications 730 A Client Application shall be responsible for relaying messages 731 between the OTrP Broker and the TAM. 733 If a failure occurs during calling OTrP Broker, an error message 734 described in "Common Errors" section (see Section 7.6) will be 735 returned. 737 6.4.1. ProcessOTrPMessage call 739 Description 741 A Client Application will use this method of the OTrP Broker in a 742 device to pass OTrP messages from a TAM. The method is 743 responsible for interacting with the TEE and for forwarding the 744 input message to the TEE. It also returns TEE generated response 745 message back to the Client Application. 747 Inputs: 749 TAMInMsg - OTrP message generated in a TAM that is passed to this 750 method from a Client Application. 752 Outputs: 754 A TEE-generated OTrP response message (which may be a successful 755 response or be a response message containing an error raised 756 within the TEE) for the client application to forward to the TAM. 757 In the event of the OTrP Broker not being able to communicate with 758 the TEE, a OTrPBrokerException shall be thrown. 760 6.4.2. GetTAInformation call 762 Description 764 A Client Application may quickly query local TEE about a 765 previously installed TA without requiring TAM each time if it has 766 had the TA's identifier and previously saved TEE SP AIK public key 767 for TA information integrity verification. 769 Inputs: 771 { 772 "TAQuery": { 773 "spid": "", 774 "taid": "" 775 } 776 } 778 Outputs: 780 The OTrP Broker is expected to return TA signer and TAM signer 781 certificate along with other metadata information about the TA 782 associated with the given identifier. It follows the underlying 783 TEE trust model for authoring the local TA query from a Client 784 Application. 786 The output is a JSON message that is generated by the TEE. It 787 contains the following information: 789 * tamid 791 * SP ID 793 * TA signer certificate 795 * TAM certificate 797 The message is signed with TEE SP AIK private key. 799 The Client Application is expected to consume the response as 800 follows. 802 The Client Application gets signed TA metadata, in particular, the 803 TA signer certificate. It is able to verify that the result is 804 from device by checking signer against TEE SP AIK public key it 805 gets in some earlier interaction with TAM. 807 If this is a new Client Application in the device that hasn't had 808 TEE SP AIK public key for the response verification, the 809 application can contact the TAM first to do GetDeviceState, and 810 TAM will return TEE SP AIK public key to the app for this 811 operation to proceed. 813 Output Message: 815 { 816 "TAInformationTBS": { 817 "taid": "", 818 "tamid": "", 820 "spid": "", 821 "signercert": "", 823 "signercacerts": [ < The full list of CA certificate chain 824 including the root CA> 825 ], 826 "cacert": "" 828 ], 829 "tamcert": "", 831 "tamcacerts": [ < The full list of CA certificate chain 832 including the root CA> 833 ], 834 "cacert":"" 836 ] 837 } 838 } 840 { 841 "TAInformation": { 842 "payload": "", 844 "protected": "", 845 "header": { 846 "signer": {""} 848 }, 849 "signature": "" 851 } 852 } 854 where the definitions of BASE64 and BASE64URL refer to [RFC4648]. 856 A sample JWK public key representation refers to an example in 857 [RFC7517]. 859 6.5. Sample End-to-End Client Application Flow 861 6.5.1. Case 1: A New Client Application Uses a TA 863 1. During the Client Application installation time, the Client 864 Application calls TAM to initialize the device preparation step. 866 A. The Client Application knows it wants to use a Trusted 867 Application TA1 but the application doesn't know whether TA1 868 has been installed or not. It can use GP TEE Client API 869 [GPTEECLAPI] to check the existence of TA1 first. If it 870 detects that TA1 doesn't exist, it will contact TAM to 871 initiate the installation of TA1. Note that TA1 could have 872 been previously installed by other Client Applications from 873 the same service provider in the device. 875 B. The Client Application sends the TAM the TA list that it 876 depends on. The TAM will query a device for the Security 877 Domains and TAs that have been installed, and instructs the 878 device to install any dependent TAs that have not been 879 installed. 881 C. In general, the TAM has the latest TA list and their status 882 in a device because all operations are instructed by TAM. 883 TAM has such visibility because all Security Domain deletion 884 and TA deletion are managed by the TAM; the TAM could have 885 stored the state when a TA is installed, updated and 886 deleted. There is also the possibility that an update 887 command is carried out inside TEE but a response is never 888 received in TAM. There is also possibility that some manual 889 local reset is done in a device that the TAM isn't aware of 890 the changes. 892 2. The TAM generates message: GetDeviceStateRequest 894 3. The Client Application passes the JSON message 895 GetDeviceStateRequest to OTrP Broker call ProcessOTrPMessage. 896 The communication between a Client Application and an OTrP 897 Broker is up to the implementation of the OTrP Broker. 899 4. The OTrP Broker routes the message to the active TEE. Multiple 900 TEE case: it is up to OTrP Broker to figure this out. This 901 specification limits the support to only one active TEE, which 902 is the typical case today. 904 5. The target active TEE processes the received OTrP message, and 905 returns a JSON message GetDeviceStateResponse. 907 6. The OTrP Broker passes the GetDeviceStateResponse to the Client 908 Application. 910 7. The Client Application sends GetDeviceStateResponse to the TAM. 912 8. The TAM processes the GetDeviceStateResponse. 914 A. Extract TEEspaik for the SP, signs TEEspaik with TAM signer 915 key 917 B. Examine SD list and TA list 919 9. The TAM continues to carry out other actions based on the need. 920 The next call could be instructing the device to install a 921 dependent TA. 923 A. Assume a dependent TA isn't in the device yet, the TAM may 924 do the following: (1) create an SD in which to install the 925 TA by sending a CreateSDRequest message. The message is 926 sent back to the Client Application, and then the OTrP 927 Broker and TEE to process; (2) install a TA with an 928 InstallTARequest message. 930 B. If a Client Application depends on multiple TAs, the Client 931 Application should expect multiple round trips of the TA 932 installation message exchanges. 934 10. At the last TAM and TEE operation, the TAM returns the signed 935 TEE SP AIK public key to the application. 937 11. The Client Application stores the TEEspaik for future loaded TA 938 trust check. 940 12. If the TAM finds that this is a fresh device that does not have 941 any SD for the SP yet, then the TAM may next create an SD for 942 the SP. 944 13. During Client Application installation, the application checks 945 whether required Trusted Applications are already installed, 946 which may have been provided by the TEE. If needed, it will 947 contact its TAM service to determine whether the device is ready 948 or install TA list that this application needs. 950 6.5.2. Case 2: A Previously Installed Client Application Calls a TA 952 1. The Client Application checks the device readiness: (a) whether 953 it has a TEE; (b) whether it has TA that it depends. It may 954 happen that TAM has removed the TA this application depends on. 956 2. The Client Application calls the OTrP Broker to query the TA. 958 3. The OTrP Broker queries the TEE to get TA information. If the 959 given TA doesn't exist, an error is returned. 961 4. The Client Application parses the TAInformation message. 963 5. If the TA doesn't exist, the Client Application calls its TAM to 964 install the TA. If the TA exists, the Client Application 965 proceeds to call the TA. 967 7. OTrP Messages 969 The main OTrP component is the set of standard JSON messages created 970 by a TAM to deliver device SD and TA management commands to a device, 971 and device attestation and response messages created by TEE to 972 respond to TAM OTrP Messages. 974 An OTrP Message is designed to provide end-to-end security. It is 975 always signed by its creator. In addition, an OTrP Message is 976 typically encrypted such that only the targeted device TEE or TAM is 977 able to decrypt and view the actual content. 979 7.1. Message Format 981 OTrP Messages use the JSON format for JSON's simple readability and 982 moderate data size in comparison with alternative TLV and XML 983 formats. More compact CBOR format may be used as an alternative 984 choice. 986 JSON Message security has developed JSON Web Signing and JSON Web 987 Encryption standard in the IETF Workgroup JOSE, see JWS [RFC7515] and 988 JWE [RFC7516]. The OTrP Messages in this protocol will leverage the 989 basic JWS and JWE to handle JSON signing and encryption. 991 7.2. Message Naming Convention 993 For each TAM command "xyz"", OTrP use the following naming convention 994 to represent its raw message content and complete request and 995 response messages: 997 +-----------------------+----------------+---------------------+ 998 | Purpose | Message Name | Example | 999 +-----------------------+----------------+---------------------+ 1000 | Request to be signed | xyzTBSRequest | CreateSDTBSRequest | 1001 | | | | 1002 | Request message | xyzRequest | CreateSDRequest | 1003 | | | | 1004 | Response to be signed | xyzTBSResponse | CreateSDTBSResponse | 1005 | | | | 1006 | Response message | xyzResponse | CreateSDResponse | 1007 +-----------------------+----------------+---------------------+ 1009 7.3. Request and Response Message Template 1011 An OTrP Request message uses the following format: 1013 { 1014 "TBSRequest": { 1015 1016 } 1017 } 1019 A corresponding OTrP Response message will be as follows. 1021 { 1022 "TBSResponse": { 1023 1024 } 1025 } 1027 7.4. Signed Request and Response Message Structure 1029 A signed request message will generally include only one signature, 1030 and uses the flattened JWS JSON Serialization Syntax, see 1031 Section 7.2.2 in [RFC7515]. 1033 A general JWS object looks like the following. 1035 { 1036 "payload": "", 1037 "protected": "", 1038 "header": { 1039 , 1040 }, 1041 "signature": "" 1042 } 1043 OTrP signed messages only require the signing algorithm as the 1044 mandate header in the property "protected". The "non-integrity- 1045 protected header contents" is optional. 1047 OTrP signed message will be given an explicit Request or Response 1048 property name. In other words, a signed Request or Response uses the 1049 following template. 1051 A general JWS object looks like the following. 1053 { 1054 "[Request | Response]": { 1055 TBS[Request | Response] 1056 } 1057 } 1059 With the standard JWS message format, a signed OTrP Message looks 1060 like the following. 1062 { 1063 "[Request | Response]": { 1064 "payload": "TBS[Request | Response]>", 1065 "protected": "", 1066 "header": , 1067 "signature": "" 1068 } 1069 } 1071 The top element "[Signed][Request|Response]" cannot be fully 1072 trusted to match the content because it doesn't participate in the 1073 signature generation. However, a recipient can always match it with 1074 the value associated with the property "payload". It purely serves 1075 to provide a quick reference for reading and method invocation. 1077 Furthermore, most properties in an unsigned OTrP messages are 1078 encrypted to provide end-to-end confidentiality. The only OTrP 1079 message that isn't encrypted is the initial device query message that 1080 asks for the device state information. 1082 Thus a typical OTrP Message consists of an encrypted and then signed 1083 JSON message. Some transaction data such as transaction ID and TEE 1084 information may need to be exposed to the OTrP Broker for routing 1085 purpose. Such information is excluded from JSON encryption. The 1086 device's signer certificate itself is encrypted. The overall final 1087 message is a standard signed JSON message. 1089 As required by JSW/JWE, those JWE and JWS related elements will be 1090 BASE64URL encoded. Other binary data elements specific to the OTrP 1091 specification are BASE64-encoded. This specification indicates 1092 elements that should be BASE64 and those elements that are to be 1093 BASE64URL encoded. 1095 7.4.1. Identifying Signing and Encryption Keys for JWS/JWE Messaging 1097 JWS and JWE messaging allow various options for identifying the 1098 signing and encryption keys, for example, it allows optional elements 1099 including "x5c", "x5t" and "kid" in the header to cover various 1100 possibilities. 1102 To protect privacy, it is important that the device's certificate is 1103 released only to a trusted TAM, and that it is encrypted. The TAM 1104 will need to know the device certificate, but untrusted parties must 1105 not be able to get the device certificate. All OTrP messaging 1106 conversations between a TAM and device begin with 1107 GetDeviceStateRequest / GetDeviceStateResponse. These messages have 1108 elements built into them to exchange signing certificates, described 1109 in the section Section 9. Any subsequent messages in the 1110 conversation that follow on from this implicitly use the same 1111 certificates for signing/encryption, and as a result the certificates 1112 or references may be omitted in those subsequent messages. 1114 In other words, the signing key identifier in the use of JWS and JWE 1115 here may be absent in the subsequent messages after the initial 1116 GetDeviceState query. 1118 This has an implication on the TEE and TAM implementation: they have 1119 to cache the signer certificates for the subsequent message signature 1120 validation in the session. It may be easier for a TAM service to 1121 cache transaction session information but not so for a TEE in a 1122 device. A TAM can get a device's capability by checking the response 1123 message from a TEE to decide whether it should include its TAM signer 1124 certificate and OCSP data in each subsequent request message. The 1125 device's caching capability is reported in GetDeviceStateResponse 1126 signerreq parameter. 1128 7.5. JSON Signing and Encryption Algorithms 1130 The OTrP JSON signing algorithm shall use SHA256 or a stronger hash 1131 method with respective key type. JSON Web Algorithm RS256 or ES256 1132 [RFC7518] SHALL be used for RSA with SHA256 and ECDSA with SHA256. 1133 If RSA with SHA256 is used, the JSON web algorithm representation is 1134 as follows. 1136 {"alg":"RS256"} 1138 The (BASE64URL encoded) "protected" header property in a signed 1139 message looks like the following: 1141 "protected":"eyJhbGciOiJSUzI1NiJ9" 1143 If ECSDA with P-256 curve and SHA256 are used for signing, the JSON 1144 signing algorithm representation is as follows. 1146 {"alg":"ES256"} 1148 The value for the "protected" field will be the following. 1150 eyJhbGciOiJFUzI1NiJ9 1152 Thus, a common OTrP signed message with ES256 looks like the 1153 following. 1155 { 1156 "payload": "", 1157 "protected": "eyJhbGciOiJFUzI1NiJ9", 1158 "signature": "" 1159 } 1161 The OTrP JSON message encryption algorithm SHOULD use one of the 1162 supported algorithms defined in the later chapter of this document. 1163 JSON encryption uses a symmetric key as its "Content Encryption Key 1164 (CEK)". This CEK is encrypted or wrapped by a recipient's key. The 1165 OTrP recipient typically has an asymmetric key pair. Therefore, the 1166 CEK will be encrypted by the recipient's public key. 1168 A compliant implementation shall support the following symmetric 1169 encryption algorithm and anticipate future new algorithms. 1171 {"enc":"A128CBC-HS256"} 1173 This algorithm represents encryption with AES 128 in CBC mode with 1174 HMAC SHA 256 for integrity. The value of the property "protected" in 1175 a JWE message will be 1177 eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0 1179 An encrypted JSON message looks like the following. 1181 { 1182 "protected": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0", 1183 "recipients": [ 1184 { 1185 "header": { 1186 "alg": "" 1187 }, 1188 "encrypted_key": "" 1189 } 1190 ], 1191 "iv": "", 1192 "ciphertext": "", 1194 "tag": "" 1195 } 1197 OTrP doesn't use JWE AAD (Additional Authenticated Data) because each 1198 message is always signed after the message is encrypted. 1200 7.5.1. Supported JSON Signing Algorithms 1202 The following JSON signature algorithm is mandatory support in the 1203 TEE and TAM: 1205 o RS256 1207 ES256 is optional to support. 1209 7.5.2. Support JSON Encryption Algorithms 1211 The following JSON authenticated encryption algorithm is mandatory 1212 support in TEE and TAM. 1214 o A128CBC-HS256 1216 A256CBC-HS512 is optional to support. 1218 7.5.3. Supported JSON Key Management Algorithms 1220 The following JSON key management algorithm is mandatory support in 1221 TEE and TAM. 1223 o RSA1_5 1225 ECDH-ES+A128KW and ECDH-ES+A256KW are optional to support. 1227 7.6. Common Errors 1229 An OTrP Response message typically needs to report the operation 1230 status and error causes if an operation fails. The following JSON 1231 message elements should be used across all OTrP Messages. 1233 "status": "pass | fail" 1235 "reason": { 1236 "error-code": "", 1237 "error-message": "" 1238 } 1240 "ver": "" 1242 7.7. OTrP Message List 1244 The following table lists the OTrP commands and therefore 1245 corresponding Request and Response messages defined in this 1246 specification. Additional messages may be added in the future when 1247 new task messages are needed. 1249 GetDeviceState - 1250 A TAM queries a device's current state with a message 1251 GetDeviceStateRequest. A device TEE will report its version, its 1252 FW version, and list of all SDs and TAs in the device that is 1253 managed by the requesting TAM. TAM may determine whether the 1254 device is trustworthy and decide to carry out additional commands 1255 according to the response from this query. 1257 CreateSD - 1258 A TAM instructs a device TEE to create an SD for an SP. The 1259 recipient TEE will check whether the requesting TAM is 1260 trustworthy. 1262 UpdateSD - 1263 A TAM instructs a device TEE to update an existing SD. A typical 1264 update need comes from SP certificate change, TAM certificate 1265 change and so on. The recipient TEE will verify whether the TAM 1266 is trustworthy and owns the SD. 1268 DeleteSD - 1269 A TAM instructs a device TEE to delete an existing SD. A TEE 1270 conditionally deletes TAs loaded in the SD according to a request 1271 parameter. An SD cannot be deleted until all TAs in this SD are 1272 deleted. If this is the last SD for an SP, TEE MAY also delete 1273 TEE SP AIK key for this SP. 1275 InstallTA - 1276 A TAM instructs a device to install a TA into an SD for a SP. 1277 The TEE in a device will check whether the TAM and TA are 1278 trustworthy. 1280 UpdateTA - 1281 A TAM instructs a device to update a TA into an SD for an SP. 1282 The change may commonly be bug fix for a previously installed TA. 1284 DeleteTA - 1285 A TAM instructs a device to delete a TA. The TEE in a device 1286 will check whether the TAM and TA are trustworthy. 1288 7.8. OTrP Request Message Routing Rules 1290 For each command that a TAM wants to send to a device, the TAM 1291 generates a request message. This is typically triggered by a Client 1292 Application that uses the TAM. The Client Application initiates 1293 contact with the TAM and receives TAM OTrP Request messages according 1294 to the TAM's implementation. The Client Application forwards the 1295 OTrP message to an OTrP Broker in the device, which in turn sends the 1296 message to the active TEE in the device. 1298 The current version of this specification assumes that each device 1299 has only one active TEE, and the OTrP Broker is responsible to 1300 connect to the active TEE. This is the case today with devices in 1301 the market. 1303 When the TEE responds to a request, the OTrP Broker gets the OTrP 1304 response messages back to the Client Application that sent the 1305 request. In case the target TEE fails to respond to the request, the 1306 OTrP Broker will be responsible to generate an error message to reply 1307 the Client Application. The Client Application forwards any data it 1308 received to its TAM. 1310 7.8.1. SP Anonymous Attestation Key (SP AIK) 1312 When the first new Security Domain is created in a TEE for an SP, a 1313 new key pair is generated and associated with this SP. This key pair 1314 is used for future device attestation to the service provider instead 1315 of using the device's TEE key pair. 1317 8. Transport Protocol Support 1319 The OTrP message exchange between a TEE device and TAM generally 1320 takes place between a Client Application in REE and TAM. A device 1321 that is capable to run a TEE and PKI based cryptographic attestation 1322 isn't generally resource constraint to carry out standard HTTPS 1323 connections. A compliant device and TAM SHOULD support HTTPs. 1325 9. Detailed Messages Specification 1327 For each message in the following sections all JSON elements are 1328 mandatory if not explicitly indicated as optional. 1330 9.1. GetDeviceState 1332 This is the first command that a TAM will send to a device. This 1333 command is triggered when an SP's Client Application contacts its TAM 1334 to check whether the underlying device is ready for TA operations. 1336 This command queries a device's current TEE state. A device TEE will 1337 report its version, its FW version, and list of all SDs and TAs in 1338 the device that is managed by the requesting TAM. TAM may determine 1339 whether the device is trustworthy and decide to carry out additional 1340 commands according to the response from this query. 1342 The request message of this command is signed by the TAM. The 1343 response message from the TEE is encrypted. A random message 1344 encryption key (MK) is generated by TEE, and this encrypted key is 1345 encrypted by the TAM's public key such that only the TAM that sent 1346 the request is able to decrypt and view the response message. 1348 9.1.1. GetDeviceStateRequest message 1350 { 1351 "GetDeviceStateTBSRequest": { 1352 "ver": "1.0", 1353 "rid": "", 1354 "tid": "", 1355 "ocspdat": ["], 1356 "supportedsigalgs": [] 1357 } 1358 } 1360 The request message consists of the following data elements: 1362 ver - version of the message format 1364 rid - a unique request ID generated by the TAM 1366 tid - a unique transaction ID to trace request and response. This 1367 can be from a prior transaction's tid field, and can be used in 1368 subsequent message exchanges in this TAM session. The 1369 combination of rid and tid MUST be made unique. 1371 ocspdat - A list of OCSP stapling data respectively for the TAM 1372 certificate and each of the CA certificates up to the root 1373 certificate. The TAM provides OCSP data such that a recipient 1374 TEE can validate the TAM certificate chain revocation status 1375 without making its own external OCSP service call. A TEE MAY 1376 cache the CA OCSP data such that the array may contain only the 1377 OCSP stapling data for the TAM certificate in subsequent 1378 exchanges. This is a mandatory field. 1380 supportedsigalgs - an optional property to list the signing 1381 algorithms that the TAM is able to support. A recipient TEE MUST 1382 choose an algorithm in this list to sign its response message if 1383 this property is present in a request. If it is absent, the TEE 1384 may use any compliant signing algorithm that is listed as 1385 mandatory support in this specification. 1387 The final request message is JSON signed message of the above raw 1388 JSON data with TAM's certificate. 1390 { 1391 "GetDeviceStateRequest": { 1392 "payload": "", 1394 "protected": "", 1395 "header": { 1396 "x5c": "" 1398 }, 1399 "signature":"" 1400 } 1401 } 1403 The signing algorithm SHOULD use SHA256 with respective key type. 1404 The mandatory algorithm support is the RSA signing algorithm. The 1405 signer header "x5c" is used to include the TAM signer certificate up 1406 to the root CA certificate. 1408 9.1.2. Request processing requirements at a TEE 1410 Upon receiving a request message GetDeviceStateRequest at a TEE, the 1411 TEE MUST validate a request: 1413 1. Validate JSON message signing. If it doesn't pass, an error 1414 message is returned. 1416 2. Validate that the request TAM certificate is chained to a trusted 1417 CA that the TEE embeds as its trust anchor. 1419 * Cache the CA OCSP stapling data and certificate revocation 1420 check status for other subsequent requests. 1422 * A TEE can use its own clock time for the OCSP stapling data 1423 validation. 1425 3. Optionally collect Firmware signed data 1427 * This is a capability in ARM architecture that allows a TEE to 1428 query Firmware to get FW signed data. It isn't required for 1429 all TEE implementations. When TFW signed data is absent, it 1430 is up to a TAM's policy how it will trust a TEE. 1432 4. Collect SD information for the SD owned by this TAM 1434 9.1.3. Firmware Signed Data 1436 Firmware isn't expected to process or produce JSON data. It is 1437 expected to just sign some raw bytes of data. 1439 The data to be signed by TFW key needs be some unique random data 1440 each time. The (UTF-8 encoded) "tid" value from the 1441 GetDeviceStateTBSRequest shall be signed by the firmware. TAM isn't 1442 expected to parse TFW data except the signature validation and signer 1443 trust path validation. 1445 It is possible that a TEE can get some valid TFW signed data from 1446 another device. The TEE is responsible to validate TFW integrity to 1447 ensure that the underlying device firmware is trustworthy. In some 1448 cases, a TEE isn't able to get a TFW signed data, in which case the 1449 TEE trust validation is up to a TAM to decide. A TAM may opt to 1450 trust a TEE basing on the TEE signer and additional information about 1451 a TEE out-of-band. 1453 When TFW signed data is available, a TAM validates the TEE and trusts 1454 that a trusted TEE has carried out appropriate trust check about a 1455 TFW. 1457 TfwData: { 1458 "tbs": "", 1459 "cert": "", 1460 "sigalg": "Signing method", 1461 "sig": "" 1462 } 1464 It is expected that a FW uses standard signature methods for maximal 1465 interoperability with TAM providers. The mandatory support list of 1466 signing algorithm is RSA with SHA256. 1468 The JSON object above is constructed by a TEE with data returned from 1469 the FW. It isn't a standard JSON signed object. The signer 1470 information and data to be signed must be specially processed by a 1471 TAM according to the definition given here. The data to be signed is 1472 the raw data. 1474 9.1.3.1. Supported Firmware Signature Methods 1476 TAM providers shall support the following signature methods. A 1477 firmware provider can choose one of the methods in signature 1478 generation. 1480 o RSA with SHA256 1482 o ECDSA with SHA 256 1484 The value of "sigalg" in the TfwData JSON message SHOULD use one of 1485 the following: 1487 o RS256 1489 o ES256 1491 9.1.4. Post Conditions 1493 Upon successful request validation, the TEE information is collected. 1494 There is no change in the TEE in the device. 1496 The response message shall be encrypted where the encryption key 1497 shall be a symmetric key that is wrapped by TAM's public key. The 1498 JSON Content Encryption Key (CEK) is used for this purpose. 1500 9.1.5. GetDeviceStateResponse Message 1502 The message has the following structure. 1504 { 1505 "GetDeviceTEEStateTBSResponse": { 1506 "ver": "1.0", 1507 "status": "pass | fail", 1508 "rid": "", 1509 "tid": "", 1510 "signerreq": true | false // about whether TAM needs to send 1511 signer data again in subsequent messages, 1512 "edsi": "" 1513 } 1514 } 1516 where 1518 signerreq - true if the TAM should send its signer certificate and 1519 OCSP data again in the subsequent messages. The value may be 1520 "false" if the TEE caches the TAM's signer certificate and OCSP 1521 status. 1523 rid - the request ID from the request message 1525 tid - the tid from the request message 1527 edsi - the main data element whose value is JSON encrypted message 1528 over the following Device State Information (DSI). 1530 The Device State Information (DSI) message consists of the following. 1532 { 1533 "dsi": { 1534 "tfwdata": { 1535 "tbs": "" 1536 "cert": "", 1537 "sigalg": "Signing method", 1538 "sig": "" 1539 }, 1540 "tee": { 1541 "name": "", 1542 "ver": "", 1543 "cert": "", 1544 "cacert": "", 1546 "sdlist": { 1547 "cnt": "", 1548 "sd": [ 1549 { 1550 "name": "", 1551 "spid": "", 1552 "talist": [ 1553 { 1554 "taid": "", 1555 "taname": "" // optional 1557 } 1558 ] 1559 } 1560 ] 1561 }, 1562 "teeaiklist": [ 1563 { 1564 "spaik": "", 1565 "spaiktype": "", 1566 "spid": "" 1567 } 1568 ] 1569 } 1570 } 1571 } 1573 The encrypted JSON message looks like the following. 1575 { 1576 "protected": "", 1578 "recipients": [ 1579 { 1580 "header": { 1581 "alg": "RSA1_5" 1582 }, 1583 "encrypted_key": "" 1584 } 1585 ], 1586 "iv": "", 1587 "ciphertext": "", 1589 "tag": "" 1590 } 1592 Assume we encrypt plaintext with AES 128 in CBC mode with HMAC SHA 1593 256 for integrity, the encryption algorithm header is: 1595 {"enc":"A128CBC-HS256"} 1597 The value of the property "protected" in the above JWE message will 1598 be 1600 eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0 1602 In other words, the above message looks like the following: 1604 { 1605 "protected": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0", 1606 "recipients": [ 1607 { 1608 "header": { 1609 "alg": "RSA1_5" 1610 }, 1611 "encrypted_key": "" 1612 } 1613 ], 1614 "iv": "", 1615 "ciphertext": "", 1617 "tag": "" 1618 } 1620 The full response message looks like the following: 1622 { 1623 "GetDeviceTEEStateTBSResponse": { 1624 "ver": "1.0", 1625 "status": "pass | fail", 1626 "rid": "", 1627 "tid": "", 1628 "signerreq": "true | false", 1629 "edsi": { 1630 "protected": "", 1632 "recipients": [ 1633 { 1634 "header": { 1635 "alg": "RSA1_5" 1636 }, 1637 "encrypted_key": "" 1638 } 1639 ], 1640 "iv": "", 1641 "ciphertext": "", 1643 "tag": "" 1644 } 1645 } 1646 } 1648 The CEK will be encrypted by the TAM public key in the device. The 1649 TEE signed message has the following structure. 1651 { 1652 "GetDeviceTEEStateResponse": { 1653 "payload": "", 1655 "protected": "", 1656 "signature": "" 1657 } 1658 } 1660 The signing algorithm shall use SHA256 with respective key type, see 1661 Section 7.5.1. 1663 The final GetDeviceStateResponse response message consists of an 1664 array of TEE responses. 1666 { 1667 "GetDeviceStateResponse": [ // JSON array 1668 {"GetDeviceTEEStateResponse": ...}, 1669 ... 1670 {"GetDeviceTEEStateResponse": ...} 1671 ] 1672 } 1674 9.1.6. Error Conditions 1676 An error may occur if a request isn't valid or the TEE runs into some 1677 error. The list of possible error conditions is the following. 1679 ERR_REQUEST_INVALID The TEE meets the following conditions with a 1680 request message: (1) The request from a TAM has an invalid message 1681 structure; mandatory information is absent in the message; or an 1682 undefined member or structure is included. (2) TEE fails to verify 1683 the signature of the message or fails to decrypt its contents. 1685 ERR_UNSUPPORTED_MSG_VERSION The TEE receives a version of message 1686 that the TEE can't deal with. 1688 ERR_UNSUPPORTED_CRYPTO_ALG The TEE receives a request message 1689 encoded with a cryptographic algorithm that the TEE doesn't 1690 support. 1692 ERR_TFW_NOT_TRUSTED The TEE considers the underlying device firmware 1693 be not trustworthy. 1695 ERR_TAM_NOT_TRUSTED The TEE needs to make sure whether the TAM is 1696 trustworthy by checking the validity of the TAM certificate and 1697 OCSP stapling data and so on. If the TEE finds the TAM is not 1698 reliable, it returns this error code. 1700 ERR_TEE_FAIL If the TEE fails to process a request because of its 1701 internal error but is able to sign an error response message, it 1702 will return this error code. 1704 The response message will look like the following if the TEE signing 1705 can work to sign the error response message. 1707 { 1708 "GetDeviceTEEStateTBSResponse": { 1709 "ver": "1.0", 1710 "status": "fail", 1711 "rid": "", 1712 "tid": "", 1713 "reason": {"error-code":""} 1714 "supportedsigalgs": [] 1716 } 1717 } 1719 where 1721 supportedsigalgs - an optional property to list the JWS signing 1722 algorithms that the active TEE supports. When a TAM sends a 1723 signed message that the TEE isn't able to validate, it can 1724 include signature algorithms that it is able to consume in this 1725 status report. A TAM can generate a new request message to retry 1726 the management task with a TEE-supported signing algorithm. 1728 If the TEE isn't able to sign an error message due to an internal 1729 device error, a general error message should be returned by the OTrP 1730 Broker. 1732 9.1.7. TAM Processing Requirements 1734 Upon receiving a GetDeviceStateResponse message at a TAM, the TAM 1735 MUST validate the following. 1737 o Parse to get list of GetDeviceTEEStateResponse JSON objects 1739 o Parse the JSON "payload" property and decrypt the JSON element 1740 "edsi". The decrypted message contains the TEE signer 1741 certificate. 1743 o Validate the GetDeviceTEEStateResponse JSON signature. The signer 1744 certificate is extracted from the decrypted message in the last 1745 step. 1747 o Extract TEE information and check it against its TEE acceptance 1748 policy. 1750 o Extract the TFW signed element, and check the signer and data 1751 integration against its TFW policy. 1753 o Check the SD list and TA list and prepare for a subsequent command 1754 such as "CreateSD" if it needs to have a new SD for an SP. 1756 9.2. Security Domain Management 1758 9.2.1. CreateSD 1760 This command is typically preceded with a GetDeviceState command that 1761 has acquired the device information of the target device by the TAM. 1762 The TAM sends such a command to instruct a TEE to create a new 1763 Security Domain for an SP. 1765 A TAM sends an OTrP CreateSDRequest Request message to a device TEE 1766 to create a Security Domain for an SP. Such a request is signed by 1767 the TAM where the TAM signer may or may not be the same as the SP's 1768 TA signer certificate. The resulting SD is associated with two 1769 identifiers for future management: 1771 o TAM as the owner. The owner identifier is a registered unique TAM 1772 ID that is stored in the TAM certificate. 1774 o SP identified by its TA signer certificate as the authorization. 1775 A TAM can add more than one SP certificate to an SD. 1777 A Trusted Application that is signed by a matching SP signer 1778 certificate for an SD is eligible to be installed into that SD. The 1779 TA installation into an SD by a subsequent InstallTARequest message 1780 may be instructed from a TAM. 1782 9.2.1.1. CreateSDRequest Message 1783 The request message for CreateSD has the following JSON format. 1785 { 1786 "CreateSDTBSRequest": { 1787 "ver": "1.0", 1788 "rid": "", 1789 "tid": "", // this may be from prior message 1790 "tee": "", 1791 "nextdsi": true | false, 1792 "dsihash": "", 1793 "content": ENCRYPTED { // this piece of JSON data will be 1794 // encrypted 1795 "spid": "", 1796 "sdname": "", 1797 "spcert": "", 1798 "tamid": "", 1800 "did": "" 1801 } 1802 } 1803 } 1805 In the message, 1807 rid - A unique value to identify this request 1809 tid - A unique value to identify this transaction. It can have the 1810 same value for the tid in the preceding GetDeviceStateRequest. 1812 tee - TEE ID returned from the previous GetDeviceStateResponse. 1814 nextdsi - Indicates whether the up-to-date Device State Information 1815 (DSI) is expected in the response from the TEE to this request. 1817 dsihash - The BASE64-encoded SHA256 hash value of the DSI data 1818 returned in the prior TAM operation with this target TEE. This 1819 value is always included such that a receiving TEE can check 1820 whether the device state has changed since its last query. It 1821 helps enforce SD update order in the right sequence without 1822 accidentally overwriting an update that was done simultaneously. 1824 content - The "content" is a JSON encrypted message that includes 1825 actual input for the SD creation. The encryption key is TAMmk that 1826 is encrypted by the target TEE's public key. The entire message is 1827 signed by the TAM private key TAMpriv. A separate TAMmk isn't used 1828 in the latest specification because JSON encryption will use a 1829 content encryption key for exactly the same purpose. 1831 spid - A unique id assigned by the TAM for its SP. It should be 1832 unique within a TAM namespace. 1834 sdname - a name unique to the SP. TAM should ensure it is unique 1835 for each SP. 1837 spcert - The SP's TA signer certificate is included in the request. 1838 This certificate will be stored by the device TEE which uses it to 1839 check against TA installation. Only if a TA is signed by a 1840 matching spcert associated with an SD will the TA be installed into 1841 the SD. 1843 tamid - SD owner claim by TAM - an SD owned by a TAM will be 1844 associated with a trusted identifier defined as an attribute in the 1845 signer TAM certificate. TEE will be responsible to assign this ID 1846 to the SD. The TAM certificate attribute for this attribute tamid 1847 MUST be vetted by the TAM signer issuing CA. With this trusted 1848 identifier, the SD query at TEE can be fast upon TAM signer 1849 verification. 1851 did - The SHA256 hash of the binary-encoded device TEE certificate. 1852 The encryption key CEK will be encrypted the recipient TEE's public 1853 key. This hash value in the "did" property allows the recipient 1854 TEE to check whether it is the expected target to receive such a 1855 request. If this isn't given, an OTrP message for device 2 could 1856 be sent to device 1. It is optional for the TEE to check because 1857 the successful decryption of the request message with this device's 1858 TEE private key already proves it is the target. This explicit 1859 hash value makes the protocol not dependent on message encryption 1860 method in future. 1862 A CreateSDTBSRequest message is signed to generate a final 1863 CreateSDRequest message as follows. 1865 { 1866 "CreateSDRequest": { 1867 "payload": "", 1868 "protected": "", 1869 "header": "", 1870 "signature": "" 1871 } 1872 } 1874 The TAM signer certificate is included in the "header" property. 1876 9.2.1.2. Request Processing Requirements at a TEE 1878 Upon receiving a CreateSDRequest request message at a TEE, the TEE 1879 MUST do the following: 1881 1. Validate the JSON request message as follows 1883 * Validate JSON message signing. 1885 * Validate that the request TAM certificate is chained to a 1886 trusted CA that the TEE embeds as its trust anchor. 1888 * Compare dsihash with its current state to make sure nothing 1889 has changed since this request was sent. 1891 * Decrypt to get the plaintext of the content: (a) spid, (b) sd 1892 name, (c) did. 1894 * Check that an SPID is supplied. 1896 * spcert check: check it is a valid certificate (signature and 1897 format verification only). 1899 * Check "did" is the SHA256 hash of its TEEcert BER raw binary 1900 data. 1902 * Check whether the requested SD already exists for the SP. 1904 * Check that the tamid in the request matches the TAM 1905 certificate's TAM ID attribute. 1907 2. If the request was valid, create action 1909 * Create an SD for the SP with the given name. 1911 * Assign the tamid from the TAMCert to this SD. 1913 * Assign the SPID and SPCert to this SD. 1915 * Check whether a TEE SP AIK key pair already exists for the 1916 given SP ID. 1918 * Create TEE SP AIK key pair if it doesn't exist for the given 1919 SP ID. 1921 * Generate new DSI data if the request asks for updated DSI. 1923 3. Construct a CreateSDResponse message 1924 * Create raw content 1926 + Operation status 1928 + "did" or full signer certificate information, 1930 + TEE SP AIK public key if DSI isn't going to be included 1932 + Updated DSI data if requested 1934 * The response message is encrypted with the same JWE CEK of the 1935 request without recreating a new content encryption key. 1937 * The encrypted message is signed with TEEpriv. The signer 1938 information ("did" or TEEcert) is encrypted. 1940 4. Deliver the response message. (a) The OTrP Broker returns this to 1941 the Client Application; (b) The Client App passes this back to 1942 the TAM. 1944 5. TAM processing. (a) The TAM processes the response message; (b) 1945 the TAM can look up signer certificate from the device ID "did". 1947 If a request is illegitimate or signature doesn't pass, a "status" 1948 property in the response will indicate the error code and cause. 1950 9.2.1.3. CreateSDResponse Message 1952 The response message for a CreateSDRequest contains the following 1953 content. 1955 { 1956 "CreateSDTBSResponse": { 1957 "ver": "1.0", 1958 "status": "", 1959 "rid": "", 1960 "tid": "", 1961 "content": ENCRYPTED { 1962 "reason": "", // optional 1963 "did": "", 1964 "sdname": "", 1965 "teespaik": "", 1966 "dsi": "" 1968 } 1969 } 1970 } 1971 In the response message, the following fields MUST be supplied. 1973 did - The SHA256 hash of the device TEE certificate. This shows 1974 the device ID explicitly to the receiving TAM. 1976 teespaik - The newly generated SP AIK public key for the given SP. 1977 This is an optional value if the device has had another domain for 1978 the SP that has triggered TEE SP AIK key pair for this specific SP. 1980 There is a possible extreme error case where the TEE isn't reachable 1981 or the TEE final response generation itself fails. In this case, the 1982 TAM might still receive a response from the OTrP Broker if the OTrP 1983 Broker is able to detect such error from TEE. In this case, a 1984 general error response message should be returned by the OTrP Broker, 1985 assuming OTrP Broker even doesn't know any content and information 1986 about the request message. 1988 In other words, the TAM should expect to receive a TEE successfully 1989 signed JSON message, a general "status" message, or none when a 1990 client experiences a network error. 1992 { 1993 "CreateSDResponse": { 1994 "payload": "", 1995 "protected": { 1996 "" 1997 }, 1998 "signature": "" 2000 } 2001 } 2003 When the TEE fails to respond, the OTrP Broker will not provide a 2004 subsequent response to the TAM. The TAM should treat this as if the 2005 device has gone offline where a response is never delivered back. 2007 9.2.1.4. Error Conditions 2009 An error might occur if a request isn't valid or the TEE runs into 2010 some error. The list of possible errors are as follows. Refer to 2011 the Error Code List (Section 13.1) for detailed causes and actions. 2013 ERR_REQUEST_INVALID 2015 ERR_UNSUPPORTED_MSG_VERSION 2017 ERR_UNSUPPORTED_CRYPTO_ALG 2018 ERR_DEV_STATE_MISMATCH 2020 ERR_SD_ALREADY_EXIST 2022 ERR_SD_NOT_FOUND 2024 ERR_SPCERT_INVALID 2026 ERR_TEE_FAIL 2028 ERR_TAM_NOT_AUTHORIZED 2030 ERR_TAM_NOT_TRUSTED 2032 9.2.2. UpdateSD 2034 This TAM initiated command can update an SP's SD that it manages for 2035 any of the following needs: (a) Update an SP signer certificate; (b) 2036 Add an SP signer certificate when an SP uses multiple to sign TA 2037 binaries; (c) Update an SP ID. 2039 The TAM presents the proof of the SD ownership to the TEE, and 2040 includes related information in its signed message. The entire 2041 request is also encrypted for end-to-end confidentiality. 2043 9.2.2.1. UpdateSDRequest Message 2044 The UpdateSD request message has the following JSON format. 2046 { 2047 "UpdateSDTBSRequest": { 2048 "ver": "1.0", 2049 "rid": "", 2050 "tid": "", // this may be from prior message 2051 "tee": "", 2052 "nextdsi": true | false, 2053 "dsihash": "", 2054 "content": ENCRYPTED { // this piece of JSON will be encrypted 2055 "tamid": "", 2056 "spid": "", 2057 "sdname": "", 2058 "changes": { 2059 "newsdname": "", 2060 // Optional 2061 "newspid": "", 2062 // Optional 2063 "spcert": [""], 2064 // Optional 2065 "deloldspcert": [""], 2067 // Optional 2068 "renewteespaik": true | false 2069 } 2070 } 2071 } 2072 } 2074 In the message, 2076 rid - A unique value to identify this request 2078 tid - A unique value to identify this transaction. It can have the 2079 same value as the tid in the preceding GetDeviceStateRequest. 2081 tee - TEE ID returned from the previous GetDeviceStateResponse 2083 nextdsi - Indicates whether the up-to-date Device State Information 2084 (DSI) is expected to be returned in the response from the TEE to 2085 this request. 2087 dsihash - The BASE64-encoded SHA256 hash value of the DSI data 2088 returned in the prior TAM operation with this target TEE. This 2089 value is always included such that a receiving TEE can check 2090 whether the device state has changed since its last query. It 2091 helps enforce SD update order in the right sequence without 2092 accidentally overwriting an update that was done simultaneously. 2094 content - The "content" is a JSON encrypted message that includes 2095 actual input for the SD update. The standard JSON content 2096 encryption key (CEK) is used, and the CEK is encrypted by the 2097 target TEE's public key. 2099 tamid - SD owner claim by TAM - an SD owned by a TAM will be 2100 associated with a trusted identifier defined as an attribute in the 2101 signer TAM certificate. 2103 spid - the identifier of the SP whose SD will be updated. This 2104 value is still needed because the SD name is considered unique only 2105 within an SP. 2107 sdname - the name of the target SD to be updated. 2109 changes - its content consists of changes are to be updated in the 2110 given SD. 2112 newsdname - the new name of the target SD to be assigned if this 2113 value is present. 2115 newspid - the new SP ID of the target SD to be assigned if this 2116 value is present. 2118 spcert - a new TA signer certificate of this SP to be added to the 2119 SD if this is present. 2121 deloldspcert - an SP certificate assigned into the SD is to be 2122 deleted if this is present. The value is the SHA256 fingerprint of 2123 the old SP certificate. 2125 renewteespaik - the value should be true or false. If it is present 2126 and the value is true, the TEE MUST regenerate TEE SP AIK for this 2127 SD's owner SP. The newly generated TEE SP AIK for the SP must be 2128 returned in the response message of this request. If there is more 2129 than one SD for the SP, a new SPID for one of the domains will 2130 always trigger a new teespaik generation as if a new SP were 2131 introduced to the TEE. 2133 The UpdateSDTBSRequest message is signed to generate the final 2134 UpdateSDRequest message. 2136 { 2137 "UpdateSDRequest": { 2138 "payload": "", 2139 "protected": "", 2140 "header": "", 2141 "signature":"" 2142 } 2143 } 2145 TAM signer certificate is included in the "header" property. 2147 9.2.2.2. Request Processing Requirements at a TEE 2149 Upon receiving a request message UpdateSDRequest at a TEE, the TEE 2150 must validate a request: 2152 1. Validate the JSON request message 2154 * Validate JSON message signing 2156 * Validate that the request TAM certificate is chained to a 2157 trusted CA that the TEE embeds as its trust anchor.The TAM 2158 certificate status check is generally not needed anymore in 2159 this request. The prior request should have validated the TAM 2160 certificate's revocation status. 2162 * Compare dsihash with the TEE cached last response DSI data to 2163 this TAM. 2165 * Decrypt to get the plaintext of the content. 2167 * Check that the target SD name is supplied. 2169 * Check whether the requested SD exists. 2171 * Check that the TAM owns this TAM by verifying tamid in the SD 2172 matches TAM certificate's TAM ID attribute. 2174 * Now the TEE is ready to carry out update listed in the 2175 "content" message. 2177 2. If the request is valid, update action 2179 * If "newsdname" is given, replace the SD name for the SD to the 2180 new value 2182 * If "newspid" is given, replace the SP ID assigned to this SD 2183 with the given new value 2185 * If "spcert" is given, add this new SP certificate to the SD. 2187 * If "deloldspcert" is present in the content, check previously 2188 assigned SP certificates to this SD, and delete the one that 2189 matches the given certificate hash value. 2191 * If "renewteespaik" is given and has a value of 'true', 2192 generate a new TEE SP AIK key pair, and replace the old one 2193 with this. 2195 * Generate new DSI data if the request asks for updated DSI 2197 * Now the TEE is ready to construct the response message 2199 3. Construct UpdateSDResponse message 2201 * Create raw content 2203 + Operation status 2205 + "did" or full signer certificate information, 2207 + TEE SP AIK public key if DSI isn't going to be included 2209 + Updated DSI data if requested 2211 * The response message is encrypted with the same JWE CEK of the 2212 request without recreating a new content encryption key. 2214 * The encrypted message is signed with TEEpriv. The signer 2215 information ("did" or TEEcert) is encrypted. 2217 4. Deliver response message. (a) The OTrP Broker returns this to the 2218 app; (b) The app passes this back to the TAM. 2220 5. TAM processing. (a) The TAM processes the response message; (b) 2221 The TAM can look up the signer certificate from the device ID 2222 "did". 2224 If a request is illegitimate or the signature doesn't pass, a 2225 "status" property in the response will indicate the error code and 2226 cause. 2228 9.2.2.3. UpdateSDResponse Message 2230 The response message for a UpdateSDRequest contains the following 2231 content. 2233 { 2234 "UpdateSDTBSResponse": { 2235 "ver": "1.0", 2236 "status": "", 2237 "rid": "", 2238 "tid": "", 2239 "content": ENCRYPTED { 2240 "reason": "", // optional 2241 "did": "", 2242 "cert": "", // optional 2243 "teespaik": "", 2244 "teespaiktype": "", 2245 "dsi": "" 2247 } 2248 } 2249 } 2251 In the response message, the following fields MUST be supplied. 2253 did - The request should have known the signer certificate of this 2254 device from a prior request. This hash value of the device TEE 2255 certificate serves as a quick identifier only. A full device 2256 certificate isn't necessary. 2258 teespaik - the newly generated SP AIK public key for the given SP 2259 if the TEE SP AIK for the SP is asked to be renewed in the request. 2260 This is an optional value if "dsi" is included in the response, 2261 which will contain all up-to-date TEE SP AIK key pairs. 2263 Similar to the template for the creation of the encrypted and signed 2264 CreateSDResponse, the final UpdateSDResponse looks like the 2265 following. 2267 { 2268 "UpdateSDResponse": { 2269 "payload": "", 2270 "protected": { 2271 "" 2272 }, 2273 "signature": "" 2275 } 2276 } 2278 When the TEE fails to respond, the OTrP Broker will not provide a 2279 subsequent response to the TAM. The TAM should treat this as if the 2280 device has gone offline where a response is never delivered back. 2282 9.2.2.4. Error Conditions 2284 An error may occur if a request isn't valid or the TEE runs into some 2285 error. The list of possible errors are as follows. Refer to the 2286 Error Code List (Section 13.1) for detailed causes and actions. 2288 ERR_REQUEST_INVALID 2290 ERR_UNSUPPORTED_MSG_VERSION 2292 ERR_UNSUPPORTED_CRYPTO_ALG 2294 ERR_DEV_STATE_MISMATCH 2296 ERR_SD_NOT_FOUND 2298 ERR_SDNAME_ALREADY_USED 2300 ERR_SPCERT_INVALID 2302 ERR_TEE_FAIL 2304 ERR_TAM_NOT_AUTHORIZED 2306 ERR_TAM_NOT_TRUSTED 2308 9.2.3. DeleteSD 2310 A TAM sends a DeleteSDRequest message to a TEE to delete a specified 2311 SD that it owns. An SD can be deleted only if there is no TA 2312 associated with this SD in the device. The request message can 2313 contain a flag to instruct the TEE to delete all related TAs in an SD 2314 and then delete the SD. 2316 The target TEE will operate with the following logic. 2318 1. Look up the given SD specified in the request message 2320 2. Check that the TAM owns the SD 2322 3. Check that the device state hasn't changed since the last 2323 operation 2325 4. Check whether there are TAs in this SD 2327 5. If TA exists in an SD, check whether the request instructs 2328 whether the TA should be deleted. If the request instructs the 2329 TEE to delete TAs, delete all TAs in this SD. If the request 2330 doesn't instruct the TEE to delete TAs, return an error 2331 "ERR_SD_NOT_EMPTY". 2333 6. Delete the SD 2335 7. If this is the last SD of this SP, delete the TEE SP AIK key. 2337 9.2.3.1. DeleteSDRequest Message 2339 The request message for DeleteSD has the following JSON format. 2341 { 2342 "DeleteSDTBSRequest": { 2343 "ver": "1.0", 2344 "rid": "", 2345 "tid": "", // this may be from prior message 2346 "tee": "", 2347 "nextdsi": true | false, 2348 "dsihash": "", 2349 "content": ENCRYPTED { // this piece of JSON will be encrypted 2350 "tamid": "", 2351 "sdname": "", 2352 "deleteta": true | false 2353 } 2354 } 2355 } 2357 In the message, 2359 rid - A unique value to identify this request 2360 tid - A unique value to identify this transaction. It can have the 2361 same value for the tid in the preceding GetDeviceStateRequest. 2363 tee - TEE ID returned from the previous response 2364 GetDeviceStateResponse 2366 nextdsi - Indicates whether the up-to-date Device State Information 2367 (DSI) is to be returned in the response to this request. 2369 dsihash - The BASE64-encoded SHA256 hash value of the DSI data 2370 returned in the prior TAM operation with this target TEE. This 2371 value is always included such that a receiving TEE can check 2372 whether the device state has changed since its last query. It 2373 helps enforce SD update order in the right sequence without 2374 accidentally overwriting an update that was done simultaneously. 2376 content - The "content" is a JSON encrypted message that includes 2377 actual input for the SD update. The standard JSON content 2378 encryption key (CEK) is used, and the CEK is encrypted by the 2379 target TEE's public key. 2381 tamid - SD owner claim by TAM - an SD owned by a TAM will be 2382 associated with a trusted identifier defined as an attribute in the 2383 signer TAM certificate. 2385 sdname - the name of the target SD to be updated. 2387 deleteta - the value should be boolean 'true' or 'false'. If it is 2388 present and the value is 'true', the TEE should delete all TAs 2389 associated with the SD in the device. 2391 According to the OTrP message template, the full request 2392 DeleteSDRequest is a signed message over the DeleteSDTBSRequest as 2393 follows. 2395 { 2396 "DeleteSDRequest": { 2397 "payload": "", 2398 "protected": "", 2399 "header": "", 2400 "signature": "" 2401 } 2402 } 2404 TAM signer certificate is included in the "header" property. 2406 9.2.3.2. Request Processing Requirements at a TEE 2408 Upon receiving a request message DeleteSDRequest at a TEE, the TEE 2409 must validate a request: 2411 1. Validate the JSON request message 2413 * Validate JSON message signing 2415 * Validate that the request TAM certificate is chained to a 2416 trusted CA that the TEE embeds as its trust anchor. The TAM 2417 certificate status check is generally not needed anymore in 2418 this request. The prior request should have validated the TAM 2419 certificate's revocation status. 2421 * Compare dsihash with the TEE cached last response DSI data to 2422 this TAM 2424 * Decrypt to get the plaintext of the content 2426 * Check that the target SD name is supplied 2428 * Check whether the requested SD exists 2430 * Check that the TAM owns this TAM by verifying that the tamid 2431 in the SD matches the TAM certificate's TAM ID attribute 2433 * Now the TEE is ready to carry out the update listed in the 2434 "content" message 2436 2. If the request is valid, deletion action 2438 * Check TA existence in this SD 2440 * If "deleteta" is "true", delete all TAs in this SD. If the 2441 value of "deleteta" is false and some TA exists, return an 2442 error "ERR_SD_NOT_EMPTY" 2444 * Delete the SD 2446 * Delete the TEE SP AIK key pair if this SD is the last one for 2447 the SP 2449 * Now the TEE is ready to construct the response message 2451 3. Construct a DeleteSDResponse message 2453 * Create response content 2454 + Operation status 2456 + "did" or full signer certificate information, 2458 + Updated DSI data if requested 2460 * The response message is encrypted with the same JWE CEK of the 2461 request without recreating a new content encryption key. 2463 * The encrypted message is signed with TEEpriv. The signer 2464 information ("did" or TEEcert) is encrypted. 2466 4. Deliver response message. (a) The OTrP Broker returns this to the 2467 app; (b) The app passes this back to the TAM 2469 5. TAM processing. (a) The TAM processes the response message; (b) 2470 The TAM can look up signer certificate from the device ID "did". 2472 If a request is illegitimate or the signature doesn't pass, a 2473 "status" property in the response will indicate the error code and 2474 cause. 2476 9.2.3.3. DeleteSDResponse Message 2478 The response message for a DeleteSDRequest contains the following 2479 content. 2481 { 2482 "DeleteSDTBSResponse": { 2483 "ver": "1.0", 2484 "status": "", 2485 "rid": "", 2486 "tid": "", 2487 "content": ENCRYPTED { 2488 "reason": "", // optional 2489 "did": "", 2490 "dsi": "" 2492 } 2493 } 2494 } 2496 In the response message, the following fields MUST be supplied. 2498 did - The request should have known the signer certificate of this 2499 device from a prior request. This hash value of the device TEE 2500 certificate serves as a quick identifier only. A full device 2501 certificate isn't necessary. 2503 The final DeleteSDResponse looks like the following. 2505 { 2506 "DeleteSDResponse": { 2507 "payload": "", 2508 "protected": { 2509 "" 2510 }, 2511 "signature": "" 2513 } 2514 } 2516 When the TEE fails to respond, the OTrP Broker will not provide a 2517 subsequent response to the TAM. The TAM should treat this as if the 2518 device has gone offline where a response is never delivered back. 2520 9.2.3.4. Error Conditions 2522 An error may occur if a request isn't valid or the TEE runs into some 2523 error. The list of possible errors is as follows. Refer to the 2524 Error Code List (Section 13.1) for detailed causes and actions. 2526 ERR_REQUEST_INVALID 2528 ERR_UNSUPPORTED_MSG_VERSION 2530 ERR_UNSUPPORTED_CRYPTO_ALG 2532 ERR_DEV_STATE_MISMATCH 2534 ERR_SD_NOT_EMPTY 2536 ERR_SD_NOT_FOUND 2538 ERR_TEE_FAIL 2540 ERR_TAM_NOT_AUTHORIZED 2542 ERR_TAM_NOT_TRUSTED 2544 9.3. Trusted Application Management 2546 This protocol doesn't introduce a TA container concept. All TA 2547 authorization and management will be up to the TEE implementation. 2549 The following three TA management commands are supported. 2551 o InstallTA - provision a TA by TAM 2553 o UpdateTA - update a TA by TAM 2555 o DeleteTA - remove TA registration information with an SD, remove 2556 the TA binary and all TA-related data in a TEE 2558 9.3.1. InstallTA 2560 TA binary data and related personalization data if there is any can 2561 be from two sources: 2563 1. A TAM supplies the signed and encrypted TA binary 2565 2. A Client Application supplies the TA binary 2567 This specification primarily considers the first case where a TAM 2568 supplies a TA binary. This is to ensure that a TEE can properly 2569 validate whether a TA is trustworthy. Further, TA personalization 2570 data will be encrypted by the TEE device's SP public key for end-to- 2571 end protection. A Client Application bundled TA case will be 2572 addressed separately later. 2574 A TAM sends the following information in a InstallTARequest message 2575 to a target TEE: 2577 o The target SD information: SP ID and SD name 2579 o Encrypted TA binary data. TA data is encrypted with the TEE SP 2580 AIK. 2582 o TA metadata. It is optional to include the SP signer certificate 2583 for the SD to add if the SP has changed signer since the SD was 2584 created. 2586 The TEE processes the command given by the TAM to install a TA into 2587 an SP's SD. It does the following: 2589 o Validation 2591 * The TEE validates the TAM message authenticity 2593 * Decrypt to get request content 2595 * Look up the SD with the SD name 2597 * Checks that the TAM owns the SD 2598 * Checks that the DSI hash matches which shows that the device 2599 state hasn't changed 2601 o If the request is valid, continue to do the TA validation 2603 * Decrypt to get the TA binary data and any personalization data 2604 with the "TEE SP AIK private key" 2606 * Check that SP ID is the one that is registered with the SP SD 2608 * Check that the TA signer is either a newly given SP certificate 2609 or the one that is already trusted by the SD from the previous 2610 TA installation. The TA signing method is specific to a TEE. 2611 This specification doesn't define how a TA should be signed; a 2612 TAM should support TEE specific TA signing when it supports 2613 that TEE. 2615 * If a TA signer is given in the request, add this signer into 2616 the SD. 2618 o If the above validation passed, continue to do TA installation 2620 * The TEE re-encrypts the TA binary and its personalization data 2621 with its own method. 2623 * The TEE enrolls and stores the TA in a secure storage. 2625 o Construct a response message. This involves signing encrypted 2626 status information for the requesting TAM. 2628 9.3.1.1. InstallTARequest Message 2629 The request message for InstallTA has the following JSON format. 2631 { 2632 "InstallTATBSRequest": { 2633 "ver": "1.0", 2634 "rid": "", 2635 "tid": "", 2636 "tee": "", 2637 "nextdsi": true | false, 2638 "dsihash": "", 2639 "content": ENCRYPTED { 2640 "tamid": "", 2641 "spid": "", 2642 "sdname": "", 2643 "spcert": "", // optional 2644 "taid": "" 2645 }, 2646 "encrypted_ta": { 2647 "key": "", 2649 "iv": "", 2650 "alg": "", 2652 "cipherpdata": "" 2654 } 2655 } 2656 } 2658 In the message, 2660 rid - A unique value to identify this request 2662 tid - A unique value to identify this transaction. It can have the 2663 same value for the tid in the preceding GetDeviceStateRequest. 2665 tee - TEE ID returned from the previous GetDeviceStateResponse 2667 nextdsi - Indicates whether the up-to-date Device State Information 2668 (DSI) is to be returned in the response to this request. 2670 dsihash - The BASE64-encoded SHA256 hash value of the DSI data 2671 returned in the prior TAM operation with this target TEE. This 2672 value is always included such that a receiving TEE can check 2673 whether the device state has changed since its last query. It 2674 helps enforce SD update order in the right sequence without 2675 accidentally overwriting an update that was done simultaneously. 2677 content - The "content" is a JSON encrypted message that includes 2678 actual input for the SD update. The standard JSON content 2679 encryption key (CEK) is used, and the CEK is encrypted by the 2680 target TEE's public key. 2682 tamid - SD owner claim by TAM - An SD owned by a TAM will be 2683 associated with a trusted identifier defined as an attribute in the 2684 signer TAM certificate. 2686 spid - SP identifier of the TA owner SP 2688 sdname - the name of the target SD where the TA is to be installed 2690 spcert - an optional field to specify the SP certificate that signed 2691 the TA. This is sent if the SP has a new certificate that hasn't 2692 been previously registered with the target SD where the TA should 2693 be installed. 2695 taid - the identifier of the TA application to be installed 2697 encrypted_ta - the message portion contains encrypted TA binary data 2698 and personalization data. The TA data encryption key is placed in 2699 "key", which is encrypted by the recipient's public key, using JWE 2700 enveloped structure. The TA data encryption uses symmetric key 2701 based encryption such as AESCBC. 2703 According to the OTrP message template, the full request 2704 InstallTARequest is a signed message over the InstallTATBSRequest as 2705 follows. 2707 { 2708 "InstallTARequest": { 2709 "payload": "", 2710 "protected": "", 2711 "header": "", 2712 "signature": "" 2713 } 2714 } 2716 9.3.1.2. InstallTAResponse Message 2718 The response message for a InstallTARequest contains the following 2719 content. 2721 { 2722 "InstallTATBSResponse": { 2723 "ver": "1.0", 2724 "status": "", 2725 "rid": "", 2726 "tid": "", 2727 "content": ENCRYPTED { 2728 "reason":"", // optional 2729 "did": "", 2730 "dsi": "" 2732 } 2733 } 2734 } 2736 In the response message, the following fields MUST be supplied. 2738 did - the SHA256 hash of the device TEE certificate. This shows 2739 the device ID explicitly to the receiving TAM. 2741 The final message InstallTAResponse looks like the following. 2743 { 2744 "InstallTAResponse": { 2745 "payload":"", 2746 "protected": { 2747 "" 2748 }, 2749 "signature": "" 2751 } 2752 } 2754 When the TEE fails to respond, the OTrP Broker will not provide a 2755 subsequent response to the TAM. The TAM should treat this as if the 2756 device has gone offline where a response is never delivered back. 2758 9.3.1.3. Error Conditions 2760 An error may occur if a request isn't valid or the TEE runs into some 2761 error. The list of possible errors are as follows. Refer to the 2762 Error Code List (Section 13.1) for detailed causes and actions. 2764 ERR_REQUEST_INVALID 2766 ERR_UNSUPPORTED_MSG_VERSION 2767 ERR_UNSUPPORTED_CRYPTO_ALG 2769 ERR_DEV_STATE_MISMATCH 2771 ERR_SD_NOT_FOUND 2773 ERR_TA_INVALID 2775 ERR_TA_ALREADY_INSTALLED 2777 ERR_TEE_FAIL 2779 ERR_TEE_RESOURCE_FULL 2781 ERR_TAM_NOT_AUTHORIZED 2783 ERR_TAM_NOT_TRUSTED 2785 9.3.2. UpdateTA 2787 This TAM-initiated command can update a TA and its data in an SP's SD 2788 that it manages for the following purposes. 2790 1. Update TA binary 2792 2. Update TA's personalization data 2794 The TAM presents the proof of the SD ownership to a TEE, and includes 2795 related information in its signed message. The entire request is 2796 also encrypted for end-to-end confidentiality. 2798 The TEE processes the command from the TAM to update the TA of an SP 2799 SD. It does the following: 2801 o Validation 2803 * The TEE validates the TAM message authenticity 2805 * Decrypt to get request content 2807 * Look up the SD with the SD name 2809 * Checks that the TAM owns the SD 2811 * Checks DSI hash matches that the device state hasn't changed 2813 o TA validation 2814 * Both TA binary and personalization data are optional, but at 2815 least one of them shall be present in the message 2817 * Decrypt to get the TA binary and any personalization data with 2818 the "TEE SP AIK private key" 2820 * Check that SP ID is the one that is registered with the SP SD 2822 * Check that the TA signer is either a newly given SP certificate 2823 or the one in SD. 2825 * If a TA signer is given in the request, add this signer into 2826 the SD. 2828 o If the above validation passes, continue to do TA update 2830 * The TEE re-encrypts the TA binary and its personalization data 2831 with its own method 2833 * The TEE replaces the existing TA binary and its personalization 2834 data with the new binary and data. 2836 o Construct a response message. This involves signing a encrypted 2837 status information for the requesting TAM. 2839 9.3.2.1. UpdateTARequest Message 2840 The request message for UpdateTA has the following JSON format. 2842 { 2843 "UpdateTATBSRequest": { 2844 "ver": "1.0", 2845 "rid": "", 2846 "tid": "", 2847 "tee": "", 2848 "nextdsi": true | false, 2849 "dsihash": "", 2850 "content": ENCRYPTED { 2851 "tamid": "", 2852 "spid": "", 2853 "sdname": "", 2854 "spcert": "", // optional 2855 "taid": "" 2856 }, 2857 "encrypted_ta": { 2858 "key": "", 2860 "iv": "", 2861 "alg": "", 2864 "ciphernewpdata": "" 2866 // optional 2867 } 2868 } 2869 } 2871 In the message, 2873 rid - A unique value to identify this request 2875 tid - A unique value to identify this transaction. It can have the 2876 same value for the tid in the preceding GetDeviceStateRequest. 2878 tee - TEE ID returned from the previous GetDeviceStateResponse 2880 nextdsi - Indicates whether the up-to-date Device State Information 2881 (DSI) is to be returned in the response to this request. 2883 dsihash - The BASE64-encoded SHA256 hash value of the DSI data 2884 returned in the prior TAM operation with this target TEE. This 2885 value is always included such that a receiving TEE can check 2886 whether the device state has changed since its last query. It 2887 helps enforce SD update order in the right sequence without 2888 accidentally overwriting an update that was done simultaneously. 2890 content - The "content" is a JSON encrypted message that includes 2891 actual input for the SD update. The standard JSON content 2892 encryption key (CEK) is used, and the CEK is encrypted by the 2893 target TEE's public key. 2895 tamid - SD owner claim by TAM - an SD owned by a TAM will be 2896 associated with a trusted identifier defined as an attribute in the 2897 signer TAM certificate. 2899 spid - SP identifier of the TA owner SP 2901 spcert - an optional field to specify the SP certificate that signed 2902 the TA. This is sent if the SP has a new certificate that hasn't 2903 been previously registered with the target SD where the TA is to be 2904 installed. 2906 sdname - the name of the target SD where the TA should be updated 2908 taid - an identifier for the TA application to be updated 2910 encrypted_ta - the message portion contains newly encrypted TA 2911 binary data and personalization data. 2913 According to the OTrP message template, the full request 2914 UpdateTARequest is a signed message over the UpdateTATBSRequest as 2915 follows. 2917 { 2918 "UpdateTARequest": { 2919 "payload": "", 2920 "protected": "", 2921 "header": "", 2922 "signature": "" 2923 } 2924 } 2926 9.3.2.2. UpdateTAResponse Message 2928 The response message for a UpdateTARequest contains the following 2929 content. 2931 { 2932 "UpdateTATBSResponse": { 2933 "ver": "1.0", 2934 "status": "", 2935 "rid": "", 2936 "tid": "", 2937 "content": ENCRYPTED { 2938 "reason": "", // optional 2939 "did": "", 2940 "dsi": "" 2942 } 2943 } 2944 } 2946 In the response message, the following fields MUST be supplied. 2948 did - the SHA256 hash of the device TEE certificate. This shows 2949 the device ID explicitly to the receiving TAM. 2951 The final message UpdateTAResponse looks like the following. 2953 { 2954 "UpdateTAResponse": { 2955 "payload":"", 2956 "protected": { 2957 "" 2958 }, 2959 "signature": "" 2961 } 2962 } 2964 When the TEE fails to respond, the OTrP Broker will not provide a 2965 subsequent response to the TAM. The TAM should treat this as if the 2966 device has gone offline where a response is never delivered back. 2968 9.3.2.3. Error Conditions 2970 An error may occur if a request isn't valid or the TEE runs into some 2971 error. The list of possible errors are as follows. Refer to the 2972 Error Code List (Section 13.1) for detailed causes and actions. 2974 ERR_REQUEST_INVALID 2976 ERR_UNSUPPORTED_MSG_VERSION 2977 ERR_UNSUPPORTED_CRYPTO_ALG 2979 ERR_DEV_STATE_MISMATCH 2981 ERR_SD_NOT_FOUND 2983 ERR_TA_INVALID 2985 ERR_TA_NOT_FOUND 2987 ERR_TEE_FAIL 2989 ERR_TAM_NOT_AUTHORIZED 2991 ERR_TAM_NOT_TRUSTED 2993 9.3.3. DeleteTA 2995 This operation defines OTrP messages that allow a TAM to instruct a 2996 TEE to delete a TA for an SP in a given SD. A TEE will delete a TA 2997 from an SD and also TA data in the TEE. A Client Application cannot 2998 directly access TEE or OTrP Broker to delete a TA. 3000 9.3.3.1. DeleteTARequest Message 3002 The request message for DeleteTA has the following JSON format. 3004 { 3005 "DeleteTATBSRequest": { 3006 "ver": "1.0", 3007 "rid": "", 3008 "tid": "", 3009 "tee": "", 3010 "nextdsi": true | false, 3011 "dsihash": "", 3012 "content": ENCRYPTED { 3013 "tamid": "", 3014 "sdname": "", 3015 "taid": "" 3017 } 3018 } 3019 } 3021 In the message, 3023 rid - A unique value to identify this request 3024 tid - A unique value to identify this transaction. It can have the 3025 same value for the tid in the preceding GetDeviceStateRequest. 3027 tee - The TEE ID returned from the previous GetDeviceStateResponse 3029 nextdsi - Indicates whether the up-to-date Device State Information 3030 (DSI) is to be returned in the response to this request. 3032 dsihash - The BASE64-encoded SHA256 hash value of the DSI data 3033 returned in the prior TAM operation with this target TEE. This 3034 value is always included such that a receiving TEE can check 3035 whether the device state has changed since its last query. It 3036 helps enforce SD update order in the right sequence without 3037 accidentally overwriting an update that was done simultaneously. 3039 content - The "content" is a JSON encrypted message that includes 3040 actual input for the SD update. The standard JSON content 3041 encryption key (CEK) is used, and the CEK is encrypted by the 3042 target TEE's public key. 3044 tamid - SD owner claim by TAM - an SD owned by a TAM will be 3045 associated with a trusted identifier defined as an attribute in the 3046 signer TAM certificate. 3048 sdname - the name of the target SD where the TA is installed 3050 taid - an identifier for the TA application to be deleted 3052 According to the OTrP message template, the full request 3053 DeleteTARequest is a signed message over the DeleteTATBSRequest as 3054 follows. 3056 { 3057 "DeleteTARequest": { 3058 "payload": "", 3059 "protected": "", 3060 "header": "", 3061 "signature": "" 3063 } 3064 } 3066 9.3.3.2. Request Processing Requirements at a TEE 3068 A TEE processes a command from a TAM to delete a TA of an SP SD. It 3069 does the following: 3071 1. Validate the JSON request message 3073 * The TEE validates TAM message authenticity 3075 * Decrypt to get request content 3077 * Look up the SD and the TA with the given SD name and TA ID 3079 * Checks that the TAM owns the SD, and TA is installed in the SD 3081 * Checks that the DSI hash matches and the the device state 3082 hasn't changed 3084 2. Deletion action 3086 * If all the above validation points pass, the TEE deletes the 3087 TA from the SD 3089 * The TEE SHOULD also delete all personalization data for the TA 3091 3. Construct DeleteTAResponse message. 3093 If a request is illegitimate or the signature doesn't pass, a 3094 "status" property in the response will indicate the error code and 3095 cause. 3097 9.3.3.3. DeleteTAResponse Message 3099 The response message for a DeleteTARequest contains the following 3100 content. 3102 { 3103 "DeleteTATBSResponse": { 3104 "ver": "1.0", 3105 "status": "", 3106 "rid": "", 3107 "tid": "", 3108 "content": ENCRYPTED { 3109 "reason": "", // optional 3110 "did": "", 3111 "dsi": "" 3113 } 3114 } 3115 } 3117 In the response message, the following fields MUST be supplied. 3119 did - the SHA256 hash of the device TEE certificate. This shows 3120 the device ID explicitly to the receiving TAM. 3122 The final message DeleteTAResponse looks like the following. 3124 { 3125 "DeleteTAResponse": { 3126 "payload": "", 3127 "protected": { 3128 "" 3129 }, 3130 "signature": "" 3132 } 3133 } 3135 When the TEE fails to respond, the OTrP Broker will not provide a 3136 subsequent response to the TAM. The TAM should treat this as if the 3137 device has gone offline where a response is never delivered back. 3139 9.3.3.4. Error Conditions 3141 An error may occur if a request isn't valid or the TEE runs into some 3142 error. The list of possible errors are as follows. Refer to the 3143 Error Code List (Section 13.1) for detailed causes and actions. 3145 ERR_REQUEST_INVALID 3147 ERR_UNSUPPORTED_MSG_VERSION 3148 ERR_UNSUPPORTED_CRYPTO_ALG 3150 ERR_DEV_STATE_MISMATCH 3152 ERR_SD_NOT_FOUND 3154 ERR_TA_NOT_FOUND 3156 ERR_TEE_FAIL 3158 ERR_TAM_NOT_AUTHORIZED 3160 ERR_TAM_NOT_TRUSTED 3162 10. Response Messages a TAM May Expect 3164 A TAM expects some feedback from a remote device when a request 3165 message is delivered to a device. The following three types of 3166 responses SHOULD be supplied. 3168 Type 1: Expect a valid TEE-generated response message 3170 A valid TEE signed response may contain errors detected by a TEE, 3171 e.g. a TAM is trusted but some TAM-supplied data is missing, for 3172 example, SP ID doesn't exist. TEE MUST be able to sign and 3173 encrypt. 3175 If a TEE isn't able to sign a response, the TEE returns an error 3176 to the OTrP Broker without giving any other internal information. 3177 The OTrP Broker will be generating the response. 3179 Type 2: The OTrP Broker generated error message when TEE fails. 3180 OTrP Broker errors will be defined in this document. 3182 A Type 2 message has the following format. 3184 { 3185 "OTrPBrokerError": { 3186 "ver": "1.0", 3187 "rid": "", 3188 "tid": "", 3189 "errcode": "ERR_AGENT_TEE_UNKNOWN | ERR_AGENT_TEE_BUSY" 3190 } 3191 } 3193 Type 3: OTrP Broker itself isn't reachable or fails. A Client 3194 Application is responsible to handle error and respond the TAM in 3195 its own way. This is out of scope for this specification. 3197 11. Basic Protocol Profile 3199 This section describes a baseline for interoperability among the 3200 protocol entities, mainly, the TAM and TEE. 3202 A TEE MUST support RSA algorithms. It is optional to support ECC 3203 algorithms. A TAM SHOULD use a RSA certificate for TAM message 3204 signing. It may use an ECC certificate if it detects that the TEE 3205 supports ECC according to the field "supportedsigalgs" in a TEE 3206 response. 3208 A TAM MUST support both RSA 2048-bit algorithm and ECC P-256 3209 algorithms. With this, a TEE and TFW certificate can be either RSA 3210 or ECC type. 3212 JSON signing algorithms 3214 o RSA PKCS#1 with SHA256 signing : "RS256" 3216 o ECDSA with SHA256 signing : "ES256" 3218 JSON asymmetric encryption algorithms (describes key-exchange or key- 3219 agreement algorithm for sharing symmetric key with TEE): 3221 o RSA PKCS#1 : "RSA1_5" 3223 o ECDH using TEE ECC P-256 key and ephemeral ECC key generated by 3224 TAM : "ECDH-ES+A128W" 3226 JSON symmetric encryption algorithms (describes symmetric algorithm 3227 for encrypting body of data, using symmetric key transferred to TEE 3228 using asymmetric encryption): 3230 o Authenticated encryption AES 128 CBC with SHA256 : 3231 {"enc":"A128CBC-HS256"} 3233 12. Attestation Implementation Consideration 3235 It is important to know that the state of a device is appropriate 3236 before trusting that a device is what it says it is. The attestation 3237 scheme for OTrP must also be able to cope with different TEEs, 3238 including those that are OTrP compliant and those that use another 3239 mechanism. In the initial version, only one active TEE is assumed. 3241 It is out of scope how the TAM and the device implement the trust 3242 hierarchy verification. However, it is helpful to understand what 3243 each system provider should do in order to properly implement an OTrP 3244 trust hierarchy. 3246 In this section, we provide some implementation reference 3247 consideration. 3249 12.1. OTrP Trusted Firmware 3251 12.1.1. Attestation signer 3253 It is proposed that attestation for OTrP is based on the TFW layer, 3254 and that further attestation is not performed within the TEE itself 3255 during Security Domain operations. The rationale is that the device 3256 boot process will be defined to start with a secure bootloader 3257 protected with a harden key in eFUSE. The process releases 3258 attestation signing capabilities into the TFW once a trust boot has 3259 been established. In this way the release of the attestation signer 3260 can be considered the first "platform configuration metric", using 3261 Trust Computing Group (TCG) terminology. 3263 12.1.2. TFW Initial Requirements 3265 R1 The TFW must be possible for verification during boot 3267 R2 The TFW must allow a public / private key pair to be generated 3268 during device manufacture 3270 R3 The public key and certificate must be possible to store securely 3272 R4 The private key must be possible to store encrypted at rest 3274 R5 The private key must only be visible to the TFW when it is 3275 decrypted 3277 R6 The TFW must be able to read a list of root and intermediate 3278 certificates that it can use to check certificate chains with. 3279 The list must be stored such that it cannot be tampered with 3281 R7 Need to allow a TEE to access its unique TEE specific private key 3283 12.2. TEE Loading 3285 During boot, the TFW is required to start all of the root TEEs. 3286 Before loading them, the TFW must first determine whether the code 3287 sign signature of the TEE is valid. If TEE integrity is confirmed, 3288 the TEE may be started. The TFW must then be able to receive the 3289 identity certificate from the TEE (if that TEE is OTrP compliant). 3290 The identity certificate and keys will need to be baked into the TEE 3291 image, and therefore also covered by the code signer hash during the 3292 manufacturing process. The private key for the identity certificate 3293 must be securely protected. The private key for a TEE identity must 3294 never be released no matter how the public key and certificate are 3295 released to the TFW. 3297 Once the TFW has successfully booted a TEE and retrieved the identity 3298 certificate, the TFW will commit this to the platform configuration 3299 register (PCR) set, for later use during attestation. At minimum, 3300 the following data must be committed to the PCR for each TEE: 3302 1. Public key and certificate for the TEE 3304 2. TEE identifier that can be used later by a TAM to identify this 3305 TEE 3307 12.3. Attestation Hierarchy 3309 The attestation hierarchy and seed required for TAM protocol 3310 operation must be built into the device at manufacture. Additional 3311 TEEs can be added post-manufacture using the scheme proposed, but it 3312 is outside of the current scope of this document to detail that. 3314 It should be noted that the attestation scheme described is based on 3315 signatures. The only decryption that may take place is through the 3316 use of a bootloader key. 3318 12.3.1. Attestation Hierarchy Establishment: Manufacture 3320 During manufacture the following steps are required: 3322 1. A device-specific TFW key pair and certificate are burnt into the 3323 device. This key pair will be used for signing operations 3324 performed by the TFW. 3326 2. TEE images are loaded and include a TEE instance-specific key 3327 pair and certificate. The key pair and certificate are included 3328 in the image and covered by the code signing hash. 3330 3. The process for TEE images is repeated for any subordinate TEEs, 3331 which are additional TEEs after the root TEE that some devices 3332 have. 3334 12.3.2. Attestation Hierarchy Establishment: Device Boot 3336 During device boot the following steps are required: 3338 1. The boot module releases the TFW private key by decrypting it 3339 with the bootloader key. 3341 2. The TFW verifies the code-signing signature of the active TEE and 3342 places its TEE public key into a signing buffer, along with its 3343 identifier for later access. For a non-OTrP TEE, the TFW leaves 3344 the TEE public key field blank. 3346 3. The TFW signs the signing buffer with the TFW private key. 3348 4. Each active TEE performs the same operation as the TFW, building 3349 up their own signed buffer containing subordinate TEE 3350 information. 3352 12.3.3. Attestation Hierarchy Establishment: TAM 3354 Before a TAM can begin operation in the marketplace to support 3355 devices of a given TEE, it must obtain a TAM certificate from a CA 3356 that is registered in the trust store of devices with that TEE. In 3357 this way, the TEE can check the intermediate and root CA and verify 3358 that it trusts this TAM to perform operations on the TEE. 3360 13. IANA Considerations 3362 There are two IANA requests: a media type and list of error codes. 3364 This section first requests that IANA assign a media type: 3365 application/otrp+json. 3367 Type name: application 3369 Subtype name: otrp+json 3371 Required parameters: none 3373 Optional parameters: none 3375 Encoding considerations: Same as encoding considerations of 3376 application/json as specified in Section 11 of [RFC7159] 3378 Security considerations: See Section 12 of [RFC7159] and Section 14 3379 of this document 3381 Interoperability considerations: Same as interoperability 3382 considerations of application/json as specified in [RFC7159] 3384 Published specification: [TEEPArch] 3386 Applications that use this media type: OTrP implementations 3388 Fragment identifier considerations: N/A 3389 Additional information: 3391 Deprecated alias names for this type: N/A 3393 Magic number(s): N/A 3395 File extension(s): N/A 3397 Macintosh file type code(s): N/A 3399 Person to contact for further information: teep@ietf.org 3401 Intended usage: COMMON 3403 Restrictions on usage: none 3405 Author: See the "Authors' Addresses" section of this document 3407 Change controller: IETF 3409 The error code listed in the next section will be registered. 3411 13.1. Error Code List 3413 This section lists error codes that could be reported by a TA or TEE 3414 in a device in responding to a TAM request, and a separate list that 3415 OTrP Broker may return when the TEE fails to respond. 3417 13.1.1. TEE Signed Error Code List 3419 ERR_DEV_STATE_MISMATCH - A TEE will return this error code if the 3420 DSI hash value from TAM doesn't match the has value of the device's 3421 current DSI. 3423 ERR_SD_ALREADY_EXISTS - This error will occur if an SD to be created 3424 already exists in the TEE. 3426 ERR_SD_NOT_EMPTY - This is reported if a target SD isn't empty. 3428 ERR_SDNAME_ALREADY_USED A TEE will return this error code if the new 3429 SD name already exists in the TEE. 3431 ERR_REQUEST_INVALID - This error will occur if the TEE meets any of 3432 the following conditions with a request message: (1) The request 3433 from a TAM has an invalid message structure; mandatory information 3434 is absent in the message. undefined member or structure is 3435 included. (2) TEE fails to verify signature of the message or 3436 fails to decrypt its contents. 3438 ERR_SPCERT_INVALID - If a new SP certificate for the SD to be 3439 updated is not valid, then the TEE will return this error code. 3441 ERR_TA_ALREADY_INSTALLED - While installing a TA, a TEE will return 3442 this error if the TA has already been installed in the SD. 3444 ERR_TA_INVALID - This error will occur when a TEE meets any of 3445 following conditions while checking validity of TA: (1) The TA 3446 binary has a format that the TEE can't recognize. (2) The TEE fails 3447 to decrypt the encoding of the TA binary and personalization data. 3448 (3) If an SP isn't registered with the SP SD where the TA will be 3449 installed. 3451 ERR_TA_NOT_FOUND - This error will occur when the target TA doesn't 3452 exist in the SD. 3454 ERR_TEE_FAIL - If the TEE fails to process a request because of an 3455 internal error, it will return this error code. 3457 ERR_TEE_RESOURCE_FULL - This error is reported when a device 3458 resource isn't available anymore such as storage space is full. 3460 ERR_TFW_NOT_TRUSTED - A TEE is responsible for determining that the 3461 underlying device firmware is trustworthy. If the TEE determines 3462 the TFW is not trustworthy, then this error will occur. 3464 ERR_TAM_NOT_TRUSTED - Before processing a request, a TEE needs to 3465 make sure whether the sender TAM is trustworthy by checking the 3466 validity of the TAM certificate, etc. If the TEE finds that the 3467 TAM is not trustworthy, then it will return this error code. 3469 ERR_UNSUPPORTED_CRYPTO_ALG - This error will occur if a TEE receives 3470 a request message encoded with cryptographic algorithms that the 3471 TEE doesn't support. 3473 ERR_UNSUPPORTED_MSG_VERSION - This error will occur if a TEE 3474 receives a message version that the TEE can't deal with. 3476 14. Security Consideration 3478 14.1. Cryptographic Strength 3480 The strength of the cryptographic algorithms, using the measure of 3481 'bits of security' defined in NIST SP800-57 allowed for OTrP is: 3483 o At a minimum, 112 bits of security. The limiting factor for this 3484 is the RSA-2048 algorithm, which is indicated as providing 112 3485 bits of symmetric key strength in SP800-57. It is important that 3486 RSA is supported in order to enhance the interoperability of the 3487 protocol. 3489 o The option exists to choose algorithms providing 128 bits of 3490 security. This requires using TEE devices that support ECC P256. 3492 The available algorithms and key sizes specified in this document are 3493 based on industry standards. Over time the recommended or allowed 3494 cryptographic algorithms may change. It is important that the OTrP 3495 allows for crypto-agility. In this specification, TAM and TEE can 3496 negotiate an agreed upon algorithm where both include their supported 3497 algorithm in OTrP message. 3499 14.2. Message Security 3501 OTrP messages between the TAM and TEE are protected by message 3502 security using JWS and JWE. The 'Basic protocol profile' section of 3503 this document describes the algorithms used for this. All OTrP TEE 3504 devices and OTrP TAMs must meet the requirements of the basic 3505 profile. In the future additional 'profiles' can be added. 3507 PKI is used to ensure that the TEE will only communicate with a 3508 trusted TAM, and to ensure that the TAM will only communicate with a 3509 trusted TEE. 3511 14.3. TEE Attestation 3513 It is important that the TAM can trust that it is talking to a 3514 trusted TEE. This is achieved through attestation. The TEE has a 3515 private key and certificate built into it at manufacture, which is 3516 used to sign data supplied by the TAM. This allows the TAM to verify 3517 that the TEE is trusted. 3519 It is also important that the TFW (trusted firmware) can be checked. 3520 The TFW has a private key and certificate built into it at 3521 manufacture, which allows the TEE to check that that the TFW is 3522 trusted. 3524 The GetDeviceState message therefore allows the TAM to check that it 3525 trusts the TEE, and the TEE at this point will check whether it 3526 trusts the TFW. 3528 14.4. TA Protection 3530 A TA will be delivered in an encrypted form. This encryption is an 3531 additional layer within the message encryption described in the 3532 Section 11 of this document. The TA binary is encrypted for each 3533 target device with the device's TEE SP AIK public key. A TAM can 3534 either do this encryption itself or provide the TEE SP AIK public key 3535 to an SP such that the SP encrypts the encrypted TA for distribution 3536 to the TEE. 3538 The encryption algorithm can use a random AES 256 key "taek" with a 3539 16 byte random IV, and the "taek" is encrypted by the "TEE SP AIK 3540 public key". The following encrypted TA data structure is expected 3541 by a TEE: 3543 "encrypted_ta_bin": { 3544 "key": "", 3546 "iv": ", 3547 "alg": "AESCBC", 3548 "cipherdata": "" 3549 } 3551 14.5. TA Personalization Data 3553 An SP or TAM can supply personalization data for a TA to initialize 3554 for a device. Such data is passed through an InstallTA command from 3555 a TAM. The personalization data itself is (or can be) opaque to the 3556 TAM. The data can be from the SP without being revealed to the TAM. 3557 The data is sent in an encrypted manner in a request to a device such 3558 that only the device can decrypt. A device's TEE SP AIK public key 3559 for an SP is used to encrypt the data. Here JWE enveloping is used 3560 to carry all encryption key parameters along with encrypted data. 3562 "encrypted_ta_data": { // "TA personalization data" 3563 "key": "", 3565 "iv": "", 3566 "alg": "AESCBC", 3567 "cipherdata": "" 3569 } 3571 14.6. TA Trust Check at TEE 3573 A TA binary is signed by a TA signer certificate. This TA signing 3574 certificate/private key belongs to the SP, and may be self-signed 3575 (i.e., it need not participate in a trust hierarchy). It is the 3576 responsibility of the TAM to only allow verified TAs from trusted SPs 3577 into the system. Delivery of that TA to the TEE is then the 3578 responsibility of the TEE, using the security mechanisms provided by 3579 the OTrP. 3581 We allow a way for an (untrusted) application to check the 3582 trustworthiness of a TA. OTrP Broker has a function to allow a 3583 Client Application to query the information about a TA. 3585 An application in the Rich O/S may perform verification of the TA by 3586 verifying the signature of the TA. The GetTAInformation function is 3587 available to return the TEE supplied TA signer and TAM signer 3588 information to the application. An application can do additional 3589 trust checks on the certificate returned for this TA. It might trust 3590 the TAM, or require additional SP signer trust chaining. 3592 14.7. One TA Multiple SP Case 3594 A TA for multiple SPs must have a different identifier per SP. A TA 3595 will be installed in a different SD for each respective SP. 3597 14.8. OTrP Broker Trust Model 3599 An OTrP Broker could be malware in the vulnerable REE. A Client 3600 Application will connect its TAM provider for required TA 3601 installation. It gets command messages from the TAM, and passes the 3602 message to the OTrP Broker. 3604 The OTrP is a conduit for enabling the TAM to communicate with the 3605 device's TEE to manage SDs and TAs. All TAM messages are signed and 3606 sensitive data is encrypted such that the OTrP Broker cannot modify 3607 or capture sensitive data. 3609 14.9. OCSP Stapling Data for TAM Signed Messages 3611 The GetDeviceStateRequest message from a TAM to a TEE shall include 3612 OCSP stapling data for the TAM's signer certificate and for 3613 intermediate CA certificates up to the root certificate so that the 3614 TEE can verify the signer certificate's revocation status. 3616 A certificate revocation status check on a TA signer certificate is 3617 OPTIONAL by a TEE. A TAM is responsible for vetting a TA and the SP 3618 before it distributes them to devices. A TEE will trust a TA signer 3619 certificate's validation status done by a TAM when it trusts the TAM. 3621 14.10. Data Protection at TAM and TEE 3623 The TEE implementation provides protection of data on the device. It 3624 is the responsibility of the TAM to protect data on its servers. 3626 14.11. Privacy Consideration 3628 Devices are issued with a unique TEE certificate to attest the 3629 device's validity. This uniqueness also creates a privacy and 3630 tracking risk that must be mitigated. 3632 The TEE will only release the TEE certificate to a trusted TAM (it 3633 must verify the TAM certificate before proceeding). OTrP is designed 3634 such that only a TAM can obtain the TEE device certificate and 3635 firmware certificate - the GetDeviceState message requires signature 3636 checks to validate the TAM is trusted, and OTrP delivers the device's 3637 certificate(s) encrypted such that only that TAM can decrypt the 3638 response. A Client Application will never see the device 3639 certificate. 3641 An SP-specific TEE SP AIK (TEE SP Anonymous Key) is generated by the 3642 protocol for Client Applications. This provides a way for the Client 3643 Application to validate some data that the TEE may send without 3644 requiring the TEE device certificate to be released to the client 3645 device rich O/S , and to optionally allow an SP to encrypt a TA for a 3646 target device without the SP needing to be supplied with the TEE 3647 device certificate. 3649 14.12. Threat Mitigation 3651 A rogue application may perform excessive TA loading. An OTrP Broker 3652 implementation should protect against excessive calls. 3654 Rogue applications might request excessive SD creation. The TAM is 3655 responsible to ensure this is properly guarded against. 3657 Rogue OTrP Broker could replay or send TAM messages out of sequence: 3658 e.g., a TAM sends update1 and update2. The OTrP Broker replays 3659 update2 and update1 again, creating an unexpected result that a 3660 client wants. "dsihash" is used to mitigate this. The TEE MUST store 3661 DSI state and check that the DSI state matches before it does another 3662 update. 3664 Concurrent calls from a TAM to a TEE MUST be handled properly by a 3665 TEE. If multiple concurrent TAM operations take place, these could 3666 fail due to the "dsihash" being modified by another concurrent 3667 operation. The TEE is responsible for resolve any locking such that 3668 one application cannot lock other applications from using the TEE, 3669 except for a short term duration of the TAM operation taking place. 3670 For example, an OTrP operation that starts but never completes (e.g. 3671 loss of connectivity) must not prevent subsequent OTrP messages from 3672 being executed. 3674 14.13. Compromised CA 3676 A root CA for TAM certificates might get compromised. Some TEE trust 3677 anchor update mechanism is expected from device OEMs. A compromised 3678 intermediate CA is covered by OCSP stapling and OCSP validation check 3679 in the protocol. A TEE should validate certificate revocation about 3680 a TAM certificate chain. 3682 If the root CA of some TEE device certificates is compromised, these 3683 devices might be rejected by a TAM, which is a decision of the TAM 3684 implementation and policy choice. Any intermediate CA for TEE device 3685 certificates SHOULD be validated by TAM with a Certificate Revocation 3686 List (CRL) or Online Certificate Status Protocol (OCSP) method. 3688 14.14. Compromised TAM 3690 The TEE SHOULD use validation of the supplied TAM certificates and 3691 OCSP stapled data to validate that the TAM is trustworthy. 3693 Since PKI is used, the integrity of the clock within the TEE 3694 determines the ability of the TEE to reject an expired TAM 3695 certificate, or revoked TAM certificate. Since OCSP stapling 3696 includes signature generation time, certificate validity dates are 3697 compared to the current time. 3699 14.15. Certificate Renewal 3701 TFW and TEE device certificates are expected to be long lived, longer 3702 than the lifetime of a device. A TAM certificate usually has a 3703 moderate lifetime of 2 to 5 years. A TAM should get renewed or 3704 rekeyed certificates. The root CA certificates for a TAM, which are 3705 embedded into the trust anchor store in a device, should have long 3706 lifetimes that don't require device trust anchor update. On the 3707 other hand, it is imperative that OEMs or device providers plan for 3708 support of trust anchor update in their shipped devices. 3710 15. Acknowledgements 3712 We thank Alin Mutu for his contribution to many discussion that 3713 helped to design the trust flow mechanisms, and the creation of the 3714 flow diagrams. We also thank the following people (in alphabetical 3715 order) for their input and review: Sangsu Baek, Rob Coombs, Dapeng 3716 Liu, Dave Thaler, and Pengfei Zhao. 3718 16. References 3720 16.1. Normative References 3722 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3723 Requirement Levels", BCP 14, RFC 2119, 3724 DOI 10.17487/RFC2119, March 1997, 3725 . 3727 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 3728 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 3729 . 3731 [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 3732 Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 3733 2014, . 3735 [RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 3736 Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May 3737 2015, . 3739 [RFC7516] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)", 3740 RFC 7516, DOI 10.17487/RFC7516, May 2015, 3741 . 3743 [RFC7517] Jones, M., "JSON Web Key (JWK)", RFC 7517, 3744 DOI 10.17487/RFC7517, May 2015, 3745 . 3747 [RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518, 3748 DOI 10.17487/RFC7518, May 2015, 3749 . 3751 [TEEPArch] 3752 Pei, M., Tschofenig, H., Atyeo, A., and D. Liu, "Trusted 3753 Execution Environment Provisioning (TEEP) Architecture", 3754 2018, . 3757 16.2. Informative References 3759 [GPTEE] Global Platform, "Global Platform, GlobalPlatform Device 3760 Technology: TEE System Architecture, v1.0", 2013. 3762 [GPTEECLAPI] 3763 Global Platform, "Global Platform, GlobalPlatform Device 3764 Technology: TEE Client API Specification, v1.0", 2013. 3766 Appendix A. Sample Messages 3768 A.1. Sample Security Domain Management Messages 3770 A.1.1. Sample GetDeviceState 3772 A.1.1.1. Sample GetDeviceStateRequest 3774 The TAM builds a "GetDeviceStateTBSRequest" message. 3776 { 3777 "GetDeviceStateTBSRequest": { 3778 "ver": "1.0", 3779 "rid": "8C6F9DBB-FC39-435c-BC89-4D3614DA2F0B", 3780 "tid": "4F454A7F-002D-4157-884E-B0DD1A06A8AE", 3781 "ocspdat": "c2FtcGxlIG9jc3BkYXQgQjY0IGVuY29kZWQgQVNOMQ==", 3782 "icaocspdat": "c2FtcGxlIGljYW9jc3BkYXQgQjY0IGVuY29kZWQgQVNOMQ==", 3783 "supportedsigalgs": "RS256" 3784 } 3785 } 3787 The TAM signs "GetDeviceStateTBSRequest", creating 3788 "GetDeviceStateRequest" 3790 { 3791 "GetDeviceStateRequest": { 3792 "payload":" 3793 ewoJIkdldERldmljZVN0YXRlVEJTUmVxdWVzdCI6IHsKCQkidmVyIjogIjEuMCIsCgkJ 3794 InJpZCI6IHs4QzZGOURCQi1GQzM5LTQzNWMtQkM4OS00RDM2MTREQTJGMEJ9LAoJCSJ0 3795 aWQiOiAiezRGNDU0QTdGLTAwMkQtNDE1Ny04ODRFLUIwREQxQTA2QThBRX0iLAoJCSJv 3796 Y3NwZGF0IjogImMyRnRjR3hsSUc5amMzQmtZWFFnUWpZMElHVnVZMjlrWldRZ1FWTk9N 3797 UT09IiwKCQkiaWNhb2NzcGRhdCI6ICJjMkZ0Y0d4bElHbGpZVzlqYzNCa1lYUWdRalkw 3798 SUdWdVkyOWtaV1FnUVZOT01RPT0iLAoJCSJzdXBwb3J0ZWRzaWdhbGdzIjogIlJTMjU2 3799 IgoJfQp9", 3800 "protected": "eyJhbGciOiJSUzI1NiJ9", 3801 "header": { 3802 "x5c": ["ZXhhbXBsZSBBU04xIHNpZ25lciBjZXJ0aWZpY2F0ZQ==", 3803 "ZXhhbXBsZSBBU04xIENBIGNlcnRpZmljYXRl"] 3804 }, 3805 "signature":"c2FtcGxlIHNpZ25hdHVyZQ" 3806 } 3807 } 3809 A.1.1.2. Sample GetDeviceStateResponse 3811 The TAM sends "GetDeviceStateRequest" to the OTrP Broker 3812 The OTrP Broker obtains "dsi" from each TEE. (In this example there 3813 is a single TEE.) 3815 The TEE obtains signed "fwdata" from firmware. 3817 The TEE builds "dsi" - summarizing device state of the TEE. 3819 { 3820 "dsi": { 3821 "tfwdata": { 3822 "tbs": "ezRGNDU0QTdGLTAwMkQtNDE1Ny04ODRFLUIwREQxQTA2QThBRX0=", 3823 "cert": "ZXhhbXBsZSBGVyBjZXJ0aWZpY2F0ZQ==", 3824 "sigalg": "RS256", 3825 "sig": "c2FtcGxlIEZXIHNpZ25hdHVyZQ==" 3826 }, 3827 "tee": { 3828 "name": "Primary TEE", 3829 "ver": "1.0", 3830 "cert": "c2FtcGxlIFRFRSBjZXJ0aWZpY2F0ZQ==", 3831 "cacert": [ 3832 "c2FtcGxlIENBIGNlcnRpZmljYXRlIDE=", 3833 "c2FtcGxlIENBIGNlcnRpZmljYXRlIDI=" 3834 ], 3835 "sdlist": { 3836 "cnt": "1", 3837 "sd": [ 3838 { 3839 "name": "default.acmebank.com", 3840 "spid": "acmebank.com", 3841 "talist": [ 3842 { 3843 "taid": "acmebank.secure.banking", 3844 "taname": "Acme secure banking app" 3845 }, 3846 { 3847 "taid": "acmebank.loyalty.rewards", 3848 "taname": "Acme loyalty rewards app" 3849 } 3850 ] 3851 } 3852 ] 3853 }, 3854 "teeaiklist": [ 3855 { 3856 "spaik": "c2FtcGxlIEFTTjEgZW5jb2RlZCBQS0NTMSBwdWJsaWNrZXk=", 3857 "spaiktype": "RSA", 3858 "spid": "acmebank.com" 3859 } 3860 ] 3861 } 3862 } 3863 } 3865 The TEE encrypts "dsi", and embeds it into a 3866 "GetDeviceTEEStateTBSResponse" message. 3868 { 3869 "GetDeviceTEEStateTBSResponse": { 3870 "ver": "1.0", 3871 "status": "pass", 3872 "rid": "{8C6F9DBB-FC39-435c-BC89-4D3614DA2F0B}", 3873 "tid": "{4F454A7F-002D-4157-884E-B0DD1A06A8AE}", 3874 "signerreq":"false", 3875 "edsi": { 3876 "protected": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0K", 3877 "recipients": [ 3878 { 3879 "header": { 3880 "alg": "RSA1_5" 3881 }, 3882 "encrypted_key": 3883 " 3884 QUVTMTI4IChDRUspIGtleSwgZW5jcnlwdGVkIHdpdGggVFNNIFJTQSBwdWJsaWMg 3885 a2V5LCB1c2luZyBSU0ExXzUgcGFkZGluZw" 3886 } 3887 ], 3888 "iv": "ySGmfZ69YlcEilNr5_SGbA", 3889 "ciphertext": 3890 " 3891 c2FtcGxlIGRzaSBkYXRhIGVuY3J5cHRlZCB3aXRoIEFFUzEyOCBrZXkgZnJvbSByZW 3892 NpcGllbnRzLmVuY3J5cHRlZF9rZXk", 3893 "tag": "c2FtcGxlIGF1dGhlbnRpY2F0aW9uIHRhZw" 3894 } 3895 } 3896 } 3898 The TEE signs "GetDeviceTEEStateTBSResponse" and returns it to the 3899 OTrP Broker. The OTrP Broker encodes "GetDeviceTEEStateResponse" 3900 into an array to form "GetDeviceStateResponse". 3902 { 3903 "GetDeviceStateResponse": [ 3904 { 3905 "GetDeviceTEEStateResponse": { 3906 "payload": 3907 " 3908 ewogICJHZXREZXZpY2VURUVTdGF0ZVRCU1Jlc3BvbnNlIjogewogICAgInZlciI6 3909 ICIxLjAiLAogICAgInN0YXR1cyI6ICJwYXNzIiwKICAgICJyaWQiOiAiezhDNkY5 3910 REJCLUZDMzktNDM1Yy1CQzg5LTREMzYxNERBMkYwQn0iLAogICAgInRpZCI6ICJ7 3911 NEY0NTRBN0YtMDAyRC00MTU3LTg4NEUtQjBERDFBMDZBOEFFfSIsCgkic2lnbmVy 3912 cmVxIjoiZmFsc2UiLAogICAgImVkc2kiOiB7CiAgICAgICJwcm90ZWN0ZWQiOiAi 3913 ZXlKbGJtTWlPaUpCTVRJNFEwSkRMVWhUTWpVMkluMEsiLAogICAgICAicmVjaXBp 3914 ZW50cyI6IFsKICAgICAgICB7CiAgICAgICAgICAiaGVhZGVyIjogewogICAgICAg 3915 ICAgImFsZyI6ICJSU0ExXzUiCiAgICAgICAgfSwKICAgICAgICAiZW5jcnlwdGVk 3916 X2tleSI6CiAgICAgICAgIgogICAgICAgIFFVVlRNVEk0SUNoRFJVc3BJR3RsZVN3 3917 Z1pXNWpjbmx3ZEdWa0lIZHBkR2dnVkZOTklGSlRRU0J3ZFdKc2FXTWcKICAgICAg 3918 ICBhMlY1TENCMWMybHVaeUJTVTBFeFh6VWdjR0ZrWkdsdVp3IgogICAgICAgIH0K 3919 ICAgICAgXSwKICAgICAgIml2IjogInlTR21mWjY5WWxjRWlsTnI1X1NHYkEiLAog 3920 ICAgICAiY2lwaGVydGV4dCI6CiAgICAgICIKICAgICAgYzJGdGNHeGxJR1J6YVNC 3921 a1lYUmhJR1Z1WTNKNWNIUmxaQ0IzYVhSb0lFRkZVekV5T0NCclpYa2dabkp2YlNC 3922 eVpXCiAgICAgIE5wY0dsbGJuUnpMbVZ1WTNKNWNIUmxaRjlyWlhrIiwKICAgICAg 3923 InRhZyI6ICJjMkZ0Y0d4bElHRjFkR2hsYm5ScFkyRjBhVzl1SUhSaFp3IgogICAg 3924 fQogIH0KfQ", 3925 "protected": "eyJhbGciOiJSUzI1NiJ9", 3926 "signature": "c2FtcGxlIHNpZ25hdHVyZQ" 3927 } 3928 } 3929 ] 3930 } 3932 The TEE returns "GetDeviceStateResponse" back to the OTrP Broker, 3933 which returns message back to the TAM. 3935 A.1.2. Sample CreateSD 3937 A.1.2.1. Sample CreateSDRequest 3938 { 3939 "CreateSDTBSRequest": { 3940 "ver":"1.0", 3941 "rid":"req-01", 3942 "tid":"tran-01", 3943 "tee":"SecuriTEE", 3944 "nextdsi":"false", 3945 "dsihash":"Iu-c0-fGrpMmzbbtiWI1U8u7wMJE7IK8wkJpsVuf2js", 3946 "content":{ 3947 "spid":"bank.com", 3948 "sdname":"sd.bank.com", 3949 "spcert":"MIIDFjCCAn- 3950 gA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X28iPpNwLUCVm1QV 3966 THILI6afLCRWXXclc1L5KGY290OwIdQ", 3967 "tamid":"TAM_x.acme.com", 3968 "did":"zAHkb0-SQh9U_OT8mR5dB-tygcqpUJ9_x07pIiw8WoM" 3969 } 3970 } 3971 } 3973 Below is a sample message after the content is encrypted and encoded 3975 { 3976 "CreateSDRequest": { 3977 "payload":" 3978 eyJDcmVhdGVTRFRCU1JlcXVlc3QiOnsidmVyIjoiMS4wIiwicmlkIjoicmVxLTAxIiwidG 3979 lkIjoidHJhbi0wMSIsInRlZSI6IlNlY3VyaVRFRSIsIm5leHRkc2kiOiJmYWxzZSIsImRz 3980 aWhhc2giOiIyMmVmOWNkM2U3YzZhZTkzMjZjZGI2ZWQ4OTYyMzU1M2NiYmJjMGMyNDRlYz 3981 gyYmNjMjQyNjliMTViOWZkYTNiIiwiY29udGVudCI6eyJwcm90ZWN0ZWQiOiJlLUtBbkdW 3982 dVktS0FuVHJpZ0p4Qk1USTRRMEpETFVoVE1qVTI0b0NkZlEiLCJyZWNpcGllbnRzIjpbey 3983 JoZWFkZXIiOnsiYWxnIjoiUlNBMV81In0sImVuY3J5cHRlZF9rZXkiOiJTUzE2NTl4Q2FJ 3984 c1dUeUlsVTZPLUVsZzU4UUhvT1pCekxVRGptVG9vanBaWE54TVpBakRMcWtaSTdEUzhOVG 3985 FIWHcxczFvZjgydVhsM0d6NlVWMkRoZDJ3R2l6Y2VEdGtXc1RwZDg4QVYwaWpEYTNXa3lk 3986 dEpSVmlPOGdkSlEtV29NSUVJRUxzVGthblZCb25wQkF4ZHE0ckVMbl9TZlliaFg4Zm9ub2 3987 gxUVUifV0sIml2IjoiQXhZOERDdERhR2xzYkdsamIzUm9aUSIsImNpcGhlcnRleHQiOiI1 3988 bmVWZXdndm55UXprR3hZeWw5QlFrZTJVNjVaOHp4NDdlb3NzM3FETy0xY2FfNEpFY3NLcj 3989 ZhNjF5QzBUb0doYnJOQWJXbVRSemMwSXB5bTF0ZjdGemp4UlhBaTZBYn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GSIb3DQEBAQUAA4GNADCBiQKBgQC8ZtxM1bYickpgSVG- 4036 meHInI3f_chlMBdL8l7daOEztSs_a6GLqmvSu- 4037 AoDpTsfEd4EazdMBp5fmgLRGdCYMcI6bgpO94h5CCnlj8xFKPq7qGixdwGUA6b_ZI3 4038 c4cZ8eu73VMNrrn_z3WTZlExlpT9XVj- 4039 ivhfJ4a6T20EtMM5qwIDAQABo4GsMIGpMHQGA1UdIwRtMGuhXqRcMFoxCzAJBgNVBA 4040 YTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRMwEQYDVQQHDApDYWxpZm9ybmlhMSEw 4041 HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGSCCQCX9nxZBNQWDjAJBgNVHR 4042 MEAjAAMA4GA1UdDwEB_wQEAwIGwDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAzANBgkq 4043 hkiG9w0BAQUFAAOBgQAGkz9QpoxghZUWT4ivem4cIckfxzTBBiPHCjrrjB2X8Ktn8G 4044 SZ1MdyIZV8fwdEmD90IvtMHgtzK- 4045 9wo6Aibj_rVIpxGb7trP82uzc2X8VwYnQbuqQyzofQvcwZHLYplvi95pZ5fVrJvnYA 4046 UBFyfrdT5GjqL1nqH3a_Y3QPscuCjg" 4047 }, 4048 "signature":"nuQUsCTEBLeaRzuwd7q1iPIYEJ2eJfurO5sT5Y- 4049 N03zFRcv1jvrqMHtx_pw0Y9YWjmpoWfpfelhwGEko9SgeeBnznmkZbp7kjS6MmX4CKz 4050 9OApe3-VI7yL9Yp0WNdRh3425eYfuapCy3lcXFln5JBAUnU_OzUg3RWxcU_yGnFsw" 4051 } 4052 } 4054 A.1.2.2. Sample CreateSDResponse 4056 { 4057 "CreateSDTBSResponse": { 4058 "ver":"1.0", 4059 "status":"pass", 4060 "rid":"req-01", 4061 "tid":"tran-01", 4062 "content":{ 4063 "did":"zAHkb0-SQh9U_OT8mR5dB-tygcqpUJ9_x07pIiw8WoM", 4064 "sdname":"sd.bank.com", 4065 "teespaik":"AQABjY9KiwH3hkMmSAAN6CLXot525U85WNlWKAQz5TOdfe_CM8h- 4066 X6_EHX1gOXoyRXaBiKMqWb0YZLCABTw1ytdXy2kWa525imRho8Vqn6HDGsJDZPDru9 4067 GnZR8pZX5ge_dWXB_uljMvDttc5iAWEJ8ZgcpLGtBTGLZnQoQbjtn1lIE", 4068 } 4069 } 4070 } 4072 Below is the response message after the content is encrypted and 4073 encoded. 4075 { 4076 "CreateSDResponse": { 4077 "payload":" 4078 eyJDcmVhdGVTRFRCU1Jlc3BvbnNlIjp7InZlciI6IjEuMCIsInN0YXR1cyI6InBhc3Mi 4079 LCJyaWQiOiJyZXEtMDEiLCJ0aWQiOiJ0cmFuLTAxIiwiY29udGVudCI6eyJwcm90ZWN0 4080 ZWQiOiJlLUtBbkdWdVktS0FuVHJpZ0p4Qk1USTRRMEpETFVoVE1qVTI0b0NkZlEiLCJy 4081 ZWNpcGllbnRzIjpbeyJoZWFkZXIiOnsiYWxnIjoiUlNBMV81In0sImVuY3J5cHRlZF9r 4082 ZXkiOiJOX0I4R3pldUlfN2hwd0wwTFpHSTkxVWVBbmxJRkJfcndmZU1yZERrWnFGak1s 4083 VVhjdlI0XzhhOGhyeFI4SXR3aEtFZnVfRWVLRDBQb0dqQ2pCSHcxdG1ULUN6eWhsbW5v 4084 Slk3LXllWnZzRkRpc2VNTkd0eGE0OGZJYUs2VWx5NUZMYXBCZVc5T1I5bmktOU9GQV9j 4085 aFVuWWl3b2Q4ZTJFa0Vpd0JEZ1EzMk0ifV0sIml2IjoiQXhZOERDdERhR2xzYkdsamIz 4086 Um9aUSIsImNpcGhlcnRleHQiOiJsalh6Wk5JTmR1WjFaMXJHVElkTjBiVUp1RDRVV2xT 4087 QVptLWd6YnJINFVDYy1jMEFQenMtMWdWSFk4NTRUR3VMYkdyRmVHcDFqM2Fsb1lacWZp 4088 ZnE4aEt3Ty16RFlBN2tmVFhBZHp6czM4em9xeG4zbHoyM2w1RUlG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FKPq7qGixdwGUA 4108 6b_ZI3c4cZ8eu73VMNrrn_z3WTZlExlpT9XVj- 4109 ivhfJ4a6T20EtMM5qwIDAQABo4GsMIGpMHQGA1UdIwRtMGuhXqRcMFoxCzAJ 4110 BgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRMwEQYDVQQHDApDYWxp 4111 Zm9ybmlhMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGSCCQCX 4112 9nxZBNQWDjAJBgNVHRMEAjAAMA4GA1UdDwEB_wQEAwIGwDAWBgNVHSUBAf8E 4113 DDAKBggrBgEFBQcDAzANBgkqhkiG9w0BAQUFAAOBgQAGkz9QpoxghZUWT4iv 4114 em4cIckfxzTBBiPHCjrrjB2X8Ktn8GSZ1MdyIZV8fwdEmD90IvtMHgtzK- 4115 9wo6Aibj_rVIpxGb7trP82uzc2X8VwYnQbuqQyzofQvcwZHLYplvi95pZ5fV 4116 rJvnYAUBFyfrdT5GjqL1nqH3a_Y3QPscuCjg" 4117 }, 4118 "signature":"jnJtaB0vFFwrE-qKOR3Pu9pf2gNoI1s67GgPCTq0U- 4119 qrz97svKpuh32WgCP2MWCoQPEswsEX-nxhIx_siTe4zIPO1nBYn- 4120 R7b25rQaF87O8uAOOnBN5Yl2Jk3laIbs- 4121 hGE32aRZDhrVoyEdSvIFrT6AQqD20bIAZGqTR-zA-900" 4122 } 4123 } 4125 A.1.3. Sample UpdateSD 4126 A.1.3.1. Sample UpdateSDRequest 4128 { 4129 "UpdateSDTBSRequest": { 4130 "ver": "1.0", 4131 "rid": "1222DA7D-8993-41A4-AC02-8A2807B31A3A", 4132 "tid": "4F454A7F-002D-4157-884E-B0DD1A06A8AE", 4133 "tee": "Primary TEE ABC", 4134 "nextdsi": "false", 4135 "dsihash": 4136 " 4137 IsOvwpzDk8Onw4bCrsKTJsONwrbDrcKJYjVTw4vCu8OAw4JEw6zCgsK8w4JCacKxW8Kf 4138 w5o7", 4139 "content": { // NEEDS to BE ENCRYPTED 4140 "tamid": "id1.TAMxyz.com", 4141 "spid": "com.acmebank.spid1", 4142 "sdname": "com.acmebank.sdname1", 4143 "changes": { 4144 "newsdname": "com.acmebank.sdname2", 4145 "newspid": "com.acquirer.spid1", 4146 "spcert": 4147 "MIIDFjCCAn- 4148 gAwIBAgIJAIk0Tat0tquDMA0GCSqGSIb3DQEBBQUAMGwxCzAJBgNVBAYTAkTAMQ4 4149 wDAYDVQQIDAVTZW91bDESMBAGA1UEBwwJR3Vyby1kb25nMRAwDgYDVQQKDAdTb2x 4150 hY2lhMRAwDgYDVQQLDAdTb2xhY2lhMRUwEwYDVQQDDAxTb2xhLWNpYS5jb20wHhc 4151 NMTUwNzAyMDg1MTU3WhcNMjAwNjMwMDg1MTU3WjBsMQswCQYDVQQGEwJLUjEOMAw 4152 GA1UECAwFU2VvdWwxEjAQBgNVBAcMCUd1cm8tZG9uZzEQMA4GA1UECgwHU29sYWN 4153 pYTEQMA4GA1UECwwHU29sYWNpYTEVMBMGA1UEAwwMU29sYS1jaWEuY29tMIGfMA0 4154 GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYWLrFf2OFMEciwSYsyhaLY4kslaWcXA0 4155 hCWJRaFzt5mU- 4156 lpSJ4jeu92inBbsXcI8PfRbaItsgW1TD1Wg4gQH4MX_YtaBoOepE-- 4157 3JoZZyPyCWS3AaLYWrDmqFXdbzaO1i8GxB7zz0gWw55bZ9jyzcl5gQzWSqMRpx_d 4158 cad2SP2wIDAQABo4G_MIG8MIGGBgNVHSMEfzB9oXCkbjBsMQswCQYDVQQGEwJLUj 4159 EOMAwGA1UECAwFU2VvdWwxEjAQBgNVBAcMCUd1cm8tZG9uZzEQMA4GA1UECgwHU2 4160 9sYWNpYTEQMA4GA1UECwwHU29sYWNpYTEVMBMGA1UEAwwMU29sYS1jaWEuY29tgg 4161 kAiTRNq3S2q4MwCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCBsAwFgYDVR0lAQH_BA 4162 wwCgYIKwYBBQUHAwMwDQYJKoZIhvcNAQEFBQADgYEAEFMhRwEQ- 4163 LDa9O7P1N0mcLORpo6fW3QuJfuXbRQRQGoXddXMKazI4VjbGaXhey7Bzvk6TZYDa 4164 - 4165 GRiZby1J47UPaDQR3UiDzVvXwCOU6S5yUhNJsW_BeMViYj4lssX28iPpNwLUCVm1 4166 QVTHILI6afLCRWXXclc1L5KGY290OwIdQ", 4167 "renewteespaik": "0" 4168 } 4169 } 4170 } 4171 } 4172 A.1.3.2. Sample UpdateSDResponse 4174 { 4175 "UpdateSDTBSResponse": { 4176 "ver": "1.0", 4177 "status": "pass", 4178 "rid": "1222DA7D-8993-41A4-AC02-8A2807B31A3A", 4179 "tid": "4F454A7F-002D-4157-884E-B0DD1A06A8AE", 4180 "content": { 4181 "did": "MTZENTE5Qzc0Qzk0NkUxMzYxNzk0NjY4NTc3OTY4NTI=", 4182 "teespaik": 4183 "AQABjY9KiwH3hkMmSAAN6CLXot525U85WNlWKAQz5TOdfe_CM8h- 4184 X6_EHX1gOXoyRXaBiKMqWb0YZLCABTw1ytdXy2kWa525imRho8Vqn6HDGsJDZPDru9 4185 GnZR8pZX5ge_dWXB_uljMvDttc5iAWEJ8ZgcpLGtBTGLZnQoQbjtn1lIE", 4186 "teespaiktype": "RSA" 4187 } 4188 } 4189 } 4191 A.1.4. Sample DeleteSD 4193 A.1.4.1. Sample DeleteSDRequest 4195 The TAM builds message - including data to be encrypted. 4197 { 4198 "DeleteSDTBSRequest": { 4199 "ver": "1.0", 4200 "rid": "{712551F5-DFB3-43f0-9A63-663440B91D49}", 4201 "tid": "{4F454A7F-002D-4157-884E-B0DD1A06A8AE}", 4202 "tee": "Primary TEE", 4203 "nextdsi": "false", 4204 "dsihash": "AAECAwQFBgcICQoLDA0ODwABAgMEBQYHCAkKCwwNDg8=", 4205 "content": ENCRYPTED { 4206 "tamid": "TAM1.com", 4207 "sdname": "default.acmebank.com", 4208 "deleteta": "1" 4209 } 4210 } 4211 } 4213 The TAM encrypts the "content". 4215 { 4216 "DeleteSDTBSRequest": { 4217 "ver": "1.0", 4218 "rid": "{712551F5-DFB3-43f0-9A63-663440B91D49}", 4219 "tid": "{4F454A7F-002D-4157-884E-B0DD1A06A8AE}", 4220 "tee": "Primary TEE", 4221 "nextdsi": "false", 4222 "dsihash": "AAECAwQFBgcICQoLDA0ODwABAgMEBQYHCAkKCwwNDg8=", 4223 "content": { 4224 "protected": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0", 4225 "recipients": [ 4226 { 4227 "header": { 4228 "alg": "RSA1_5" 4229 }, 4230 "encrypted_key": 4231 " 4232 QUVTMTI4IChDRUspIGtleSwgZW5jcnlwdGVkIHdpdGggVFNNIFJTQSBwdWJsaWMga2 4233 V5LCB1c2luZyBSU0ExXzUgcGFkZGluZw" 4234 } 4235 ], 4236 "iv": "rWO5DVmQX9ogelMLBIogIA", 4237 "ciphertext": 4238 " 4239 c2FtcGxlIGRzaSBkYXRhIGVuY3J5cHRlZCB3aXRoIEFFUzEyOCBrZXkgZnJvbSByZWNp 4240 cGllbnRzLmVuY3J5cHRlZF9rZXk", 4241 "tag": "c2FtcGxlIGF1dGhlbnRpY2F0aW9uIHRhZw" 4242 } 4243 } 4244 } 4246 The TAM signs the "DeleteSDTBSRequest" to form a "DeleteSDRequest" 4247 { 4248 "DeleteSDRequest": { 4249 "payload":" 4250 ewoJIkRlbGV0ZVNEVEJTUmVxdWVzdCI6IHsKCQkidmVyIjogIjEuMCIsCgkJInJp 4251 ZCI6ICJ7NzEyNTUxRjUtREZCMy00M2YwLTlBNjMtNjYzNDQwQjkxRDQ5fSIsCgkJ 4252 InRpZCI6ICJ7NEY0NTRBN0YtMDAyRC00MTU3LTg4NEUtQjBERDFBMDZBOEFFfSIs 4253 CgkJInRlZSI6ICJQcmltYXJ5IFRFRSIsCgkJIm5leHRkc2kiOiAiZmFsc2UiLAoJ 4254 CSJkc2loYXNoIjogIkFBRUNBd1FGQmdjSUNRb0xEQTBPRHdBQkFnTUVCUVlIQ0Fr 4255 S0N3d05EZzg9IiwKCQkiY29udGVudCI6IHsKCQkJInByb3RlY3RlZCI6ICJleUps 4256 Ym1NaU9pSkJNVEk0UTBKRExVaFRNalUySW4wIiwKCQkJInJlY2lwaWVudHMiOiBb 4257 ewoJCQkJImhlYWRlciI6IHsKCQkJCQkiYWxnIjogIlJTQTFfNSIKCQkJCX0sCgkJ 4258 CQkiZW5jcnlwdGVkX2tleSI6ICJRVVZUTVRJNElDaERSVXNwSUd0bGVTd2daVzVq 4259 Y25sd2RHVmtJSGRwZEdnZ1ZGTk5JRkpUUVNCd2RXSnNhV01nYTJWNUxDQjFjMmx1 4260 WnlCU1UwRXhYelVnY0dGa1pHbHVadyIKCQkJfV0sCgkJCSJpdiI6ICJyV081RFZt 4261 UVg5b2dlbE1MQklvZ0lBIiwKCQkJImNpcGhlcnRleHQiOiAiYzJGdGNHeGxJR1J6 4262 YVNCa1lYUmhJR1Z1WTNKNWNIUmxaQ0IzYVhSb0lFRkZVekV5T0NCclpYa2dabkp2 4263 YlNCeVpXTnBjR2xsYm5SekxtVnVZM0o1Y0hSbFpGOXJaWGsiLAoJCQkidGFnIjog 4264 ImMyRnRjR3hsSUdGMWRHaGxiblJwWTJGMGFXOXVJSFJoWnciCgkJfQoJfQp9", 4265 "protected":"eyJhbGciOiJSUzI1NiJ9", 4266 "header": { 4267 "x5c": ["ZXhhbXBsZSBBU04xIHNpZ25lciBjZXJ0aWZpY2F0ZQ==", 4268 "ZXhhbXBsZSBBU04xIENBIGNlcnRpZmljYXRl"] 4269 }, 4270 "signature":"c2FtcGxlIHNpZ25hdHVyZQ" 4271 } 4272 } 4274 A.1.4.2. Sample DeleteSDResponse 4276 The TEE creates a "DeleteSDTBSResponse" to respond to the 4277 "DeleteSDRequest" message from the TAM, including data to be 4278 encrypted. 4280 { 4281 "DeleteSDTBSResponse": { 4282 "ver": "1.0", 4283 "status": "pass", 4284 "rid": "{712551F5-DFB3-43f0-9A63-663440B91D49}", 4285 "tid": "{4F454A7F-002D-4157-884E-B0DD1A06A8AE}", 4286 "content": ENCRYPTED { 4287 "did": "MTZENTE5Qzc0Qzk0NkUxMzYxNzk0NjY4NTc3OTY4NTI=", 4288 } 4289 } 4290 } 4292 The TEE encrypts the "content" for the TAM. 4294 { 4295 "DeleteSDTBSResponse": { 4296 "ver": "1.0", 4297 "status": "pass", 4298 "rid": "{712551F5-DFB3-43f0-9A63-663440B91D49}", 4299 "tid": "{4F454A7F-002D-4157-884E-B0DD1A06A8AE}", 4300 "content": { 4301 "protected": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0K", 4302 "recipients": [ 4303 { 4304 "header": { 4305 "alg": "RSA1_5" 4306 }, 4307 "encrypted_key": 4308 " 4309 QUVTMTI4IChDRUspIGtleSwgZW5jcnlwdGVkIHdpdGggVFNNIFJTQSBwdWJsaWMg 4310 a2V5LCB1c2luZyBSU0ExXzUgcGFkZGluZw" 4311 } 4312 ], 4313 "iv": "ySGmfZ69YlcEilNr5_SGbA", 4314 "ciphertext": 4315 " 4316 c2FtcGxlIGRzaSBkYXRhIGVuY3J5cHRlZCB3aXRoIEFFUzEyOCBrZXkgZnJvbSByZW 4317 NpcGllbnRzLmVuY3J5cHRlZF9rZXk", 4318 "tag": "c2FtcGxlIGF1dGhlbnRpY2F0aW9uIHRhZw" 4319 } 4320 } 4321 } 4323 The TEE signs "DeleteSDTBSResponse" to form a "DeleteSDResponse" 4324 { 4325 "DeleteSDResponse": { 4326 "payload":" 4327 ewoJIkRlbGV0ZVNEVEJTUmVzcG9uc2UiOiB7CgkJInZlciI6ICIxLjAiLAoJCSJz 4328 dGF0dXMiOiAicGFzcyIsCgkJInJpZCI6ICJ7NzEyNTUxRjUtREZCMy00M2YwLTlB 4329 NjMtNjYzNDQwQjkxRDQ5fSIsCgkJInRpZCI6ICJ7NEY0NTRBN0YtMDAyRC00MTU3 4330 LTg4NEUtQjBERDFBMDZBOEFFfSIsCgkJImNvbnRlbnQiOiB7CgkJCSJwcm90ZWN0 4331 ZWQiOiAiZXlKbGJtTWlPaUpCTVRJNFEwSkRMVWhUTWpVMkluMEsiLAoJCQkicmVj 4332 aXBpZW50cyI6IFt7CgkJCQkiaGVhZGVyIjogewoJCQkJCSJhbGciOiAiUlNBMV81 4333 IgoJCQkJfSwKCQkJCSJlbmNyeXB0ZWRfa2V5IjogIlFVVlRNVEk0SUNoRFJVc3BJ 4334 R3RsZVN3Z1pXNWpjbmx3ZEdWa0lIZHBkR2dnVkZOTklGSlRRU0J3ZFdKc2FXTWdh 4335 MlY1TENCMWMybHVaeUJTVTBFeFh6VWdjR0ZrWkdsdVp3IgoJCQl9XSwKCQkJIml2 4336 IjogInlTR21mWjY5WWxjRWlsTnI1X1NHYkEiLAoJCQkiY2lwaGVydGV4dCI6ICJj 4337 MkZ0Y0d4bElHUnphU0JrWVhSaElHVnVZM0o1Y0hSbFpDQjNhWFJvSUVGRlV6RXlP 4338 Q0JyWlhrZ1puSnZiU0J5WldOcGNHbGxiblJ6TG1WdVkzSjVjSFJsWkY5clpYayIs 4339 CgkJCSJ0YWciOiAiYzJGdGNHeGxJR0YxZEdobGJuUnBZMkYwYVc5dUlIUmhadyIK 4340 CQl9Cgl9Cn0", 4341 "protected":"eyJhbGciOiJSUzI1NiJ9", 4342 "signature":"c2FtcGxlIHNpZ25hdHVyZQ" 4343 } 4344 } 4346 The TEE returns "DeleteSDResponse" back to the OTrP Broker, which 4347 returns the message back to the TAM. 4349 A.2. Sample TA Management Messages 4351 A.2.1. Sample InstallTA 4353 A.2.1.1. Sample InstallTARequest 4354 { 4355 "InstallTATBSRequest": { 4356 "ver": "1.0", 4357 "rid": "24BEB059-0AED-42A6-A381-817DFB7A1207", 4358 "tid": "4F454A7F-002D-4157-884E-B0DD1A06A8AE", 4359 "tee": "Primary TEE ABC", 4360 "nextdsi": "true", 4361 "dsihash": 4362 " 4363 IsOvwpzDk8Onw4bCrsKTJsONwrbDrcKJYjVTw4vCu8OAw4JEw6zCgsK8w4JCacKxW8Kf 4364 w5o7", 4365 "content": { 4366 "tamid": "id1.TAMxyz.com", 4367 "spid": "com.acmebank.spid1", 4368 "sdname": "com.acmebank.sdname1", 4369 "taid": "com.acmebank.taid.banking" 4370 }, 4371 "encrypted_ta": { 4372 "key": 4373 "mLBjodcE4j36y64nC/nEs694P3XrLAOokjisXIGfs0H7lOEmT5FtaNDYEMcg9RnE 4374 ftlJGHO7N0lgcNcjoXBmeuY9VI8xzrsZM9gzH6VBKtVONSx0aw5IAFkNcyPZwDdZ 4375 MLwhvrzPJ9Fg+bZtrCoJz18PUz+5aNl/dj8+NM85LCXXcBlZF74btJer1Mw6ffzT 4376 /grPiEQTeJ1nEm9F3tyRsvcTInsnPJ3dEXv7sJXMrhRKAeZsqKzGX4eiZ3rEY+FQ 4377 6nXULC8cAj5XTKpQ/EkZ/iGgS0zcXR7KUJv3wFEmtBtPD/+ze08NILLmxM8olQFj 4378 //Lq0gGtq8vPC8r0oOfmbQ==", 4379 "iv": "4F5472504973426F726E496E32303135", 4380 "alg": "AESCBC", 4381 "ciphertadata": 4382 "......0x/5KGCXWfg1Vrjm7zPVZqtYZ2EovBow+7EmfOJ1tbk......=", 4383 "cipherpdata": "0x/5KGCXWfg1Vrjm7zPVZqtYZ2EovBow+7EmfOJ1tbk=" 4384 } 4385 } 4386 } 4388 A.2.1.2. Sample InstallTAResponse 4390 A sample to-be-signed response of InstallTA looks as follows. 4392 { 4393 "InstallTATBSResponse": { 4394 "ver": "1.0", 4395 "status": "pass", 4396 "rid": "24BEB059-0AED-42A6-A381-817DFB7A1207", 4397 "tid": "4F454A7F-002D-4157-884E-B0DD1A06A8AE", 4398 "content": { 4399 "did": "MTZENTE5Qzc0Qzk0NkUxMzYxNzk0NjY4NTc3OTY4NTI=", 4400 "dsi": { 4401 "tfwdata": { 4402 "tbs": "ezRGNDU0QTdGLTAwMkQtNDE1Ny04ODRFLUIwREQxQTA2QThBRX0=" 4403 "cert": "ZXhhbXBsZSBGVyBjZXJ0aWZpY2F0ZQ==", 4404 "sigalg": "UlMyNTY=", 4405 "sig": "c2FtcGxlIEZXIHNpZ25hdHVyZQ==" 4406 }, 4407 "tee": { 4408 "name": "Primary TEE", 4409 "ver": "1.0", 4410 "cert": "c2FtcGxlIFRFRSBjZXJ0aWZpY2F0ZQ==", 4411 "cacert": [ 4412 "c2FtcGxlIENBIGNlcnRpZmljYXRlIDE=", 4413 "c2FtcGxlIENBIGNlcnRpZmljYXRlIDI=" 4414 ], 4415 "sdlist": { 4416 "cnt": "1", 4417 "sd": [ 4418 { 4419 "name": "com.acmebank.sdname1", 4420 "spid": "com.acmebank.spid1", 4421 "talist": [ 4422 { 4423 "taid": "com.acmebank.taid.banking", 4424 "taname": "Acme secure banking app" 4425 }, 4426 { 4427 "taid": "acom.acmebank.taid.loyalty.rewards", 4428 "taname": "Acme loyalty rewards app" 4429 } 4430 ] 4431 } 4432 ] 4433 }, 4434 "teeaiklist": [ 4435 { 4436 "spaik": 4437 "c2FtcGxlIEFTTjEgZW5jb2RlZCBQS0NTMSBwdWJsaWNrZXk=", 4438 "spaiktype": "RSA" 4439 "spid": "acmebank.com" 4440 } 4441 ] 4442 } 4443 } 4444 } 4445 } 4446 } 4448 A.2.2. Sample UpdateTA 4450 A.2.2.1. Sample UpdateTARequest 4452 { 4453 "UpdateTATBSRequest": { 4454 "ver": "1.0", 4455 "rid": "req-2", 4456 "tid": "tran-01", 4457 "tee": "SecuriTEE", 4458 "nextdsi": " false", 4459 "dsihash": "gwjul_9MZks3pqUSN1-eL1aViwGXNAxk0AIKW79dn4U", 4460 "content": { 4461 "tamid": "TAM1.acme.com", 4462 "spid": "bank.com", 4463 "sdname": "sd.bank.com", 4464 "taid": "sd.bank.com.ta" 4465 }, 4466 "encrypted_ta": { 4467 "key": 4468 " 4469 XzmAn_RDVk3IozMwNWhiB6fmZlIs1YUvMKlQAv_UDoZ1fvGGsRGo9bT0A440aYMgLt 4470 GilKypoJjCgijdaHgamaJgRSc4Je2otpnEEagsahvDNoarMCC5nGQdkRxW7Vo2NKgL 4471 A892HGeHkJVshYm1cUlFQ-BhiJ4NAykFwlqC_oc", 4472 "iv": "AxY8DCtDaGlsbGljb3RoZQ", 4473 "alg": "AESCBC", 4474 "ciphernewtadata": 4475 "KHqOxGn7ib1F_14PG4_UX9DBjOcWkiAZhVE-U- 4476 67NsKryHGokeWr2spRWfdU2KWaaNncHoYGwEtbCH7XyNbOFh28nzwUmstep4nHWbAl 4477 XZYTNkENcABPpuw_G3I3HADo" 4478 } 4479 } 4480 } 4482 { 4483 "UpdateTARequest": { 4484 "payload" : 4485 " 4486 eyJVcGRhdGVUQVRCU1JlcXVlc3QiOnsidmVyIjoiMS4wIiwicmlkIjoicmVxLTIiLCJ0 4487 aWQiOiJ0cmFuLTAxIiwidGVlIjoiU2VjdXJpVEVFIiwibmV4dGRzaSI6ImZhbHNlIiwi 4488 ZHNpaGFzaCI6Imd3anVsXzlNWmtzM3BxVVNOMS1lTDFhVml3R1hOQXhrMEFJS1c3OWRu 4489 NFUiLCJjb250ZW50Ijp7InByb3RlY3RlZCI6ImV5SmxibU1pT2lKQk1USTRRMEpETFVo 4490 VE1qVTJJbjAiLCJyZWNpcGllbnRzIjpbeyJoZWFkZXIiOnsiYWxnIjoiUlNBMV81In0s 4491 ImVuY3J5cHRlZF9rZXkiOiJYem1Bbl9SRFZrM0lvek13TldoaUI2Zm1abElzMVlVdk1L 4492 bFFBdl9VRG9aMWZ2R0dzUkdvOWJUMEE0NDBhWU1nTHRHaWxLeXBvSmpDZ2lqZGFIZ2Ft 4493 YUpnUlNjNEplMm90cG5FRWFnc2FodkROb2FyTUNDNW5HUWRrUnhXN1ZvMk5LZ0xBODky 4494 SEdlSGtKVnNoWW0xY1VsRlEtQmhpSjROQXlrRndscUNfb2MifV0sIml2IjoiQXhZOERD 4495 dERhR2xzYkdsamIzUm9aUSIsImNpcGhlcnRleHQiOiJIYTcwVXRZVEtWQmtXRFJuMi0w 4496 SF9IdkZtazl5SGto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nNU" 4533 } 4534 } 4536 A.2.2.2. Sample UpdateTAResponse 4537 { 4538 "UpdateTATBSResponse": { 4539 "ver": "1.0", 4540 "status": "pass", 4541 "rid": "req-2", 4542 "tid": "tran-01", 4543 "content": { 4544 "did": "zAHkb0-SQh9U_OT8mR5dB-tygcqpUJ9_x07pIiw8WoM" 4545 } 4546 } 4547 } 4549 { 4550 "UpdateTAResponse":{ 4551 "payload":" 4552 eyJVcGRhdGVUQVRCU1Jlc3BvbnNlIjp7InZlciI6IjEuMCIsInN0YXR1cyI6InBhc3Mi 4553 LCJyaWQiOiJyZXEtMiIsInRpZCI6InRyYW4tMDEiLCJjb250ZW50Ijp7InByb3RlY3Rl 4554 ZCI6ImV5SmxibU1pT2lKQk1USTRRMEpETFVoVE1qVTJJbjAiLCJyZWNpcGllbnRzIjpb 4555 eyJoZWFkZXIiOnsiYWxnIjoiUlNBMV81In0sImVuY3J5cHRlZF9rZXkiOiJFaGUxLUJB 4556 UUdJLTNEMFNHdXFGY01MZDJtd0gxQm1uRndYQWx1M1FxUFVXZ1RRVm55SUowNFc2MnBK 4557 YWVSREFkeTU0R0FSVjBrVzQ0RGw0MkdUUlhqbE1EZ3BYdXdFLWloc1JVV0tNNldCZ2N3 4558 VXVGQTRUR3gwU0I1NTZCdl92dnBNaFdfMXh2c2FHdFBaQmwxTnZjbXNibzBhY3FobXlu 4559 bzBDTmF5SVAtX1UifV0sIml2IjoiQXhZOERDdERhR2xzYkdsamIzUm9aUSIsImNpcGhl 4560 cnRleHQiOiJwc2o2dGtyaGJXM0lmVElMeE9GMU5HdFUtcTFmeVBidV9KWk9jbklycWIw 4561 eTNPOHN6OTItaWpWR1ZyRW5WbG1sY1FYeWFNZTNyX1JGdEkwV3B4UmRodyIsInRhZyI6 4562 Ik0zb2dNNk11MVJYMUMybEZvaG5rTkN5b25qNjd2TDNqd2RrZXhFdUlpaTgifX19", 4563 "protected":"eyJhbGciOiJSUzI1NiJ9", 4564 "header": { 4565 "kid":"e9bc097a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 4583 UBFyfrdT5GjqL1nqH3a_Y3QPscuCjg" 4584 }, 4585 "signature":" 4586 Twajmt_BBLIMcNrDsjqr8lI7O7lEQxXZNhlUOtFkOMMqf37wOPKtp_99LoS82CVmdpCo 4587 PLaws8zzh-SNIQ42- 4588 9GYO8_9BaEGCiCwyl8YgWP9fWNfNv2gR2fl2DK4uknkYu1EMBW4YfP81n_pGpb4Gm- 4589 nMk14grVZygwAPej3ZZk" 4590 } 4591 } 4592 A.2.3. Sample DeleteTA 4594 A.2.3.1. Sample DeleteTARequest 4596 { 4597 "DeleteTATBSRequest": { 4598 "ver": "1.0", 4599 "rid": "req-2", 4600 "tid": "tran-01", 4601 "tee": "SecuriTEE", 4602 "nextdsi": "false", 4603 "dsihash": "gwjul_9MZks3pqUSN1-eL1aViwGXNAxk0AIKW79dn4U", 4604 "content": { 4605 "tamid": "TAM1.acme.com", 4606 "sdname": "sd.bank.com", 4607 "taid": "sd.bank.com.ta" 4608 } 4609 } 4610 } 4612 { 4613 "DeleteTARequest": { 4614 "payload": 4615 " 4616 eyJEZWxldGVUQVRCU1JlcXVlc3QiOnsidmVyIjoiMS4wIiwicmlkIjoicmVxLTIiLCJ0 4617 aWQiOiJ0cmFuLTAxIiwidGVlIjoiU2VjdXJpVEVFIiwibmV4dGRzaSI6ImZhbHNlIiwi 4618 ZHNpaGFzaCI6Imd3anVsXzlNWmtzM3BxVVNOMS1lTDFhVml3R1hOQXhrMEFJS1c3OWRu 4619 NFUiLCJjb250ZW50Ijp7InByb3RlY3RlZCI6eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0s 4620 InJlY2lwaWVudHMiOlt7ImhlYWRlciI6eyJhbGciOiJSU0ExXzUifSwiZW5jcnlwdGVk 4621 X2tleSI6ImtyaGs0d2dpY0RlX3d0VXQyTW4tSUJsdUtvX0JkeXpNY2p1cVlBenBPYnRS 4622 TG9MZzQ0QkFLN2tRVWE1YTg0TEVJRGEzaHNtWDIxdldNZFJLczN4MTJsOUh5VFdf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n_z3WTZlExlpT9XVj- 4642 ivhfJ4a6T20EtMM5qwIDAQABo4GsMIGpMHQGA1UdIwRtMGuhXqRcMFoxCzAJBgNVBA 4643 YTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRMwEQYDVQQHDApDYWxpZm9ybmlhMSEw 4644 HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGSCCQCX9nxZBNQWDjAJBgNVHR 4645 MEAjAAMA4GA1UdDwEB_wQEAwIGwDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAzANBgkq 4646 hkiG9w0BAQUFAAOBgQAGkz9QpoxghZUWT4ivem4cIckfxzTBBiPHCjrrjB2X8Ktn8G 4647 SZ1MdyIZV8fwdEmD90IvtMHgtzK- 4648 9wo6Aibj_rVIpxGb7trP82uzc2X8VwYnQbuqQyzofQvcwZHLYplvi95pZ5fVrJvnYA 4649 UBFyfrdT5GjqL1nqH3a_Y3QPscuCjg" 4650 }, 4651 "signature" : 4652 " 4653 BZS0_Ab6pqvGNXe5lqT4Sc3jakyWQeiK9KlVSnimwWnjCCyMtyB9bwvlbILZba3IJiFe 4654 _3F9bIQpSytGS0f2TQrPTKC7pSjwDw-3kH7HkHcPPJd- 4655 PpMMfQvRx7AIV8vBqO9MijIC62iN0V2se5z2v8VFjGSoRGgq225w7FvrnWE" 4656 } 4657 } 4658 A.2.3.2. Sample DeleteTAResponse 4660 { 4661 "DeleteTATBSResponse": { 4662 "ver": "1.0", 4663 "status": "pass", 4664 "rid": "req-2", 4665 "tid": "tran-01", 4666 "content": { 4667 "did": "zAHkb0-SQh9U_OT8mR5dB-tygcqpUJ9_x07pIiw8WoM" 4668 } 4669 } 4670 } 4672 { 4673 "DeleteTAResponse":{ 4674 "payload":" 4675 ew0KCSJEZWxldGVUQVRCU1Jlc3BvbnNlIjogew0KCQkidmVyIjogIjEuMCIsDQoJCSJz 4676 dGF0dXMiOiAicGFzcyIsDQoJCSJyaWQiOiAicmVxLTIiLA0KCQkid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5YpwGxEEFdg" 4715 } 4716 } 4717 A.3. Example OTrP Broker Option 4719 The most popular TEE devices today are Android powered devices. In 4720 an Android device, an OTrP Broker can be a bound service with a 4721 service registration ID that a Client Application can use. This 4722 option allows a Client Application not to depend on any OTrP Broker 4723 SDK or provider. 4725 An OTrP Broker is responsible to detect and work with more than one 4726 TEE if a device has more than one. In this version, there is only 4727 one active TEE such that an OTrP Broker only needs to handle the 4728 active TEE. 4730 Appendix B. Contributors 4732 - Brian Witten 4733 Symantec 4734 brian_witten@symantec.com 4736 - Tyler Kim 4737 Solacia 4738 tylerkim@iotrust.kr 4740 Authors' Addresses 4742 Mingliang Pei 4743 Symantec 4744 350 Ellis St 4745 Mountain View, CA 94043 4746 USA 4748 Email: mingliang_pei@symantec.com 4750 Andrew Atyeo 4751 Intercede 4752 St. Mary's Road, Lutterworth 4753 Leicestershire, LE17 4PS 4754 Great Britain 4756 Email: andrew.atyeo@intercede.com 4757 Nick Cook 4758 ARM Ltd. 4759 110 Fulbourn Rd 4760 Cambridge, CB1 9NJ 4761 Great Britain 4763 Email: nicholas.cook@arm.com 4765 Minho Yoo 4766 IoTrust 4767 Suite 501, Gasanbusiness Center,165, Gasan digital1-ro 4768 Seoul 08503 4769 Korea 4771 Email: minho.yoo@iotrust.kr 4773 Hannes Tschofenig 4774 ARM Ltd. 4775 110 Fulbourn Rd 4776 Cambridge, CB1 9NJ 4777 Great Britain 4779 Email: hannes.tschofenig@arm.com