[Spice-commits] gtk/spice-channel.c

Christophe Fergau teuf at kemper.freedesktop.org
Thu Nov 21 04:49:52 PST 2013


 gtk/spice-channel.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 08a888ab6a0ede51d64ee6097955fe6534fc2898
Author: dietmar at proxmox.com <dietmar at proxmox.com>
Date:   Tue Oct 22 11:07:56 2013 +0200

    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 at proxmox.com>

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,


More information about the Spice-commits mailing list