/*
- * 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)
{
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);