From 7775f489df50f3872d24ba6ddbe7762da9ee0a83 Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Wed, 14 Dec 2005 17:29:57 +0000 Subject: [PATCH] SASL-IR support for IMAP. The RTT was has begun. I had forgotten how strangely convoluted auth_sasl has become though... --- imap/auth_sasl.c | 11 +++++++++++ imap/command.c | 1 + imap/imap_private.h | 1 + 3 files changed, 13 insertions(+) diff --git a/imap/auth_sasl.c b/imap/auth_sasl.c index 0ed4c32a0..6e0557c50 100644 --- a/imap/auth_sasl.c +++ b/imap/auth_sasl.c @@ -97,6 +97,17 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata, const char* method) mutt_message (_("Authenticating (%s)..."), mech); snprintf (buf, sizeof (buf), "AUTHENTICATE %s", mech); + if (mutt_bit_isset (idata->capabilities, SASL_IR) && client_start) + { + len = mutt_strlen (buf); + buf[len++] = ' '; + if (sasl_encode64 (pc, olen, buf + len, sizeof (buf) - len, &olen) != SASL_OK) + { + dprint (1, (debugfile, "imap_auth_sasl: error base64-encoding client response.\n")); + goto bail; + } + client_start = olen = 0; + } imap_cmd_start (idata, buf); irc = IMAP_CMD_CONTINUE; diff --git a/imap/command.c b/imap/command.c index 1562a7697..54e5b07e5 100644 --- a/imap/command.c +++ b/imap/command.c @@ -61,6 +61,7 @@ static char *Capabilities[] = { "STARTTLS", "LOGINDISABLED", "IDLE", + "SASL-IR", NULL }; diff --git a/imap/imap_private.h b/imap/imap_private.h index 2a04d699d..ed978c41d 100644 --- a/imap/imap_private.h +++ b/imap/imap_private.h @@ -123,6 +123,7 @@ enum STARTTLS, /* RFC 2595: STARTTLS */ LOGINDISABLED, /* LOGINDISABLED */ IDLE, /* RFC 2177: IDLE */ + SASL_IR, /* SASL initial response draft */ CAPMAX }; -- 2.40.0