]> granicus.if.org Git - mutt/commitdiff
Handle Exchange's bogus short challenge in AUTH NTLM (problem debugged by
authorBrendan Cully <brendan@kublai.com>
Tue, 18 Apr 2006 23:22:30 +0000 (23:22 +0000)
committerBrendan Cully <brendan@kublai.com>
Tue, 18 Apr 2006 23:22:30 +0000 (23:22 +0000)
Alexander Gattin).

imap/auth_sasl.c

index f3d2038921317ec9f2599fbb580cdb259fe80112..38a801a900201f0ea794ff6dc9528aa4b12bfe69 100644 (file)
@@ -130,7 +130,14 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata, const char* method)
 
     if (irc == IMAP_CMD_RESPOND)
     {
-      if (sasl_decode64 (idata->buf+2, strlen (idata->buf+2), buf, LONG_STRING-1, &len) != SASL_OK)
+      /* Exchange incorrectly returns +\r\n instead of + \r\n */
+      if (idata->buf[1] == '\0')
+      {
+       buf[0] = '\0';
+       len = 0;
+      }
+      else if (sasl_decode64 (idata->buf+2, strlen (idata->buf+2), buf,
+                             LONG_STRING-1, &len) != SASL_OK)
       {
        dprint (1, (debugfile, "imap_auth_sasl: error base64-decoding server response.\n"));
        goto bail;