| 1 | <?xml version="1.0"?> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>auth_sasl</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"/><link rel="start" href="#auth-sasl" title="auth_sasl"/><link xmlns="" rel="stylesheet" type="text/css" href="manpage.css"/><meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/><link xmlns="" rel="icon" href="icon.gif" type="image/gif"/><!-- |
| 3 | |
| 4 | Copyright 1998 - 2007 Double Precision, Inc. See COPYING for distribution |
| 5 | information. |
| 6 | |
| 7 | --></head><body><div class="refentry" lang="en" xml:lang="en"><a id="auth-sasl" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>auth_sasl — <acronym class="acronym">SASL</acronym> implementation</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="literallayout"><p><br clear="none"/> |
| 8 | #include <courierauthsasl.h><br clear="none"/> |
| 9 | </p></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td rowspan="1" colspan="1"><code class="funcdef">int rc=<b class="fsfunc">auth_sasl</b>(</code></td><td rowspan="1" colspan="1">const char * </td><td rowspan="1" colspan="1"><var class="pdparam">method</var>, </td></tr><tr><td rowspan="1" colspan="1"> </td><td rowspan="1" colspan="1">const char * </td><td rowspan="1" colspan="1"><var class="pdparam">initialresponse</var>, </td></tr><tr><td rowspan="1" colspan="1"> </td><td rowspan="1" colspan="1">char *(* </td><td rowspan="1" colspan="1"><var class="pdparam">conversation_func</var>, </td></tr><tr><td rowspan="1" colspan="1"> </td><td rowspan="1" colspan="1">void * </td><td rowspan="1" colspan="1"><var class="pdparam">callback_arg</var>, </td></tr><tr><td rowspan="1" colspan="1"> </td><td rowspan="1" colspan="1">char ** </td><td rowspan="1" colspan="1"><var class="pdparam">authtype_ret</var>, </td></tr><tr><td rowspan="1" colspan="1"> </td><td rowspan="1" colspan="1">char ** </td><td rowspan="1" colspan="1"><var class="pdparam">authdata_ret</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="id282347" shape="rect"> </a><h2>DESCRIPTION</h2><p> |
| 10 | <code class="function">auth_sasl</code> |
| 11 | is a generic <acronym class="acronym">SASL</acronym> server implementation. |
| 12 | <em class="parameter"><code>method</code></em> is the requested <acronym class="acronym">SASL</acronym> |
| 13 | method. |
| 14 | At this time |
| 15 | <code class="function">auth_sasl</code> |
| 16 | knows how to handle the following SASL methods:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="literal">LOGIN</code></p></li><li><p><code class="literal">PLAIN</code></p></li><li><p><code class="literal">CRAM-MD5</code></p></li><li><p><code class="literal">CRAM-SHA1</code></p></li></ul></div><p> |
| 17 | <em class="parameter"><code>initialresponse</code></em> |
| 18 | is a base64-encoded initial response provided in the client's |
| 19 | <acronym class="acronym">SASL</acronym> request. |
| 20 | <em class="parameter"><code>initialresponse</code></em> |
| 21 | must be <code class="literal">NULL</code> if an initial response was not included in |
| 22 | the client's <acronym class="acronym">SASL</acronym> request.</p><p> |
| 23 | <em class="parameter"><code>conversation_func</code></em> |
| 24 | is the application-implemented <acronym class="acronym">SASL</acronym> |
| 25 | conversation callback function. |
| 26 | <em class="parameter"><code>conversation_func</code></em> |
| 27 | receives a base64-encoded <acronym class="acronym">SASL</acronym> prompt, |
| 28 | and the <em class="parameter"><code>callback_arg</code></em> |
| 29 | argument to <code class="function">auth_sasl</code>. |
| 30 | <em class="parameter"><code>conversation_func</code></em> |
| 31 | must return a buffer containing the base64-encoded reply from the client. |
| 32 | <code class="function">auth_sasl</code> |
| 33 | will |
| 34 | <span class="citerefentry"><span class="refentrytitle">free</span>(3)</span> |
| 35 | this buffer when it's done. |
| 36 | <em class="parameter"><code>conversation_func</code></em> |
| 37 | should return <code class="literal">NULL</code> |
| 38 | to abort the <acronym class="acronym">SASL</acronym> conversation.</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="id282718" shape="rect"> </a><h2>RETURNS</h2><p> |
| 39 | If the <acronym class="acronym">SASL</acronym> conversation succesfully completes, |
| 40 | <code class="function">auth_sasl</code> |
| 41 | initializes <em class="parameter"><code>*authtype_ret</code></em> and |
| 42 | <em class="parameter"><code>*authdata_ret</code></em>. |
| 43 | They will be set to a |
| 44 | <span class="citerefentry"><span class="refentrytitle">malloc</span>(3)</span>-ed |
| 45 | buffers that can be directly passed as arguments to |
| 46 | <a href="auth_generic.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">auth_generic</span>(3)</span></a>. |
| 47 | It is the application's responsibility to |
| 48 | <span class="citerefentry"><span class="refentrytitle">free</span>(3)</span> |
| 49 | these buffers when it's done with them.</p><p> |
| 50 | <code class="function">auth_sasl</code> |
| 51 | returns |
| 52 | <code class="literal">AUTHSASL_OK</code> when the |
| 53 | <acronym class="acronym">SASL</acronym> conversation succesfully completes, and |
| 54 | <em class="parameter"><code>*authtype_ret</code></em> and |
| 55 | <em class="parameter"><code>*authdata_ret</code></em> are succesfully assembled. |
| 56 | Any other return indicates an error condition. |
| 57 | Right now two error conditions are defined:</p><div class="variablelist"><dl><dt><span class="term"><code class="literal">AUTHSASL_ABORTED</code></span></dt><dd><p> |
| 58 | The <acronym class="acronym">SASL</acronym> conversation was aborted by the client.</p></dd><dt><span class="term"><code class="literal">AUTHSASL_ERROR</code></span></dt><dd><p> |
| 59 | General error (insufficient memory, or some other reason). |
| 60 | Check <code class="varname">errno</code> for any clues.</p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="id282008" shape="rect"> </a><h2>SEE ALSO</h2><p> |
| 61 | <a href="authlib.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">authlib</span>(3)</span></a>, |
| 62 | |
| 63 | <a href="auth_generic.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">auth_generic</span>(3)</span></a>.</p></div></div></body></html> |