[Spice-commits] 3 commits - src/spice-channel.c tests/file-transfer.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jun 4 15:15:46 UTC 2018
src/spice-channel.c | 20 +++++++++++++-------
tests/file-transfer.c | 5 -----
2 files changed, 13 insertions(+), 12 deletions(-)
New commits:
commit 7b67ed4eb6ab530bf58afac8ff4ed190cc951dfb
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Mon Jun 4 10:40:29 2018 +0100
spice-channel: Fix endianness for SASL authentication
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
diff --git a/src/spice-channel.c b/src/spice-channel.c
index 55ead15..a25397b 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -1509,6 +1509,12 @@ spice_channel_gather_sasl_credentials(SpiceChannel *channel,
return ret;
}
+static void spice_channel_write_u32_le(SpiceChannel *channel, guint32 n)
+{
+ n = GUINT32_TO_LE(n);
+ spice_channel_write(channel, &n, sizeof(n));
+}
+
/*
*
* Init msg from server
@@ -1708,17 +1714,17 @@ restart:
/* Send back the chosen mechname */
len = strlen(mechname);
- spice_channel_write(channel, &len, sizeof(guint32));
+ spice_channel_write_u32_le(channel, len);
spice_channel_write(channel, mechname, len);
/* NB, distinction of NULL vs "" is *critical* in SASL */
if (clientout) {
len = clientoutlen + 1;
- spice_channel_write(channel, &len, sizeof(guint32));
+ spice_channel_write_u32_le(channel, len);
spice_channel_write(channel, clientout, len);
} else {
len = 0;
- spice_channel_write(channel, &len, sizeof(guint32));
+ spice_channel_write_u32_le(channel, len);
}
if (c->has_error)
@@ -1794,11 +1800,11 @@ restart:
/* NB, distinction of NULL vs "" is *critical* in SASL */
if (clientout) {
len = clientoutlen + 1;
- spice_channel_write(channel, &len, sizeof(guint32));
+ spice_channel_write_u32_le(channel, len);
spice_channel_write(channel, clientout, len);
} else {
len = 0;
- spice_channel_write(channel, &len, sizeof(guint32));
+ spice_channel_write_u32_le(channel, len);
}
if (c->has_error)
commit a4fe9c3300bbd9ea1452dbbb0651262c4c3396b2
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Mon Jun 4 10:33:27 2018 +0100
spice-channel: Allows to connect from a big endian machine
Tested with a ppc64 machine.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
diff --git a/src/spice-channel.c b/src/spice-channel.c
index 7e3e3b7..55ead15 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -1970,14 +1970,14 @@ static gboolean spice_channel_recv_link_msg(SpiceChannel *channel)
#ifdef HAVE_SASL
if (spice_channel_test_common_capability(channel, SPICE_COMMON_CAP_AUTH_SASL)) {
CHANNEL_DEBUG(channel, "Choosing SASL mechanism");
- auth.auth_mechanism = SPICE_COMMON_CAP_AUTH_SASL;
+ auth.auth_mechanism = GUINT32_TO_LE(SPICE_COMMON_CAP_AUTH_SASL);
spice_channel_write(channel, &auth, sizeof(auth));
if (!spice_channel_perform_auth_sasl(channel))
return FALSE;
} else
#endif
if (spice_channel_test_common_capability(channel, SPICE_COMMON_CAP_AUTH_SPICE)) {
- auth.auth_mechanism = SPICE_COMMON_CAP_AUTH_SPICE;
+ auth.auth_mechanism = GUINT32_TO_LE(SPICE_COMMON_CAP_AUTH_SPICE);
spice_channel_write(channel, &auth, sizeof(auth));
if ((event = spice_channel_send_spice_ticket(channel)) != SPICE_CHANNEL_NONE)
goto error;
commit 08b5ffb3ff674cba4b64803bacc96c250bbb72a0
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Mon Jun 4 10:31:53 2018 +0100
tests: Remove unused structure declaration
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
diff --git a/tests/file-transfer.c b/tests/file-transfer.c
index 0cfe9ff..7b3430e 100644
--- a/tests/file-transfer.c
+++ b/tests/file-transfer.c
@@ -11,11 +11,6 @@ typedef struct _Fixture {
GHashTable *xfer_tasks;
} Fixture;
-typedef struct _AgentAsync {
- SpiceFileTransferTask *xfer_task;
- VDAgentFileXferStatusMessage msg;
-} AgentAsync;
-
#define SINGLE_FILE 1
#define MULTIPLE_FILES 10
More information about the Spice-commits
mailing list