.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" This manpage is Copyright (C) 1999 Tim Martin
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\"
.TH sasl_server_start "26 March 2000" SASL "SASL man pages"
.SH NAME
sasl_server_start \- Begin an authentication negotiation


.SH SYNOPSIS
.nf
.B #include <sasl.h>
.sp
.BI "int sasl_server_start(sasl_conn_t * " conn ", "
.BI "		           const char * " mech ", "
.BI "		           const char * " clientin ", "
.BI "		           unsigned * " clientinlen ", "
.BI "		           char ** " serverout ", "
.BI "		           unsigned * " serveroutlen ", "
.BI "		           const char ** " errstr ");"

.fi
.SH DESCRIPTION

.B sasl_server_start()
begins the authentication with the mechanism specified with mech. This
fails if the mechanism is not supported. SASL_OK is returned if the
authentication is complete and the user is
authenticated. SASL_CONTINUE is returned if one or more steps are
still required in the authentication. All other return values indicate
failure.

.I conn
the SASL context for this connection
.I mech
the mechanism name that the client requested
.I clientin
client initial response, NULL if empty
.I clientinlen
length of initial response
.I serverout
is created by the library. It is the initial server response to send to the client. This is allocated for by the library and it is the job of the client to send it over the network to the server. Also protocal specific encoding (such as base64 encoding) must needs to be done by the server.
.I serveroutlen
length of initial server challenge
.I errstr
is set to a string to send to the user on failure

.PP

.SH "RETURN VALUE"

sasl_server_start returns an integer which corresponds to one of the
following codes. SASL_CONTINUE indicates sucess and that there are
more steps needed in the authentication. All other return codes
indicate errors and should either be handled or the authentication
session should be quit.


.SH ERRORS
.TP 0.8i
.B SASL_CONTINUE
Success. keep going.
.TP 0.8i
.B SASL_INTERACT
user interaction needed to fill in prompt_need list
.TP 0.8i
.B SASL_BADVERS
Mechanism version mismatch
.TP 0.8i
.B SASL_BADPARAM
error in config file
.TP 0.8i
.B SASL_NOMEM
not enough memory to complete operation

.SH "CONFORMING TO"
RFC 2222
.SH "SEE ALSO"
.BR other sasl stuff
.BR 
.BR 