|
TA-REF
|
#include "tee_api_tee_types.h"#include "tee-common.h"#include "tee-ta-internal.h"#include "sgx_trts.h"#include "sgx_utils.h"#include "edger/Enclave_t.h"#include <string.h>
Include dependency graph for tee-internal-api.c:Functions | |
| void | __attribute__ ((noreturn)) |
| void | TEE_GetREETime (TEE_Time *time) |
| Core Functions, Time Functions. More... | |
| void | TEE_GetSystemTime (TEE_Time *time) |
| Core Functions, Time Functions. More... | |
| TEE_Result | GetRelTimeStart (uint64_t start) |
| Core Functions, Time Functions. More... | |
| TEE_Result | GetRelTimeEnd (uint64_t end) |
| Core Functions, Time Functions. More... | |
| static int | flags2flags (int flags) |
| static int | set_object_key (const void *id, unsigned int idlen, TEE_ObjectHandle object) |
| static TEE_Result | OpenPersistentObject (uint32_t storageID, const void *objectID, uint32_t objectIDLen, uint32_t flags, TEE_ObjectHandle *object, int ocreat) |
| TEE_Result | TEE_CreatePersistentObject (uint32_t storageID, const void *objectID, uint32_t objectIDLen, uint32_t flags, TEE_ObjectHandle attributes, const void *initialData, uint32_t initialDataLen, TEE_ObjectHandle *object) |
| Core Functions, Secure Storage Functions (data is isolated for each TA) More... | |
| TEE_Result | TEE_OpenPersistentObject (uint32_t storageID, const void *objectID, uint32_t objectIDLen, uint32_t flags, TEE_ObjectHandle *object) |
| Core Functions, Secure Storage Functions (data is isolated for each TA) More... | |
| TEE_Result | TEE_GetObjectInfo1 (TEE_ObjectHandle object, TEE_ObjectInfo *objectInfo) |
| Core Functions, Secure Storage Functions (data is isolated for each TA) More... | |
| TEE_Result | TEE_WriteObjectData (TEE_ObjectHandle object, const void *buffer, uint32_t size) |
| Core Functions, Secure Storage Functions (data is isolated for each TA) More... | |
| TEE_Result | TEE_ReadObjectData (TEE_ObjectHandle object, void *buffer, uint32_t size, uint32_t *count) |
| Core Functions, Secure Storage Functions (data is isolated for each TA) More... | |
| void | TEE_CloseObject (TEE_ObjectHandle object) |
| Core Functions, Secure Storage Functions (data is isolated for each TA) More... | |
| void | TEE_GenerateRandom (void *randomBuffer, uint32_t randomBufferLen) |
| Crypto, common. More... | |
| static WC_RNG * | get_wc_rng (void) |
Variables | |
| static int | wc_rng_init = 0 |
| static WC_RNG | rngstr |
| void __attribute__ | ( | (noreturn) | ) |
TEE_Panic() - Raises a Panic in the Trusted Application instance
When a Trusted Application calls the TEE_Panic function, the current instance shall be destroyed and all the resources opened by the instance shall be reclaimed.
| ec | An informative panic code defined by the TA. May be displayed in traces if traces are available. |
|
inlinestatic |
flags2flags() - Checks the status for reading or writing of the file operational.
This function is to check the status for reading or writing of the file operational.
| flags | Flags of the referencing node. |
|
static |
get_wc_rng() - Gets the seed (from OS) and key cipher for rng(random number genertor).
This function returns the random number or unique number of "rngstr".
| TEE_Result GetRelTimeEnd | ( | uint64_t | end | ) |
Core Functions, Time Functions.
GetRelTimeStart() - find the real time of the end timing.
This function prints the End timing.
| end | End timing |
| TEE_Result GetRelTimeStart | ( | uint64_t | start | ) |
Core Functions, Time Functions.
GetRelTimeStart() - Gets the real time of the start timing.
Ths function prints the start timing.
| start | start timing |
|
static |
OpenPersistentObject() - Opens a handle on an existing persistent object.
The flags parameter is a set of flags that controls the access rights and sharing permissions with which the object handle is opened. The value of the flags parameter is constructed by a bitwise-inclusive OR of flags TEE_DATA_FLAG_ACCESS_READ, the object is opened with the read access right. This allows the Trusted Application to call the function TEE_ReadObjectData. TEE_DATA_FLAG_ACCESS_WRITE, the object is opened with the write access right. TEE_DATA_FLAG_ACCESS_WRITE_META, the object is opened with the write-meta access right.
| storageID | The storage to use. |
| objectID | The object identifier |
| objectIDLen | length of the identifier |
| flags | The flags which determine the settings under which the object is opened. |
| object | A pointer to the handle, which contains the opened handle upon successful completion. |
|
static |
set_object_key - To initalize report and then attest enclave with file.
This function describes objectID as key_id to make the key dependent on it sgx report key is 128-bit. Fill another 128-bit with seal key. seal key doesn't change with enclave. Better than nothing, though. random nonce can not use for AES here because of persistency. the digest of attestation report and objectID as the last resort has been used.
| id | id of the object. |
| idlen | length of the id. |
| object | TEE_ObjectHandle type handle. |
| void TEE_CloseObject | ( | TEE_ObjectHandle | object | ) |
Core Functions, Secure Storage Functions (data is isolated for each TA)
TEE_CloseObject() - Function closes an opened object handle.
The object can be persistent or transient.For transient objects, TEE_CloseObject is equivalent to TEE_FreeTransientObject.
| object | Handle of the object |
| TEE_Result TEE_CreatePersistentObject | ( | uint32_t | storageID, |
| const void * | objectID, | ||
| uint32_t | objectIDLen, | ||
| uint32_t | flags, | ||
| TEE_ObjectHandle | attributes, | ||
| const void * | initialData, | ||
| uint32_t | initialDataLen, | ||
| TEE_ObjectHandle * | object | ||
| ) |
Core Functions, Secure Storage Functions (data is isolated for each TA)
TEE_CreatePersistentObject() - Creates a persistent object with initial attributes.
An initial data stream content, and optionally returns either a handle on the created object, or TEE_HANDLE_NULL upon failure.
| storageID | The storage to use. |
| objectID | The object identifier |
| objectIDLen | The object identifier |
| flags | The flags which determine the settings under which the object is opened. |
| attributes | A handle on a persistent object or an initialized transient object from which to take the persistent object attributes |
| initialData | The initial data content of the persistent object |
| initialDataLen | The initial data content of the persistent object |
| object | A pointer to the handle, which contains the opened handle upon successful completion |
| void TEE_GenerateRandom | ( | void * | randomBuffer, |
| uint32_t | randomBufferLen | ||
| ) |
Crypto, common.
TEE_GenerateRandom() - Generates random data.
This function generates random data of random bufferlength and is stored in to randomBuffer by calling sgx_read_rand().
| randomBuffer | Reference to generated random data |
| randomBufferLen | Byte length of requested random data |
| TEE_Result TEE_GetObjectInfo1 | ( | TEE_ObjectHandle | object, |
| TEE_ObjectInfo * | objectInfo | ||
| ) |
Core Functions, Secure Storage Functions (data is isolated for each TA)
TEE_GetObjectInfo1() - Function returns the characteristics of an object.
It returns a handle that can be used to access the object’s attributes and data stream.
| objectInfo | Pointer to a structure filled with the object information |
| object | Handle of the object |
| void TEE_GetREETime | ( | TEE_Time * | time | ) |
Core Functions, Time Functions.
TEE_GetREETime() - Function retrieves the current REE system time.
This function retrieves the current time as seen from the point of view of the REE.
| time | Filled with the number of seconds and milliseconds. |
| void TEE_GetSystemTime | ( | TEE_Time * | time | ) |
Core Functions, Time Functions.
TEE_GetSystemTime() - Retrieves the current system time.
The system time has an arbitrary implementation-defined origin that can vary across TA instances
| time | Filled with the number of seconds and milliseconds. |
| TEE_Result TEE_OpenPersistentObject | ( | uint32_t | storageID, |
| const void * | objectID, | ||
| uint32_t | objectIDLen, | ||
| uint32_t | flags, | ||
| TEE_ObjectHandle * | object | ||
| ) |
Core Functions, Secure Storage Functions (data is isolated for each TA)
TEE_OpenPersistentObject() - Opens a handle on an existing persistent object.
This function returns a handle that can be used to access the object’s attributes and data stream.
| storageID | The storage to use. |
| objectID | The object identifier |
| objectIDLen | The object identifier |
| flags | The flags which determine the settings under which the object is opened. |
| object | A pointer to the handle, which contains the opened handle upon successful completion |
| TEE_Result TEE_ReadObjectData | ( | TEE_ObjectHandle | object, |
| void * | buffer, | ||
| uint32_t | size, | ||
| uint32_t * | count | ||
| ) |
Core Functions, Secure Storage Functions (data is isolated for each TA)
TEE_ReadObjectData() - Attempts to read size bytes from the data stream associated with the object object into the buffer pointed to by buffer.
The bytes are read starting at the position in the data stream currently stored in the object handle. The handle’s position is incremented by the number of bytes actually read. On completion TEE_ReadObjectData sets the number of bytes actually read in the uint32_t pointed to by count. The value written to *count may be less than size if the number of bytes until the end-of3067 stream is less than size. It is set to 0 if the position at the start of the read operation is at or beyond the end-of-stream. These are the only cases where *count may be less than size.
| object | Handle of the object |
| buffer | The buffer containing the data to be written |
| size | The number of bytes to write |
| count | size of the buffer. |
| TEE_Result TEE_WriteObjectData | ( | TEE_ObjectHandle | object, |
| const void * | buffer, | ||
| uint32_t | size | ||
| ) |
Core Functions, Secure Storage Functions (data is isolated for each TA)
TEE_WriteObjectData() - writes size bytes from the buffer pointed to by buffer to the data stream associated with the open object handle object.
If the current data position points before the end-of-stream, then size bytes are written to the data stream, overwriting bytes starting at the current data position. If the current data position points beyond the stream’s end, then the data stream is first extended with zero bytes until the length indicated by the data position indicator is reached, and then size bytes are written to the stream.
| object | Handle of the object |
| buffer | The buffer containing the data to be written |
| size | The number of bytes to write |
|
static |
|
static |