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