Fixed handling of channel bindings on the client side
authorLuke Howard <lukeh@padl.com>
Thu, 20 Jan 2011 02:55:17 +0000 (13:55 +1100)
committerLuke Howard <lukeh@padl.com>
Thu, 20 Jan 2011 02:55:17 +0000 (13:55 +1100)
commit3749b9cd245f4b1441ae9748c64c7c2d058064a2
tree784173de888d1e48b8843973686e2eb920d5596f
parent3f50108b1360d5a3761692163107305f58dec308
Fixed handling of channel bindings on the client side

The client side was failing to select a suitable SASL mechanism when
the application specified channel bindings, but didn't make them mandatory
to use. In such a configuration, if a non channel binding capable mechanism
was selected through "client_mech_list" SASL option, sasl_client_start
would fail. For example if the server supports both SCRAM-SHA-1[-PLUS] and
PLAIN and "client_mech_list" was set to "PLAIN", authentication would never
work. This patch fixes the problem.

The patch also cleans up the best SASL mechanism selection code to
prefer better channel bindings over SASL security layer.

Test-information:

Compiled and tested on Windows with msadm expire_mail and imapd.

Signed-off-by: Dave Cridland <dave.cridland@isode.com>
include/saslplug.h
lib/client.c
lib/common.c
lib/saslint.h
lib/server.c