TEE Internal Core API Specification V1.1.2.50
Total Page:16
File Type:pdf, Size:1020Kb
GlobalPlatform Technology TEE Internal Core API Specification Version 1.1.2.50 (Target v1.2) Public Review June 2018 Document Reference: GPD_SPE_010 Copyright 2011-2018 GlobalPlatform, Inc. All Rights Reserved. Recipients of this document are invited to submit, with their comments, notification of any relevant patents or other intellectual property rights (collectively, “IPR”) of which they may be aware which might be necessarily infringed by the implementation of the specification or other work product set forth in this document, and to provide supporting documentation. The technology provided or described herein is subject to updates, revisions, and extensions by GlobalPlatform. This documentation is currently in draft form and is being reviewed and enhanced by the Committees and Working Groups of GlobalPlatform. Use of this information is governed by the GlobalPlatform license agreement and any use inconsistent with that agreement is strictly prohibited. TEE Internal Core API Specification – Public Review v1.1.2.50 (Target v1.2) THIS SPECIFICATION OR OTHER WORK PRODUCT IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NON-INFRINGEMENT IS EXPRESSLY DISCLAIMED. ANY IMPLEMENTATION OF THIS SPECIFICATION OR OTHER WORK PRODUCT SHALL BE MADE ENTIRELY AT THE IMPLEMENTER’S OWN RISK, AND NEITHER THE COMPANY, NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF ANY NATURE WHATSOEVER DIRECTLY OR INDIRECTLY ARISING FROM THE IMPLEMENTATION OF THIS SPECIFICATION OR OTHER WORK PRODUCT. Copyright 2011-2018 GlobalPlatform, Inc. All Rights Reserved. The technology provided or described herein is subject to updates, revisions, and extensions by GlobalPlatform. Use of this information is governed by the GlobalPlatform license agreement and any use inconsistent with that agreement is strictly prohibited. TEE Internal Core API Specification – Public Review v1.1.2.50 (Target v1.2) 3 / 341 Contents 1 Introduction .......................................................................................................................... 14 1.1 Audience ............................................................................................................................................. 14 1.2 IPR Disclaimer..................................................................................................................................... 14 1.3 References .......................................................................................................................................... 15 1.4 Terminology and Definitions ................................................................................................................ 16 1.5 Abbreviations and Notations ............................................................................................................... 20 1.6 Revision History .................................................................................................................................. 22 2 Overview of the TEE Internal Core API Specification ........................................................ 24 2.1 Trusted Applications ............................................................................................................................ 25 2.1.1 TA Interface .................................................................................................................................. 26 2.1.2 Instances, Sessions, Tasks, and Commands .............................................................................. 27 2.1.3 Sequential Execution of Entry Points ........................................................................................... 27 2.1.4 Cancellations ................................................................................................................................ 27 2.1.5 Unexpected Client Termination .................................................................................................... 28 2.1.6 Instance Types ............................................................................................................................. 28 2.1.7 Configuration, Development, and Management .......................................................................... 28 2.2 TEE Internal Core APIs ....................................................................................................................... 29 2.2.1 Trusted Core Framework API ...................................................................................................... 29 2.2.2 Trusted Storage API for Data and Keys ....................................................................................... 29 2.2.3 Cryptographic Operations API ..................................................................................................... 30 2.2.4 Time API ....................................................................................................................................... 30 2.2.5 TEE Arithmetical API .................................................................................................................... 30 2.2.6 Peripheral and Event API ............................................................................................................. 31 2.3 Error Handling ..................................................................................................................................... 31 2.3.1 Normal Errors ............................................................................................................................... 31 2.3.2 Programmer Errors ...................................................................................................................... 31 2.3.3 Panics ........................................................................................................................................... 32 2.4 Opaque Handles ................................................................................................................................. 34 2.5 Properties ............................................................................................................................................ 35 2.6 Peripheral Support .............................................................................................................................. 35 3 Common Definitions ............................................................................................................ 36 3.1 Header File .......................................................................................................................................... 36 3.1.1 API Version .................................................................................................................................. 36 3.1.2 Target and Version Optimization.................................................................................................. 37 3.1.3 Peripherals Support ..................................................................................................................... 37 3.2 Data Types .......................................................................................................................................... 38 3.2.1 Basic Types .................................................................................................................................. 38 3.2.2 Bit Numbering............................................................................................................................... 38 3.2.3 TEE_Result, TEEC_Result .......................................................................................................... 39 3.2.4 TEE_UUID, TEEC_UUID ............................................................................................................. 40 3.3 Constants ............................................................................................................................................ 41 3.3.1 Return Code Ranges and Format ................................................................................................ 41 3.3.2 Return Codes ............................................................................................................................... 42 3.4 Parameter Annotations ....................................................................................................................... 44 3.4.1 [in], [out], and [inout] ..................................................................................................................... 44 3.4.2 [outopt] ......................................................................................................................................... 44 3.4.3 [inbuf] ............................................................................................................................................ 45 3.4.4 [outbuf] ......................................................................................................................................... 45 Copyright 2011-2018 GlobalPlatform, Inc. All Rights Reserved. The technology provided or described herein is subject to updates, revisions, and extensions by GlobalPlatform. Use of this information is governed by the GlobalPlatform license agreement and any use inconsistent with that agreement is strictly prohibited. 4 / 341 TEE Internal Core API Specification – Public Review v1.1.2.50 (Target v1.2) 3.4.5 [outbufopt] ...................................................................................................................................