Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 146696 | Differences between
and this patch

Collapse All | Expand All

(-)a/mutt_sasl.c (-5 lines)
Lines 221-235 int mutt_sasl_client_new (CONNECTION* co Link Here
221
    return -1;
221
    return -1;
222
  }
222
  }
223
223
224
  /* set security properties. We use NOPLAINTEXT globally, since we can
225
   * just fall back to LOGIN in the IMAP case anyway. If that doesn't
226
   * work for POP, we can make it a flag or move this code into
227
   * imap/auth_sasl.c */
228
  memset (&secprops, 0, sizeof (secprops));
224
  memset (&secprops, 0, sizeof (secprops));
229
  /* Work around a casting bug in the SASL krb4 module */
225
  /* Work around a casting bug in the SASL krb4 module */
230
  secprops.max_ssf = 0x7fff;
226
  secprops.max_ssf = 0x7fff;
231
  secprops.maxbufsize = M_SASL_MAXBUF;
227
  secprops.maxbufsize = M_SASL_MAXBUF;
232
  secprops.security_flags |= SASL_SEC_NOPLAINTEXT;
233
  if (sasl_setprop (*saslconn, SASL_SEC_PROPS, &secprops) != SASL_OK)
228
  if (sasl_setprop (*saslconn, SASL_SEC_PROPS, &secprops) != SASL_OK)
234
  {
229
  {
235
    dprint (1, (debugfile,
230
    dprint (1, (debugfile,
(-)a/pop_auth.c (-5 / +7 lines)
Lines 46-53 static pop_auth_res_t pop_auth_sasl (POP Link Here
46
  char inbuf[LONG_STRING];
46
  char inbuf[LONG_STRING];
47
  const char* mech;
47
  const char* mech;
48
  const char *pc = NULL;
48
  const char *pc = NULL;
49
  unsigned int len, olen;
49
  unsigned int len, olen, client_start;
50
  unsigned char client_start;
51
50
52
  if (mutt_sasl_client_new (pop_data->conn, &saslconn) < 0)
51
  if (mutt_sasl_client_new (pop_data->conn, &saslconn) < 0)
53
  {
52
  {
Lines 74-80 static pop_auth_res_t pop_auth_sasl (POP Link Here
74
    return POP_A_UNAVAIL;
73
    return POP_A_UNAVAIL;
75
  }
74
  }
76
75
77
  client_start = (olen > 0);
76
  client_start = olen;
78
77
79
  mutt_message _("Authenticating (SASL)...");
78
  mutt_message _("Authenticating (SASL)...");
80
79
Lines 93-103 static pop_auth_res_t pop_auth_sasl (POP Link Here
93
      return POP_A_SOCKET;
92
      return POP_A_SOCKET;
94
    }
93
    }
95
94
96
    if (rc != SASL_CONTINUE)
95
    if (!client_start && rc != SASL_CONTINUE)
97
      break;
96
      break;
98
97
99
    if (!mutt_strncmp (inbuf, "+ ", 2)
98
    if (!mutt_strncmp (inbuf, "+ ", 2)
100
        && sasl_decode64 (inbuf, strlen (inbuf), buf, LONG_STRING-1, &len) != SASL_OK)
99
        && sasl_decode64 (inbuf+2, strlen (inbuf+2), buf, LONG_STRING-1, &len) != SASL_OK)
101
    {
100
    {
102
      dprint (1, (debugfile, "pop_auth_sasl: error base64-decoding server response.\n"));
101
      dprint (1, (debugfile, "pop_auth_sasl: error base64-decoding server response.\n"));
103
      goto bail;
102
      goto bail;
Lines 112-118 static pop_auth_res_t pop_auth_sasl (POP Link Here
112
	mutt_sasl_interact (interaction);
111
	mutt_sasl_interact (interaction);
113
      }
112
      }
114
    else
113
    else
114
    {
115
      olen = client_start;
115
      client_start = 0;
116
      client_start = 0;
117
    }
116
118
117
    if (rc != SASL_CONTINUE && (olen == 0 || rc != SASL_OK))
119
    if (rc != SASL_CONTINUE && (olen == 0 || rc != SASL_OK))
118
      break;
120
      break;

Return to bug 146696