1 /* $Cambridge: exim/src/src/auths/get_no64_data.c,v 1.3 2006/02/07 11:19:01 ph10 Exp $ */
3 /*************************************************
4 * Exim - an Internet mail transport agent *
5 *************************************************/
7 /* Copyright (c) University of Cambridge 1995 - 2006 */
8 /* See the file NOTICE for conditions of use and distribution. */
13 /*************************************************
14 * Issue a non-b64 challenge and get a response *
15 *************************************************/
17 /* This function is used by authentication drivers to output a challenge
18 to the SMTP client and read the response line. This version does not use base
19 64 encoding for the text on the 334 line. It is used by the SPA authenticator.
22 aptr set to point to the response (which is in big_buffer)
23 challenge the challenge text (unencoded)
25 Returns: OK on success
26 BAD64 if response too large for buffer
27 CANCELLED if response is "*"
31 auth_get_no64_data(uschar **aptr, uschar *challenge)
35 smtp_printf("334 %s\r\n", challenge);
36 while ((c = receive_getc()) != '\n' && c != EOF)
38 if (p >= big_buffer_size - 1) return BAD64;
41 if (p > 0 && big_buffer[p-1] == '\r') p--;
43 if (Ustrcmp(big_buffer, "*") == 0) return CANCELLED;
48 /* End of get_no64_data.c */