#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <errno.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/ioctl.h>#include <sys/mman.h>#include <fcntl.h>#include <string.h>#include <otz_tee_client_api.h>#include <otz_client.h>#include <otz_id.h>#include <otz_common.h>Functions | |
| char * | TEEC_GetError (int error, int returnOrigin) |
| Returns error string. More... | |
| TEEC_Result | TEEC_InitializeContext (const char *name, TEEC_Context *context) |
| Initialize Context. More... | |
| void | TEEC_FinalizeContext (TEEC_Context *context) |
| Finalizes an initialized TEE context. More... | |
| TEEC_Result | TEEC_AllocateSharedMemory (TEEC_Context *context, TEEC_SharedMemory *sharedMem) |
| Allocate a shared memory block. More... | |
| TEEC_Result | TEEC_RegisterSharedMemory (TEEC_Context *context, TEEC_SharedMemory *sharedMem) |
| Register a allocated shared memory block. More... | |
| void | TEEC_ReleaseSharedMemory (TEEC_SharedMemory *sharedMem) |
| Release a shared memory block. More... | |
| TEEC_Result | TEEC_OpenSession (TEEC_Context *context, TEEC_Session *session, const TEEC_UUID *destination, uint32_t connectionMethod, const void *connectionData, TEEC_Operation *operation, uint32_t *returnOrigin) |
| Open a session with a Trusted application. More... | |
| void | TEEC_CloseSession (TEEC_Session *session) |
| Closes a session which has been opened with trusted application. More... | |
| TEEC_Result | TEEC_InvokeCommand (TEEC_Session *session, uint32_t commandID, TEEC_Operation *operation, uint32_t *returnOrigin) |
| Invokes a command within the specified session. More... | |
| void | TEEC_RequestCancellation (TEEC_Operation *operation) |
| Requests the cancellation of a pending open Session operation or a Command invocation operation. More... | |
| void | strncpy_safe (char *dst, const char *src, size_t n) |
| copies n size of string src to string dst More... | |
| void * | memncpy (void *dst, const void *src, unsigned int count, unsigned int dst_len, unsigned int src_len) |
| void* memncpy | ( | void * | dst, |
| const void * | src, | ||
| unsigned int | count, | ||
| unsigned int | dst_len, | ||
| unsigned int | src_len | ||
| ) |
| void strncpy_safe | ( | char * | dst, |
| const char * | src, | ||
| size_t | n | ||
| ) |
copies n size of string src to string dst
| dst | destination string |
| src | source string |
| n | length of string to be copied |
| TEEC_Result TEEC_AllocateSharedMemory | ( | TEEC_Context * | context, |
| TEEC_SharedMemory * | sharedMem | ||
| ) |
Allocate a shared memory block.
| context | Pointer to the context |
| sharedMem | Pointer to the shared memory |
| void TEEC_CloseSession | ( | TEEC_Session * | session | ) |
Closes a session which has been opened with trusted application.
Close a opened session between client and trusted application.
| session | Pointer to the session structure |
| void TEEC_FinalizeContext | ( | TEEC_Context * | context | ) |
Finalizes an initialized TEE context.
| context | An initialized TEEC_Context structure which is to be finalized. |
| char* TEEC_GetError | ( | int | error, |
| int | returnOrigin | ||
| ) |
Returns error string.
This function returns the error string value based on error number and return origin.
| error | Error number. |
| returnOrigin | Origin of the return. |
| TEEC_Result TEEC_InitializeContext | ( | const char * | name, |
| TEEC_Context * | context | ||
| ) |
Initialize Context.
| name | A zero-terminated string that describes the TEE to connect to. If this parameter is set to NULL the Implementation MUST select a default TEE. |
| context | A TEEC_Context structure that MUST be initialized by the Implementation. |
| TEEC_Result TEEC_InvokeCommand | ( | TEEC_Session * | session, |
| uint32_t | commandID, | ||
| TEEC_Operation * | operation, | ||
| uint32_t * | returnOrigin | ||
| ) |
Invokes a command within the specified session.
Invokes a command within the session.
| session | Pointer to session |
| commandID | Command ID |
| operation | Pointer to operation structure |
| returnOrigin | Pointer to the return origin |
| TEEC_Result TEEC_OpenSession | ( | TEEC_Context * | context, |
| TEEC_Session * | session, | ||
| const TEEC_UUID * | destination, | ||
| uint32_t | connectionMethod, | ||
| const void * | connectionData, | ||
| TEEC_Operation * | operation, | ||
| uint32_t * | returnOrigin | ||
| ) |
Open a session with a Trusted application.
Opens a new session between client and trusted application.
| context | Pointer to the context |
| session | Pointer to the session |
| destination | Service UUID |
| connectionMethod | Connection method |
| connectionData | Connection data used for authentication |
| operation | Pointer to optional operation structure |
| returnOrigin | Pointer to the return origin |
| TEEC_Result TEEC_RegisterSharedMemory | ( | TEEC_Context * | context, |
| TEEC_SharedMemory * | sharedMem | ||
| ) |
Register a allocated shared memory block.
| context | Pointer to the context |
| sharedMem | Pointer to the shared memory |
| void TEEC_ReleaseSharedMemory | ( | TEEC_SharedMemory * | sharedMem | ) |
Release a shared memory block.
| sharedMem | Pointer to the shared memory |
| void TEEC_RequestCancellation | ( | TEEC_Operation * | operation | ) |
Requests the cancellation of a pending open Session operation or a Command invocation operation.
Request cancellation of pending open session or command invocation.
| operation | Pointer to TEEC operation structure |
1.8.6