1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) University of Cambridge 1995 - 2015 */
6 /* See the file NOTICE for conditions of use and distribution. */
11 /*************************************************
12 * Issue a 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.
19 aptr set to point to the response (which is in big_buffer)
20 challenge the challenge text (unencoded, may be binary)
21 challen the length of the challenge text
23 Returns: OK on success
24 BAD64 if response too large for buffer
25 CANCELLED if response is "*"
29 auth_get_data(uschar **aptr, uschar *challenge, int challen)
33 smtp_printf("334 %s\r\n", b64encode(challenge, challen));
34 while ((c = receive_getc()) != '\n' && c != EOF)
36 if (p >= big_buffer_size - 1) return BAD64;
39 if (p > 0 && big_buffer[p-1] == '\r') p--;
41 DEBUG(D_receive) debug_printf("SMTP<< %s\n", big_buffer);
42 if (Ustrcmp(big_buffer, "*") == 0) return CANCELLED;
47 /* End of get_data.c */