summaryrefslogtreecommitdiffstats
path: root/server/reds.c
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2014-01-06 22:37:45 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2014-01-20 12:15:42 +0100
commit30fecf87f86f4f8343182cd0f3348f9c8a59e92b (patch)
treeb40e15e6dc2778b2df3c1999704e23b38492ff01 /server/reds.c
parent1f7123298fbebce4134e12b33d35fe62621f631b (diff)
downloadspice-30fecf87f86f4f8343182cd0f3348f9c8a59e92b.tar.gz
spice-30fecf87f86f4f8343182cd0f3348f9c8a59e92b.tar.xz
spice-30fecf87f86f4f8343182cd0f3348f9c8a59e92b.zip
Introduce reds_stream_is_ssl()
Diffstat (limited to 'server/reds.c')
-rw-r--r--server/reds.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/reds.c b/server/reds.c
index 252cf5be..7fc48f1a 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1412,9 +1412,9 @@ static void reds_info_new_channel(RedLinkInfo *link, int connection_id)
spice_info("channel %d:%d, connected successfully, over %s link",
link->link_mess->channel_type,
link->link_mess->channel_id,
- link->stream->ssl == NULL ? "Non Secure" : "Secure");
+ reds_stream_is_ssl(link->stream) ? "Secure" : "Non Secure");
/* add info + send event */
- if (link->stream->ssl) {
+ if (reds_stream_is_ssl(link->stream)) {
link->stream->info->flags |= SPICE_CHANNEL_EVENT_FLAG_TLS;
}
link->stream->info->connection_id = connection_id;
@@ -2033,8 +2033,8 @@ static int reds_security_check(RedLinkInfo *link)
{
ChannelSecurityOptions *security_option = find_channel_security(link->link_mess->channel_type);
uint32_t security = security_option ? security_option->options : default_channel_security;
- return (link->stream->ssl && (security & SPICE_CHANNEL_SECURITY_SSL)) ||
- (!link->stream->ssl && (security & SPICE_CHANNEL_SECURITY_NONE));
+ return (reds_stream_is_ssl(link->stream) && (security & SPICE_CHANNEL_SECURITY_SSL)) ||
+ (!reds_stream_is_ssl(link->stream) && (security & SPICE_CHANNEL_SECURITY_NONE));
}
static void reds_handle_read_link_done(void *opaque)
@@ -2058,7 +2058,7 @@ static void reds_handle_read_link_done(void *opaque)
SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION);
if (!reds_security_check(link)) {
- if (link->stream->ssl) {
+ if (reds_stream_is_ssl(link->stream)) {
spice_warning("spice channels %d should not be encrypted", link_mess->channel_type);
reds_send_link_error(link, SPICE_LINK_ERR_NEED_UNSECURED);
} else {