1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) University of Cambridge 1995 - 2012 */
6 /* See the file NOTICE for conditions of use and distribution. */
11 /*************************************************
12 * Issue a non-b64 challenge and get a response *
13 *************************************************/
15 /* This function is used by authentication drivers to output a challenge
16 to the SMTP client and read the response line. This version does not use base
17 64 encoding for the text on the 334 line. It is used by the SPA, dovecot
18 and gsasl authenticators.
21 aptr set to point to the response (which is in big_buffer)
22 challenge the challenge text (unencoded)
24 Returns: OK on success
25 BAD64 if response too large for buffer
26 CANCELLED if response is "*"
30 auth_get_no64_data(uschar **aptr, uschar *challenge)
34 smtp_printf("334 %s\r\n", FALSE, challenge);
35 while ((c = receive_getc(GETC_BUFFER_UNLIMITED)) != '\n' && c != EOF)
37 if (p >= big_buffer_size - 1) return BAD64;
40 if (p > 0 && big_buffer[p-1] == '\r') p--;
42 if (Ustrcmp(big_buffer, "*") == 0) return CANCELLED;
47 /* End of get_no64_data.c */