~ubuntu-branches/ubuntu/hardy/exim4/hardy-proposed

« back to all changes in this revision

Viewing changes to src/auths/cram_md5.c

  • Committer: Bazaar Package Importer
  • Author(s): Marc Haber
  • Date: 2005-07-02 06:08:34 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050702060834-qk17pd52kb9nt3bj
Tags: 4.52-1
* new upstream version 4.51. (mh)
  * adapt 70_remove_exim-users_references
  * remove 37_gnutlsparams
  * adapt 36_pcre
  * adapt 31_eximmanpage
* fix package priorities to have them in sync with override again. (mh)
* Fix error in nb (Norwegian) translation.
  Thanks to Helge Hafting. (mh). Closes: #315775
* Standards-Version: 3.6.2, no changes needed. (mh)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Cambridge: exim/exim-src/src/auths/cram_md5.c,v 1.2 2005/01/04 10:00:43 ph10 Exp $ */
 
2
 
1
3
/*************************************************
2
4
*     Exim - an Internet mail transport agent    *
3
5
*************************************************/
4
6
 
5
 
/* Copyright (c) University of Cambridge 1995 - 2004 */
 
7
/* Copyright (c) University of Cambridge 1995 - 2005 */
6
8
/* See the file NOTICE for conditions of use and distribution. */
7
9
 
8
10
 
171
173
 
172
174
/* Send the challenge, read the return */
173
175
 
174
 
if ((rc = auth_get_data(&data, challenge)) != OK) return rc;
 
176
if ((rc = auth_get_data(&data, challenge, Ustrlen(challenge))) != OK) return rc;
175
177
if ((len = auth_b64decode(data, &clear)) < 0) return BAD64;
176
178
 
177
179
/* The return consists of a user name, space-separated from the CRAM-MD5
274
276
/* Initiate the authentication exchange and read the challenge, which arrives
275
277
in base 64. */
276
278
 
277
 
if (!smtp_write_command(outblock, FALSE, "AUTH %s\r\n", ablock->public_name))
 
279
if (smtp_write_command(outblock, FALSE, "AUTH %s\r\n", ablock->public_name) < 0)
278
280
  return FAIL_SEND;
279
 
if (!smtp_read_response(inblock, (uschar *)buffer, buffsize, '3', timeout))
 
281
if (smtp_read_response(inblock, (uschar *)buffer, buffsize, '3', timeout) < 0)
280
282
  return FAIL;
281
283
 
282
284
if (auth_b64decode(buffer + 4, &challenge) < 0)
308
310
so calling smtp_write_command(), which uses big_buffer, is OK. */
309
311
 
310
312
buffer[0] = 0;
311
 
if (!smtp_write_command(outblock, FALSE, "%s\r\n", auth_b64encode(big_buffer,
312
 
  p - big_buffer))) return FAIL_SEND;
 
313
if (smtp_write_command(outblock, FALSE, "%s\r\n", auth_b64encode(big_buffer,
 
314
  p - big_buffer)) < 0) return FAIL_SEND;
313
315
 
314
316
return smtp_read_response(inblock, (uschar *)buffer, buffsize, '2', timeout)?
315
317
  OK : FAIL;