From 0855c045bf2bc59df3512e1268f254fb9ec652fc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 22 Sep 2008 16:56:00 +0200 Subject: [PATCH] Use SASL if the server supports both old style authentication and SASL. --- loudmouth/lm-connection.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/loudmouth/lm-connection.c b/loudmouth/lm-connection.c index f1a0119..99dda71 100644 --- a/loudmouth/lm-connection.c +++ b/loudmouth/lm-connection.c @@ -1043,6 +1043,7 @@ connection_features_cb (LmMessageHandler *handler, LmMessageNode *bind_node; LmMessageNode *starttls_node; LmMessageNode *old_auth; + LmMessageNode *sasl_mechanisms; starttls_node = lm_message_node_find_child (message->node, "starttls"); if (connection->ssl && lm_ssl_get_use_starttls (connection->ssl)) { @@ -1114,7 +1115,9 @@ connection_features_cb (LmMessageHandler *handler, } old_auth = lm_message_node_find_child (message->node, "auth"); - if (connection->use_sasl && old_auth) { + + sasl_mechanisms = lm_message_node_find_child (message->node, "mechanisms"); + if (connection->use_sasl && old_auth != NULL && sasl_mechanisms == NULL) { g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, "Server uses XEP-0078 (jabber iq auth) instead of SASL\n"); /* So the server is XMPP1.0, but doesn't support SASL and uses -- 1.6.0.1