#endif
#include "mutt.h"
+#include "ascii.h"
#include "mutt_sasl.h"
#include "imap_private.h"
#include "auth.h"
if (irc == IMAP_CMD_RESPOND) {
#ifdef USE_SASL2
if (sasl_decode64
- (idata->cmd.buf + 2, mutt_strlen (idata->cmd.buf + 2), buf,
+ (idata->cmd.buf + 2, str_len (idata->cmd.buf + 2), buf,
LONG_STRING - 1,
#else
- if (sasl_decode64 (idata->cmd.buf + 2, mutt_strlen (idata->cmd.buf + 2), buf,
+ if (sasl_decode64 (idata->cmd.buf + 2, str_len (idata->cmd.buf + 2), buf,
#endif
&len) != SASL_OK) {
debug_print (1, ("error base64-decoding server response.\n"));
}
}
- if (!client_start) {
+ /* client-start is only available with the SASL-IR extension, but
+ * SASL 2.1 seems to want to use it regardless, at least for DIGEST
+ * fast reauth. Override if the server sent an initial continuation */
+ if (!client_start || buf[0]) {
do {
rc = sasl_client_step (saslconn, buf, len, &interaction, &pc, &olen);
if (rc == SASL_INTERACT)
/* sasl_client_st(art|ep) allocate pc with malloc, expect me to
* free it */
#ifndef USE_SASL2
- FREE (&pc);
+ mem_free (&pc);
#endif
}