~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

« back to all changes in this revision

Viewing changes to mutt_sasl.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-06-07 17:30:03 UTC
  • mto: (16.2.1 experimental) (2.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090607173003-rg37ui3h2bbv7wl0
Tags: upstream-1.5.19
ImportĀ upstreamĀ versionĀ 1.5.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2000-7 Brendan Cully <brendan@kublai.com>
 
2
 * Copyright (C) 2000-8 Brendan Cully <brendan@kublai.com>
3
3
 * 
4
4
 *     This program is free software; you can redistribute it and/or modify
5
5
 *     it under the terms of the GNU General Public License as published by
246
246
      mutt_error (_("Error setting SASL external security strength"));
247
247
      return -1;
248
248
    }
 
249
  }
 
250
  if (conn->account.user[0])
 
251
  {
249
252
    dprint (2, (debugfile, "External authentication name: %s\n", conn->account.user));
250
253
    if (sasl_setprop (*saslconn, SASL_AUTH_EXTERNAL, conn->account.user) != SASL_OK)
251
254
    {
333
336
void mutt_sasl_setup_conn (CONNECTION* conn, sasl_conn_t* saslconn)
334
337
{
335
338
  SASL_DATA* sasldata = (SASL_DATA*) safe_malloc (sizeof (SASL_DATA));
 
339
  /* work around sasl_getprop aliasing issues */
 
340
  const void* tmp;
336
341
 
337
342
  sasldata->saslconn = saslconn;
338
343
  /* get ssf so we know whether we have to (en|de)code read/write */
339
 
  sasl_getprop (saslconn, SASL_SSF, (const void**) &sasldata->ssf);
 
344
  sasl_getprop (saslconn, SASL_SSF, &tmp);
 
345
  sasldata->ssf = tmp;
340
346
  dprint (3, (debugfile, "SASL protection strength: %u\n", *sasldata->ssf));
341
347
  /* Add SASL SSF to transport SSF */
342
348
  conn->ssf += *sasldata->ssf;
343
 
  sasl_getprop (saslconn, SASL_MAXOUTBUF, (const void**) &sasldata->pbufsize);
 
349
  sasl_getprop (saslconn, SASL_MAXOUTBUF, &tmp);
 
350
  sasldata->pbufsize = tmp;
344
351
  dprint (3, (debugfile, "SASL protection buffer size: %u\n", *sasldata->pbufsize));
345
352
 
346
353
  /* clear input buffer */
384
391
{
385
392
  ACCOUNT* account = (ACCOUNT*) context;
386
393
 
 
394
  if (!result)
 
395
    return SASL_FAIL;
 
396
 
387
397
  *result = NULL;
388
398
  if (len)
389
399
    *len = 0;