1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) The Exim Maintainers 2024 */
6 /* Copyright (c) University of Cambridge 1995 - 2018 */
7 /* See the file NOTICE for conditions of use and distribution. */
8 /* SPDX-License-Identifier: GPL-2.0-or-later */
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, dovecot
20 and gsasl authenticators.
23 aptr set to point to the response (which is in big_buffer)
24 challenge the challenge text (unencoded)
26 Returns: OK on success
27 BAD64 if response too large for buffer
28 CANCELLED if response is "*"
32 auth_get_no64_data(uschar **aptr, uschar *challenge)
36 smtp_printf("334 %s\r\n", SP_NO_MORE, challenge);
37 while ((c = receive_getc(GETC_BUFFER_UNLIMITED)) != '\n' && c != EOF)
39 if (p >= big_buffer_size - 1) return BAD64;
42 if (p > 0 && big_buffer[p-1] == '\r') p--;
44 if (Ustrcmp(big_buffer, "*") == 0) return CANCELLED;
49 /* End of get_no64_data.c */