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; |