|
TA-REF
|
#include "tee_api_tee_types.h"#include "tee-common.h"#include "tee-ta-internal.h"#include "edger/Enclave_t.h"#include "syscall.h"#include "report.h"#include <string.h>#include <stdlib.h>
Include dependency graph for tee-internal-api.c:Functions | |
| void * | TEE_Malloc (uint32_t size, uint32_t hint) |
| void * | TEE_Realloc (void *buffer, uint32_t newSize) |
| void | TEE_Free (void *buffer) |
| 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 (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... | |
| WC_RNG * | get_wc_rng (void) |
| int | wc_ocall_genseed (void *nonce, uint32_t len) |
| void | TEE_GenerateRandom (void *randomBuffer, uint32_t randomBufferLen) |
| Crypto, common. More... | |
Variables | |
| static int | wc_rng_init = 0 |
| static WC_RNG | rngstr |
|
inlinestatic |
flags2flags() - Checks the status for reading or writing of the file operational.
This function is used to check the status for reading or writing of the file operational.
| flags | Flags of the referencing node. |
| WC_RNG * get_wc_rng | ( | void | ) |
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.
GetRelTimeEnd() - finds the real time of the end timing.
This function prints the ending time.
| end | End timing |
| TEE_Result GetRelTimeStart | ( | uint64_t | start | ) |
Core Functions, Time Functions.
GetRelTimeStart() - Gets the real time of the start timing.
This function prints the starting time.
| 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() - Initialize report and then attest enclave with file.
This function describes the intialization of report, attest the enclave with file id and its length then assigned to ret. Based on "mbedtls" key encryption and decryption position of the object will be copied. Finally ret value returns on success else signature too short error will appear on failure.
| 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() - 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.
In this function an initial data stream content 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_Free | ( | void * | buffer | ) |
TEE_Free() - causes the space pointed to by buffer to be deallocated;that is made available for further allocation.
This function describes if buffer is a NULL pointer, TEE_Free does nothing. Otherwise, it is a Programmer Error if the argument does not match a pointer previously returned by the TEE_Malloc or TEE_Realloc if the space has been deallocated by a call to TEE_Free or TEE_Realloc.
| buffer | The pointer to the memory block to be freed. |
| void TEE_GenerateRandom | ( | void * | randomBuffer, |
| uint32_t | randomBufferLen | ||
| ) |
Crypto, common.
TEE_GenerateRandom() - Generates random data.
This function generates random data of random buffer length and is stored in to random Buffer by calling wc_RNG_GenerateBlock().If ret is not equal
to 0 then TEE_Panic is called.
| 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() - Returns the characteristics of an object.
This function returns a handle which 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() - 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.
This function describes the system time has an arbitrary implementation
defined origin that can vary across TA instances. The minimum guarantee
is that the system time shall be monotonic for a given TA instance.
| time | Filled with the number of seconds and milliseconds |
| void * TEE_Malloc | ( | uint32_t | size, |
| uint32_t | hint | ||
| ) |
TEE_Malloc() - Allocates space for an object whose size in bytes is specified in the parameter size.
This function describes the pointer returned is guaranteed to be aligned
such that it may be assigned as a pointer to any basic C type.The valid hint values are a bitmask and can be independently set. This parameter allows Trusted Applications to refer to various pools of memory or to
request special characteristics for the allocated memory by using an
implementation-defined hint. Future versions of this specification may introduce additional standard hints.
| size | The size of the buffer to be allocated. |
| hint | A hint to the allocator. |
| 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 which 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 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 of 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. |
| void * TEE_Realloc | ( | void * | buffer, |
| uint32_t | newSize | ||
| ) |
TEE_Realloc() - Changes the size of the memory object pointed to by buffer to the size specified by new size.
This function describes the content of the object remains unchanged up to the lesser of the new and old sizes. Space in excess of the old size contains unspecified content. If the new size of the memory object requires movement of the object, the space for the previous instantiation of the object is deallocated. If the space cannot be allocated, the original object remains allocated, and this function returns a NULL pointer.
| buffer | The pointer to the object to be reallocated. |
| newSize | The new size required for the object |
| 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 the buffer data in to persistent objects.
In this function it checks if object is present or not, the encryption/ decryption buffer is taken by calling mbedtls_aes_crypt_cbc() then that buffer data is encrypted and mapped to object.On the base of object creation TEE_SUCCESS appears else TEE_ERROR_GENERIC appears.
| object | Handle of the object |
| buffer | The buffer containing the data to be written |
| size | The number of bytes to write |
| int wc_ocall_genseed | ( | void * | nonce, |
| uint32_t | len | ||
| ) |
wc_ocall_genseed() To generate random data.
This function describes the return value of random generated data. if generated random value is not equal to length of buffer then panic
reason occurs.
| nonce | pointer of buffer |
| len | length of the buffer. |
|
static |
|
static |
ocall_getrandom() - For getting random data.
This function describes that the retval is returned based on the size of buffer by calling the functions ocall_getrandom196 and ocall_getrandom16
| buf | character type buffer |
| len | size of the buffer |
| flags | unassigned integer flag |