spice/server/stream-device.h
Frediano Ziglio 40ef0cb625 stream-device: Create channels before first non-main channel connection
Due to ticket expiration, it is possible that the streaming channels for
the client are created after the ticket expires. Currently, streaming
channels are created dynamically when the guest starts streaming to the
server, which can happen at any time (for instance if you decide to start
the graphic server manually).
If the ticket has expired before the streaming channel is created,
authentication will fail and the client will not be able to connect.
To avoid this, create the channels when the first main channel connection
is made. This ensures that client will connect to all streaming channels.
This could be considered a temporary solution. There may be other
situations where it would be useful to connect new channels after the
ticket has expired, but enabling this behavior would require protocol
changes and a careful analysis of security implications.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-03-08 11:14:34 +00:00

54 lines
1.8 KiB
C

/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
Copyright (C) 2018 Red Hat, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef STREAM_DEVICE_H
#define STREAM_DEVICE_H
#include "char-device.h"
G_BEGIN_DECLS
/**
* StreamDevice inherits from RedCharDevice.
*/
typedef struct StreamDevice StreamDevice;
typedef struct StreamDeviceClass StreamDeviceClass;
#define TYPE_STREAM_DEVICE stream_device_get_type()
#define STREAM_DEVICE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_STREAM_DEVICE, StreamDevice))
#define STREAM_DEVICE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), TYPE_STREAM_DEVICE, StreamDeviceClass))
#define IS_STREAM_DEVICE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_STREAM_DEVICE))
#define STREAM_DEVICE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_STREAM_DEVICE, StreamDeviceClass))
GType stream_device_get_type(void) G_GNUC_CONST;
StreamDevice *stream_device_connect(RedsState *reds, SpiceCharDeviceInstance *sin);
/* Create channel for the streaming device.
* If the channel already exists the function does nothing.
*/
void stream_device_create_channel(StreamDevice *dev);
G_END_DECLS
#endif /* STREAM_DEVICE_H */