ta/wallet_ta.c
/**
  * Writes one byte in the wallet storage at the position that the data stream
  * is currently at.
  * \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.
  */
Writes one byte in the wallet storage at the position that the data stream
is currently at.
\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.
Writes one byte in the wallet storage at the position that the data stream is currently at . \ 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 write1_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_MEMREF_INPUT,
							TEE_PARAM_TYPE_NONE,
							TEE_PARAM_TYPE_NONE,
							TEE_PARAM_TYPE_NONE);
	if (param_types != exp_param_types || params[0].memref.buffer == NULL)
		return TEE_ERROR_BAD_PARAMETERS;
	if (session_data->is_storage_open == false)
		return TEE_ERROR_BAD_STATE;
    result = TEE_WriteObjectData(
    				*(session_data->wallet_handle),
    				(uint8_t*)(params[0].memref.buffer),
    				(size_t)(params[0].memref.size));
    if (result != TEE_SUCCESS)
    {
    	#ifdef OP_TEE_TA
    	DMSG("Failed to write in the wallet storage: 0x%x", result);
    	#endif
    }
	return result;
}
static TEE_Result write1_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_MEMREF_INPUT , TEE_PARAM_TYPE_NONE , TEE_PARAM_TYPE_NONE , TEE_PARAM_TYPE_NONE ) ; if ( param_types != exp_param_types || params [ 0 ] . memref . buffer == NULL ) return TEE_ERROR_BAD_PARAMETERS ; if ( session_data -> is_storage_open == false ) return TEE_ERROR_BAD_STATE ; result = TEE_WriteObjectData ( * ( session_data -> wallet_handle ) , ( uint8_t * ) ( params [ 0 ] . memref . buffer ) , ( size_t ) ( params [ 0 ] . memref . size ) ) ; if ( result != TEE_SUCCESS ) { #ifdef OP_TEE_TA DMSG ( " " , result ) ; #endif } return result ; }
Writes one byte in the wallet storage at the position that the data stream
 is currently at.
Writes one byte in the wallet storage at the position that the data stream is currently at .
/*
	 * Expected:
	 * [IN]  params[0].memref.buffer -> Data to write into the storage.
	 * [IN]  params[0].memref.size   -> Size of the data to write into the
	 *									storage.
	 */ /*
	 * When the parameters received are different from the ones expected or
	 * when the pointer to the data to be written (params[0].memref.buffer) is
	 * NULL return TEE_ERROR_BAD_PARAMETERS.
	 */ /* Check if the storage is open */ /*
     * Write the data in the data stream. The data to be written is pointed by
     * params[0].memref.buffer.
     */