summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordietmar@proxmox.com <dietmar@proxmox.com>2013-10-22 11:07:56 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2013-11-21 13:47:05 +0100
commit08a888ab6a0ede51d64ee6097955fe6534fc2898 (patch)
tree95e3f5d5cc836f5b7029b8195ed799f161a78144
parenta7eef2b50f72d024256f00ff5b692fb4f43c5829 (diff)
Fix SASL for mechanism using WANT_CLIENT_FIRST
Current code works with DIGEST-MD5, but not with PLAIN. In particular, when using PLAIN, sasl_client_start() returns SASL_OK, which should not be an error in spite of vague/confusing upstream documentation about this: http://asg.andrew.cmu.edu/archive/message.php?mailbox=archive.cyrus-sasl&msg=10104 Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
-rw-r--r--gtk/spice-channel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index a045767..e8758c0 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -1482,7 +1482,7 @@ restart:
/* NB, distinction of NULL vs "" is *critical* in SASL */
if (clientout) {
- len += clientoutlen + 1;
+ len = clientoutlen + 1;
spice_channel_write(channel, &len, sizeof(guint32));
spice_channel_write(channel, clientout, len);
} else {
@@ -1524,6 +1524,9 @@ restart:
* Even if the server has completed, the client must *always* do at least one step
* in this loop to verify the server isn't lying about something. Mutual auth */
for (;;) {
+ if (complete && err == SASL_OK)
+ break;
+
restep:
err = sasl_client_step(saslconn,
serverin,