/*
- * Copyright (C) 2000-7 Brendan Cully <brendan@kublai.com>
+ * Copyright (C) 2000-8 Brendan Cully <brendan@kublai.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
mutt_error (_("Error setting SASL external security strength"));
return -1;
}
+ }
+ if (conn->account.user[0])
+ {
dprint (2, (debugfile, "External authentication name: %s\n", conn->account.user));
if (sasl_setprop (*saslconn, SASL_AUTH_EXTERNAL, conn->account.user) != SASL_OK)
{
snprintf (prompt, sizeof (prompt), "%s: ", interaction->prompt);
resp[0] = '\0';
- if (mutt_get_field (prompt, resp, sizeof (resp), 0))
+ if (option (OPTNOCURSES) || mutt_get_field (prompt, resp, sizeof (resp), 0))
return SASL_FAIL;
interaction->len = mutt_strlen (resp)+1;
void mutt_sasl_setup_conn (CONNECTION* conn, sasl_conn_t* saslconn)
{
SASL_DATA* sasldata = (SASL_DATA*) safe_malloc (sizeof (SASL_DATA));
+ /* work around sasl_getprop aliasing issues */
+ const void* tmp;
sasldata->saslconn = saslconn;
/* get ssf so we know whether we have to (en|de)code read/write */
- sasl_getprop (saslconn, SASL_SSF, (const void**) &sasldata->ssf);
+ sasl_getprop (saslconn, SASL_SSF, &tmp);
+ sasldata->ssf = tmp;
dprint (3, (debugfile, "SASL protection strength: %u\n", *sasldata->ssf));
/* Add SASL SSF to transport SSF */
conn->ssf += *sasldata->ssf;
- sasl_getprop (saslconn, SASL_MAXOUTBUF, (const void**) &sasldata->pbufsize);
+ sasl_getprop (saslconn, SASL_MAXOUTBUF, &tmp);
+ sasldata->pbufsize = tmp;
dprint (3, (debugfile, "SASL protection buffer size: %u\n", *sasldata->pbufsize));
/* clear input buffer */
{
ACCOUNT* account = (ACCOUNT*) context;
+ if (!result)
+ return SASL_FAIL;
+
*result = NULL;
if (len)
*len = 0;
conn->conn_close = sasldata->msasl_close;
conn->conn_read = sasldata->msasl_read;
conn->conn_write = sasldata->msasl_write;
+ conn->conn_poll = sasldata->msasl_poll;
/* release sasl resources */
sasl_dispose (&sasldata->saslconn);