ta/wallet_ta.c
/**
  * Deletes 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.
  */
Deletes 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.
Deletes 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 delete_wallet_storage(Session_data * session_data, uint32_t param_types, TEE_Param params[4])
{
	TEE_Result result = TEE_SUCCESS;
	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_created == false)
		return TEE_ERROR_BAD_STATE;
	(void)&params;
	if (session_data->is_storage_open == false)
	{
		result = open_wallet_storage(session_data, param_types, params);
		if (result != TEE_SUCCESS)
		{
			#ifdef OP_TEE_TA
			DMSG("Failed to open the wallet storage: 0x%x", result);
			#endif
			goto cleanup1;
		}
	}
	result = TEE_CloseAndDeletePersistentObject1(*(session_data->wallet_handle));
	if (result != TEE_SUCCESS)
	{
		#ifdef OP_TEE_TA
		DMSG("Failed to closing and deleting the wallet storage: 0x%x", result);
		#endif
		goto cleanup1;
	}
	*(session_data->wallet_handle) = TEE_HANDLE_NULL;
	session_data->is_storage_open = false;
	session_data->is_storage_created = false;
	cleanup1:
		return result;
}
static TEE_Result delete_wallet_storage ( Session_data * session_data , uint32_t param_types , TEE_Param params [ 4 ] ) { TEE_Result result = TEE_SUCCESS ; 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_created == false ) return TEE_ERROR_BAD_STATE ; ( void ) & params ; if ( session_data -> is_storage_open == false ) { result = open_wallet_storage ( session_data , param_types , params ) ; if ( result != TEE_SUCCESS ) { #ifdef OP_TEE_TA DMSG ( " " , result ) ; #endif goto cleanup1 ; } } result = TEE_CloseAndDeletePersistentObject1 ( * ( session_data -> wallet_handle ) ) ; if ( result != TEE_SUCCESS ) { #ifdef OP_TEE_TA DMSG ( " " , result ) ; #endif goto cleanup1 ; } * ( session_data -> wallet_handle ) = TEE_HANDLE_NULL ; session_data -> is_storage_open = false ; session_data -> is_storage_created = false ; cleanup1 : return result ; }
Deletes the wallet storage.
Deletes the wallet storage .
/* It is not expected any parameters */ /* Checks the types of the parameters received */ /* Check if the storage was already created */ /* Unused parameters */ /*
	 * If the storage is not opened, it opens it because the function to delete
	 * needs the storage opened
	 */ /* Close and delete the wallet storage */ /* Set the session data to default values*/ /* Resources cleanup */