(1) Typo in redirect router; (2) Update version number; (3) Update
[exim.git] / src / src / auths / get_no64_data.c
CommitLineData
c988f1f4 1/* $Cambridge: exim/src/src/auths/get_no64_data.c,v 1.2 2005/01/04 10:00:43 ph10 Exp $ */
0756eb3c
PH
2
3/*************************************************
4* Exim - an Internet mail transport agent *
5*************************************************/
6
c988f1f4 7/* Copyright (c) University of Cambridge 1995 - 2005 */
0756eb3c
PH
8/* See the file NOTICE for conditions of use and distribution. */
9
10#include "../exim.h"
11
12
13/*************************************************
14* Issue a non-b64 challenge and get a response *
15*************************************************/
16
17/* This function is used by authentication drivers to output a challenge
18to the SMTP client and read the response line. This version does not use base
1964 encoding for the text on the 334 line. It is used by the SPA authenticator.
20
21Arguments:
22 aptr set to point to the response (which is in big_buffer)
23 challenge the challenge text (unencoded)
24
25Returns: OK on success
26 BAD64 if response too large for buffer
27 CANCELLED if response is "*"
28*/
29
30int
31auth_get_no64_data(uschar **aptr, uschar *challenge)
32{
33int c;
34int p = 0;
35smtp_printf("334 %s\r\n", challenge);
36while ((c = receive_getc()) != '\n' && c != EOF)
37 {
38 if (p >= big_buffer_size - 1) return BAD64;
39 big_buffer[p++] = c;
40 }
41if (p > 0 && big_buffer[p-1] == '\r') p--;
42big_buffer[p] = 0;
43if (Ustrcmp(big_buffer, "*") == 0) return CANCELLED;
44*aptr = big_buffer;
45return OK;
46}
47
48/* End of get_no64_data.c */