ta/wallet_ta.c
/**
  * Seeks a the position on the data stream of 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.
  */
Seeks a the position on the data stream of 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.
Seeks a the position on the data stream of 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 seek_wallet_storage(Session_data * session_data, uint32_t param_types, TEE_Param params[4])
{
	TEE_Result result = TEE_SUCCESS;
	uint32_t exp_param_types;
	exp_param_types = TEE_PARAM_TYPES(
							TEE_PARAM_TYPE_VALUE_INPUT,
							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 == false
		|| session_data->is_storage_created == false)
		return TEE_ERROR_BAD_STATE;
    result = TEE_SeekObjectData(
    				*(session_data->wallet_handle),
    				(int32_t)(params[0].value.a),
    				TEE_DATA_SEEK_SET);
    if (result != TEE_SUCCESS)
    {
    	#ifdef OP_TEE_TA
    	DMSG("Failed to seek while writing: 0x%x", result);
    	#endif
    }
	return result;
}
static TEE_Result seek_wallet_storage ( Session_data * session_data , uint32_t param_types , TEE_Param params [ 4 ] ) { TEE_Result result = TEE_SUCCESS ; uint32_t exp_param_types ; exp_param_types = TEE_PARAM_TYPES ( TEE_PARAM_TYPE_VALUE_INPUT , 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 == false || session_data -> is_storage_created == false ) return TEE_ERROR_BAD_STATE ; result = TEE_SeekObjectData ( * ( session_data -> wallet_handle ) , ( int32_t ) ( params [ 0 ] . value . a ) , TEE_DATA_SEEK_SET ) ; if ( result != TEE_SUCCESS ) { #ifdef OP_TEE_TA DMSG ( " " , result ) ; #endif } return result ; }
Seeks a the position on the data stream of the wallet storage.
Seeks a the position on the data stream of the wallet storage .
/*
	 * Expected:
	 * [IN)  params[0].value.a -> Address to seek the wallet storage.
	 */ /* Sanity check on the parameters received */ /* Check if the storage was already open or created */ /*
	 * Set the position of the data stream to the address indicated at
	 * params[0].value.a (SET the address as a offset from the beginning of the
	 * data stream).
	 */