ta/wallet_ta.c
/**
  * Opens the wallet storage.
  * \param session_data A data pointer to a session context.
  * \param param_types The types of the four parameters.
  * \param params A pointer to an array of four parameters.
  * \return TEE_SUCCESS in case of success otherwise returns the result
  *         received from the failed operation. The information about all
  *         possible returns is present in TEE Client API Specification - 4.4.2
  *         published by GlobalPlatform.
  */
Opens the wallet storage.
\param session_data A data pointer to a session context.
\param param_types The types of the four parameters.
\param params A pointer to an array of four parameters.
\return TEE_SUCCESS in case of success otherwise returns the result
received from the failed operation. The information about all
possible returns is present in TEE Client API Specification - 4.4.2
published by GlobalPlatform.
Opens the wallet storage . \ param session_data A data pointer to a session context . \ param param_types The types of the four parameters . \ param params A pointer to an array of four parameters . \ return TEE_SUCCESS in case of success otherwise returns the result received from the failed operation . The information about all possible returns is present in TEE Client API Specification - 4 . 4 . 2 published by GlobalPlatform .
static TEE_Result open_wallet_storage(Session_data * session_data, uint32_t param_types, TEE_Param params[4])
{
	TEE_Result result = TEE_SUCCESS;
    uint32_t flags = TEE_DATA_FLAG_ACCESS_WRITE_META
    					| TEE_DATA_FLAG_ACCESS_READ
    					| TEE_DATA_FLAG_ACCESS_WRITE;
	uint32_t exp_param_types = TEE_PARAM_TYPES(
									TEE_PARAM_TYPE_NONE,
									TEE_PARAM_TYPE_NONE,
									TEE_PARAM_TYPE_NONE,
									TEE_PARAM_TYPE_NONE);
	if (param_types != exp_param_types)
		return TEE_ERROR_BAD_PARAMETERS;
	if (session_data->is_storage_open == true
		|| session_data->is_storage_created == false)
		return TEE_ERROR_BAD_STATE;
	(void)&params;
	*(session_data->wallet_handle) = TEE_HANDLE_NULL;
	result = TEE_OpenPersistentObject(
					TEE_STORAGE_PRIVATE,
					(char*)(session_data->storageID),
					session_data->storageIDLen,
					flags,
					session_data->wallet_handle);
	if (result != TEE_SUCCESS)
	{
		#ifdef OP_TEE_TA
		DMSG("Failed to open the wallet storage: 0x%x", result);
		#endif
		goto cleanup1;
	}
	session_data->is_storage_open = true;
	cleanup1:
		return result;
}
static TEE_Result open_wallet_storage ( Session_data * session_data , uint32_t param_types , TEE_Param params [ 4 ] ) { TEE_Result result = TEE_SUCCESS ; uint32_t flags = TEE_DATA_FLAG_ACCESS_WRITE_META | TEE_DATA_FLAG_ACCESS_READ | TEE_DATA_FLAG_ACCESS_WRITE ; uint32_t exp_param_types = TEE_PARAM_TYPES ( TEE_PARAM_TYPE_NONE , TEE_PARAM_TYPE_NONE , TEE_PARAM_TYPE_NONE , TEE_PARAM_TYPE_NONE ) ; if ( param_types != exp_param_types ) return TEE_ERROR_BAD_PARAMETERS ; if ( session_data -> is_storage_open == true || session_data -> is_storage_created == false ) return TEE_ERROR_BAD_STATE ; ( void ) & params ; * ( session_data -> wallet_handle ) = TEE_HANDLE_NULL ; result = TEE_OpenPersistentObject ( TEE_STORAGE_PRIVATE , ( char * ) ( session_data -> storageID ) , session_data -> storageIDLen , flags , session_data -> wallet_handle ) ; if ( result != TEE_SUCCESS ) { #ifdef OP_TEE_TA DMSG ( " " , result ) ; #endif goto cleanup1 ; } session_data -> is_storage_open = true ; cleanup1 : return result ; }
Opens the wallet storage.
Opens the wallet storage .
/* Set the flags which the wallet will be opened with */ /* It is not expected any parameters */ /* Confirm the types of parameters received */ /* Check if the storage was already open or created */ /* Unused parameters */ /* Open the wallet storage that is a data stream of an persistent object */ /* Cleanup resources */