]> git.ipfire.org Git - thirdparty/libvirt.git/commit
sasl: Fix authentication when using PLAIN mechanism
authorChristophe Fergeau <cfergeau@redhat.com>
Thu, 21 Nov 2013 17:40:52 +0000 (18:40 +0100)
committerChristophe Fergeau <cfergeau@redhat.com>
Tue, 26 Nov 2013 10:52:58 +0000 (11:52 +0100)
commit0955025b9cdb734293adfae09be1fdae231d7a73
tree2a936461e580312b678f5817e8af63909c487dfb
parent986900a5af6491d54f7779f6368f1fc41eb53690
sasl: Fix authentication when using PLAIN mechanism

With some authentication mechanism (PLAIN for example), sasl_client_start()
can return SASL_OK, which translates to virNetSASLSessionClientStart()
returning VIR_NET_SASL_COMPLETE.
cyrus-sasl documentation is a bit vague as to what to do in such situation,
but upstream clarified this a bit in
http://asg.andrew.cmu.edu/archive/message.php?mailbox=archive.cyrus-sasl&msg=10104

When we got VIR_NET_SASL_COMPLETE after virNetSASLSessionClientStart() and
if the remote also tells us that authentication is complete, then we should
end the authentication procedure rather than forcing a call to
virNetSASLSessionClientStep(). Without this patch, when trying to use SASL
PLAIN, I get:
errorĀ :authentication failed : Failed to step SASL negotiation: -1
(SASL(-1): generic failure: Unable to find a callback: 32775)

This patch is based on a spice-gtk patch by Dietmar Maurer.
src/remote/remote_driver.c