GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / man / sasl_client_step.3
1 .\" -*- nroff -*-
2 .\" 
3 .\" Copyright (c) 2001 Carnegie Mellon University.  All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\"
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer. 
11 .\"
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in
14 .\"    the documentation and/or other materials provided with the
15 .\"    distribution.
16 .\"
17 .\" 3. The name "Carnegie Mellon University" must not be used to
18 .\"    endorse or promote products derived from this software without
19 .\"    prior written permission. For permission or any other legal
20 .\"    details, please contact  
21 .\"      Office of Technology Transfer
22 .\"      Carnegie Mellon University
23 .\"      5000 Forbes Avenue
24 .\"      Pittsburgh, PA  15213-3890
25 .\"      (412) 268-4387, fax: (412) 268-7395
26 .\"      tech-transfer@andrew.cmu.edu
27 .\"
28 .\" 4. Redistributions of any form whatsoever must retain the following
29 .\"    acknowledgment:
30 .\"    "This product includes software developed by Computing Services
31 .\"     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
32 .\"
33 .\" CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
34 .\" THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
35 .\" AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
36 .\" FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
37 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
38 .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
39 .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
40 .\" 
41 .TH sasl_client_step "10 July 2001" SASL "SASL man pages"
42 .SH NAME
43 sasl_client_step \- Perform a step in the authentication negotiation
44
45
46 .SH SYNOPSIS
47 .nf
48 .B #include <sasl/sasl.h>
49 .sp
50 .BI "int sasl_client_step(sasl_conn_t " *conn ", "
51 .BI "                const char " *serverin ", "
52 .BI "                unsigned " serverinlen ", "
53 .BI "                sasl_interact_t ** " prompt_need ", "
54 .BI "                const char ** " clientout ", "
55 .BI "                unsigned * " clientoutlen ");"
56
57 .fi
58 .SH DESCRIPTION
59
60 .B sasl_client_step()
61 performs a step in the authentication negotiation. It returns SASL_OK
62 if the whole negotiation is successful and SASL_CONTINUE if this step
63 is ok but at least one more step is needed. A client should not assume
64 an authentication negotiation is successful just because the server
65 signaled success via protocol (i.e. if the server said ". OK
66 Authentication succeeded" in IMAP sasl_client_step should still be
67 called one more time with a serverinlen of zero.
68
69 If SASL_INTERACT is returned the library needs some values to be
70 filled in before it can proceed. The prompt_need structure will be
71 filled in with requests. The application should fulfill these requests
72 and call sasl_client_start again with identical parameters (the
73 prompt_need parameter will be the same pointer as before but filled in
74 by the application).
75
76 .I conn
77 is the SASL connection context
78 .PP
79 .I serverin
80 is the data given by the server (decoded if the protocol encodes requests sent over the wire)
81 .PP
82 .I serverinlen
83 is the length of serverin
84 .PP
85 .I clientout
86 and
87 .I clientoutlen
88 is created. It is the initial client response to send to the
89 server. It is the job of the
90 client to send it over the network to the server.
91 Any protocol specific encoding (such as base64
92 encoding) necessary needs to be done by the client.
93
94 .SH "RETURN VALUE"
95
96 sasl_client_step returns an integer which corresponds to one of the
97 following codes. SASL_CONTINUE indicates success and that there are
98 more steps needed in the authentication. SASL_OK indicates that the
99 authentication is complete. All other return codes indicate errors and
100 should either be handled or the authentication session should be quit.
101
102 .SH "CONFORMING TO"
103 RFC 2222
104 .SH "SEE ALSO"
105 sasl(3), sasl_callbacks(3), sasl_errors(3), sasl_client_init(3), sasl_client_new(3), sasl_client_start(3)