<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Authentication</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.2.15 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="pages.html">Related Pages</a> </center> <hr><h1>Authentication<br> <small> [<a class="el" href="group__DBusInternals.html">D-BUS internal implementation details</a>]</small> </h1>DBusAuth object. <a href="#_details">More...</a><table border=0 cellpadding=0 cellspacing=0> <tr><td colspan=2><br><h2>Defines</h2></td></tr> <tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a19">DBUS_AUTH_IN_END_STATE</a>(auth) ((auth)-><a class="el" href="structDBusAuth.html#m4">state</a>->handler == NULL)</td></tr> <tr><td colspan=2><br><h2>Functions</h2></td></tr> <tr><td nowrap align=right valign=top>DBusAuth * </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a0">_dbus_auth_server_new</a> (void)</td></tr> <tr><td> </td><td><font size=-1><em>Creates a new auth conversation object for the server side.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>DBusAuth * </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a1">_dbus_auth_client_new</a> (void)</td></tr> <tr><td> </td><td><font size=-1><em>Creates a new auth conversation object for the client side.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>DBusAuth * </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a2">_dbus_auth_ref</a> (DBusAuth *auth)</td></tr> <tr><td> </td><td><font size=-1><em>Increments the refcount of an auth object.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a3">_dbus_auth_unref</a> (DBusAuth *auth)</td></tr> <tr><td> </td><td><font size=-1><em>Decrements the refcount of an auth object.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a4">_dbus_auth_set_mechanisms</a> (DBusAuth *auth, const char **mechanisms)</td></tr> <tr><td> </td><td><font size=-1><em>Sets an array of authentication mechanism names that we are willing to use.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>DBusAuthState </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a5">_dbus_auth_do_work</a> (DBusAuth *auth)</td></tr> <tr><td> </td><td><font size=-1><em>Analyzes buffered input and moves the auth conversation forward, returning the new state of the auth conversation.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a6">_dbus_auth_get_bytes_to_send</a> (DBusAuth *auth, const <a class="el" href="structDBusString.html">DBusString</a> **str)</td></tr> <tr><td> </td><td><font size=-1><em>Gets bytes that need to be sent to the peer we're conversing with.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a7">_dbus_auth_bytes_sent</a> (DBusAuth *auth, int bytes_sent)</td></tr> <tr><td> </td><td><font size=-1><em>Notifies the auth conversation object that the given number of bytes of the outgoing buffer have been written out.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a8">_dbus_auth_get_buffer</a> (DBusAuth *auth, <a class="el" href="structDBusString.html">DBusString</a> **buffer)</td></tr> <tr><td> </td><td><font size=-1><em>Get a buffer to be used for reading bytes from the peer we're conversing with.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a9">_dbus_auth_return_buffer</a> (DBusAuth *auth, <a class="el" href="structDBusString.html">DBusString</a> *buffer, int bytes_read)</td></tr> <tr><td> </td><td><font size=-1><em>Returns a buffer with new data read into it.</em> <a href="#a9">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a10">_dbus_auth_get_unused_bytes</a> (DBusAuth *auth, const <a class="el" href="structDBusString.html">DBusString</a> **str)</td></tr> <tr><td> </td><td><font size=-1><em>Returns leftover bytes that were not used as part of the auth conversation.</em> <a href="#a10">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a11">_dbus_auth_delete_unused_bytes</a> (DBusAuth *auth)</td></tr> <tr><td> </td><td><font size=-1><em>Gets rid of unused bytes returned by <a class="el" href="group__DBusAuth.html#a10">_dbus_auth_get_unused_bytes</a>() after we've gotten them and successfully moved them elsewhere.</em> <a href="#a11">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a12">_dbus_auth_needs_encoding</a> (DBusAuth *auth)</td></tr> <tr><td> </td><td><font size=-1><em>Called post-authentication, indicates whether we need to encode the message stream with <a class="el" href="group__DBusAuth.html#a13">_dbus_auth_encode_data</a>() prior to sending it to the peer.</em> <a href="#a12">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a13">_dbus_auth_encode_data</a> (DBusAuth *auth, const <a class="el" href="structDBusString.html">DBusString</a> *plaintext, <a class="el" href="structDBusString.html">DBusString</a> *encoded)</td></tr> <tr><td> </td><td><font size=-1><em>Called post-authentication, encodes a block of bytes for sending to the peer.</em> <a href="#a13">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a14">_dbus_auth_needs_decoding</a> (DBusAuth *auth)</td></tr> <tr><td> </td><td><font size=-1><em>Called post-authentication, indicates whether we need to decode the message stream with <a class="el" href="group__DBusAuth.html#a15">_dbus_auth_decode_data</a>() after receiving it from the peer.</em> <a href="#a14">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a15">_dbus_auth_decode_data</a> (DBusAuth *auth, const <a class="el" href="structDBusString.html">DBusString</a> *encoded, <a class="el" href="structDBusString.html">DBusString</a> *plaintext)</td></tr> <tr><td> </td><td><font size=-1><em>Called post-authentication, decodes a block of bytes received from the peer.</em> <a href="#a15">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a16">_dbus_auth_set_credentials</a> (DBusAuth *auth, const <a class="el" href="structDBusCredentials.html">DBusCredentials</a> *<a class="el" href="structDBusAuth.html#m7">credentials</a>)</td></tr> <tr><td> </td><td><font size=-1><em>Sets credentials received via reliable means from the operating system.</em> <a href="#a16">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a17">_dbus_auth_get_identity</a> (DBusAuth *auth, <a class="el" href="structDBusCredentials.html">DBusCredentials</a> *<a class="el" href="structDBusAuth.html#m7">credentials</a>)</td></tr> <tr><td> </td><td><font size=-1><em>Gets the identity we authorized the client as.</em> <a href="#a17">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> </td><td valign=bottom><a class="el" href="group__DBusAuth.html#a18">_dbus_auth_set_context</a> (DBusAuth *auth, const <a class="el" href="structDBusString.html">DBusString</a> *<a class="el" href="structDBusAuth.html#m10">context</a>)</td></tr> <tr><td> </td><td><font size=-1><em>Sets the "authentication context" which scopes cookies with the DBUS_COOKIE_SHA1 auth mechanism for example.</em> <a href="#a18">More...</a><em></em></font><br><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> DBusAuth object. <p> <p> DBusAuth manages the authentication negotiation when a connection is first established, and also manage any encryption used over a connection. <p> <p> <dl compact><dt><b> <a class="el" href="todo.html#_todo000002">Todo: </a></b><dd> some SASL profiles require sending the empty string as a challenge/response, but we don't currently allow that in our protocol. <p> DBusAuth really needs to be rewritten as an explicit state machine. Right now it's too hard to prove to yourself by inspection that it works. <p> right now sometimes both ends will block waiting for input from the other end, e.g. if there's an error during DBUS_COOKIE_SHA1. <p> the cookie keyring needs to be cached globally not just per-auth (which raises threadsafety issues too) <p> grep FIXME in dbus-auth.c </dl> <p> <p> <p> <p> <hr><h2>Define Documentation</h2> <a name="a19" doxytag="dbus-auth.c::DBUS_AUTH_IN_END_STATE"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define DBUS_AUTH_IN_END_STATE</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">auth </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> ((auth)->state->handler == NULL) </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation object </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> <a class="el" href="group__DBusMacros.html#a2">TRUE</a> if we're in a final state </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02060">2060</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. </td> </tr> </table> <hr><h2>Function Documentation</h2> <a name="a7" doxytag="dbus-auth.c::_dbus_auth_bytes_sent"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void _dbus_auth_bytes_sent </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname" nowrap> <em>auth</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>bytes_sent</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Notifies the auth conversation object that the given number of bytes of the outgoing buffer have been written out. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> <tr><td valign=top><em>bytes_sent</em> </td><td> number of bytes written out </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02139">2139</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00158">outgoing</a>. </td> </tr> </table> <a name="a1" doxytag="dbus-auth.c::_dbus_auth_client_new"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="structDBusAuth.html">DBusAuth</a>* _dbus_auth_client_new </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Creates a new auth conversation object for the client side. <p> See doc/dbus-sasl-profile.txt for full details on what this object does. <p> <dl compact><dt><b> Returns: </b><dd> the new object or <a class="el" href="group__DBusMacros.html#a4">NULL</a> if no memory </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l01952">1952</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00155">side</a>, and <a class="el" href="dbus-auth_8c-source.html#l00160">state</a>. </td> </tr> </table> <a name="a15" doxytag="dbus-auth.c::_dbus_auth_decode_data"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> _dbus_auth_decode_data </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname" nowrap> <em>auth</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const <a class="el" href="structDBusString.html">DBusString</a> * </td> <td class="mdname" nowrap> <em>encoded</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="structDBusString.html">DBusString</a> * </td> <td class="mdname" nowrap> <em>plaintext</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Called post-authentication, decodes a block of bytes received from the peer. <p> If no encoding was negotiated, just copies the bytes (you can avoid this by checking <a class="el" href="group__DBusAuth.html#a14">_dbus_auth_needs_decoding</a>()). <p> <p> <dl compact><dt><b> <a class="el" href="todo.html#_todo000003">Todo: </a></b><dd> We need to be able to distinguish "out of memory" error from "the data is hosed" error.</dl><dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> <tr><td valign=top><em>encoded</em> </td><td> the encoded data </td></tr> <tr><td valign=top><em>plaintext</em> </td><td> initialized string where decoded data is appended </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> <a class="el" href="group__DBusMacros.html#a2">TRUE</a> if we had enough memory and successfully decoded </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02322">2322</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00113">DBusAuthMechanismHandler::client_decode_func</a>, <a class="el" href="dbus-auth_8c-source.html#l00162">mech</a>, <a class="el" href="dbus-auth_8c-source.html#l00108">DBusAuthMechanismHandler::server_decode_func</a>, and <a class="el" href="dbus-auth_8c-source.html#l00160">state</a>. </td> </tr> </table> <a name="a11" doxytag="dbus-auth.c::_dbus_auth_delete_unused_bytes"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void _dbus_auth_delete_unused_bytes </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname1" valign="top" nowrap> <em>auth</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Gets rid of unused bytes returned by <a class="el" href="group__DBusAuth.html#a10">_dbus_auth_get_unused_bytes</a>() after we've gotten them and successfully moved them elsewhere. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02215">2215</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00157">incoming</a>. </td> </tr> </table> <a name="a5" doxytag="dbus-auth.c::_dbus_auth_do_work"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> DBusAuthState _dbus_auth_do_work </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname1" valign="top" nowrap> <em>auth</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Analyzes buffered input and moves the auth conversation forward, returning the new state of the auth conversation. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> the new state </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02070">2070</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00157">incoming</a>, <a class="el" href="dbus-auth_8c-source.html#l00185">needed_memory</a>, <a class="el" href="dbus-auth_8c-source.html#l00158">outgoing</a>, and <a class="el" href="dbus-auth_8c-source.html#l00160">state</a>. </td> </tr> </table> <a name="a13" doxytag="dbus-auth.c::_dbus_auth_encode_data"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> _dbus_auth_encode_data </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname" nowrap> <em>auth</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const <a class="el" href="structDBusString.html">DBusString</a> * </td> <td class="mdname" nowrap> <em>plaintext</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="structDBusString.html">DBusString</a> * </td> <td class="mdname" nowrap> <em>encoded</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Called post-authentication, encodes a block of bytes for sending to the peer. <p> If no encoding was negotiated, just copies the bytes (you can avoid this by checking <a class="el" href="group__DBusAuth.html#a12">_dbus_auth_needs_encoding</a>()).<dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> <tr><td valign=top><em>plaintext</em> </td><td> the plain text data </td></tr> <tr><td valign=top><em>encoded</em> </td><td> initialized string to where encoded data is appended </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> <a class="el" href="group__DBusMacros.html#a2">TRUE</a> if we had enough memory and successfully encoded </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02259">2259</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00112">DBusAuthMechanismHandler::client_encode_func</a>, <a class="el" href="dbus-auth_8c-source.html#l00162">mech</a>, <a class="el" href="dbus-auth_8c-source.html#l00107">DBusAuthMechanismHandler::server_encode_func</a>, and <a class="el" href="dbus-auth_8c-source.html#l00160">state</a>. </td> </tr> </table> <a name="a8" doxytag="dbus-auth.c::_dbus_auth_get_buffer"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void _dbus_auth_get_buffer </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname" nowrap> <em>auth</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="structDBusString.html">DBusString</a> ** </td> <td class="mdname" nowrap> <em>buffer</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Get a buffer to be used for reading bytes from the peer we're conversing with. <p> Bytes should be appended to this buffer.<dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> <tr><td valign=top><em>buffer</em> </td><td> return location for buffer to append bytes to </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02159">2159</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00190">buffer_outstanding</a>, and <a class="el" href="dbus-auth_8c-source.html#l00157">incoming</a>. </td> </tr> </table> <a name="a6" doxytag="dbus-auth.c::_dbus_auth_get_bytes_to_send"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> _dbus_auth_get_bytes_to_send </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname" nowrap> <em>auth</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const <a class="el" href="structDBusString.html">DBusString</a> ** </td> <td class="mdname" nowrap> <em>str</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Gets bytes that need to be sent to the peer we're conversing with. <p> After writing some bytes, <a class="el" href="group__DBusAuth.html#a7">_dbus_auth_bytes_sent</a>() must be called to notify the auth object that they were written.<dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> <tr><td valign=top><em>str</em> </td><td> return location for a ref to the buffer to send </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> <a class="el" href="group__DBusMacros.html#a3">FALSE</a> if nothing to send </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02114">2114</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00158">outgoing</a>. </td> </tr> </table> <a name="a17" doxytag="dbus-auth.c::_dbus_auth_get_identity"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void _dbus_auth_get_identity </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname" nowrap> <em>auth</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="structDBusCredentials.html">DBusCredentials</a> * </td> <td class="mdname" nowrap> <em>credentials</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Gets the identity we authorized the client as. <p> Apps may have different policies as to what identities they allow.<dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> <tr><td valign=top><em>credentials</em> </td><td> the credentials we've authorized </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02367">2367</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00172">authorized_identity</a>, and <a class="el" href="dbus-auth_8c-source.html#l00160">state</a>. </td> </tr> </table> <a name="a10" doxytag="dbus-auth.c::_dbus_auth_get_unused_bytes"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void _dbus_auth_get_unused_bytes </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname" nowrap> <em>auth</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const <a class="el" href="structDBusString.html">DBusString</a> ** </td> <td class="mdname" nowrap> <em>str</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns leftover bytes that were not used as part of the auth conversation. <p> These bytes will be part of the message stream instead. This function may not be called until authentication has succeeded.<dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> <tr><td valign=top><em>str</em> </td><td> return location for pointer to string of unused bytes </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02198">2198</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00157">incoming</a>. </td> </tr> </table> <a name="a14" doxytag="dbus-auth.c::_dbus_auth_needs_decoding"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> _dbus_auth_needs_decoding </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname1" valign="top" nowrap> <em>auth</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Called post-authentication, indicates whether we need to decode the message stream with <a class="el" href="group__DBusAuth.html#a15">_dbus_auth_decode_data</a>() after receiving it from the peer. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> <a class="el" href="group__DBusMacros.html#a2">TRUE</a> if we need to encode the stream </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02291">2291</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00113">DBusAuthMechanismHandler::client_decode_func</a>, <a class="el" href="dbus-auth_8c-source.html#l00162">mech</a>, <a class="el" href="dbus-auth_8c-source.html#l00108">DBusAuthMechanismHandler::server_decode_func</a>, and <a class="el" href="dbus-auth_8c-source.html#l00160">state</a>. </td> </tr> </table> <a name="a12" doxytag="dbus-auth.c::_dbus_auth_needs_encoding"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> _dbus_auth_needs_encoding </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname1" valign="top" nowrap> <em>auth</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Called post-authentication, indicates whether we need to encode the message stream with <a class="el" href="group__DBusAuth.html#a13">_dbus_auth_encode_data</a>() prior to sending it to the peer. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> <a class="el" href="group__DBusMacros.html#a2">TRUE</a> if we need to encode the stream </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02232">2232</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00112">DBusAuthMechanismHandler::client_encode_func</a>, <a class="el" href="dbus-auth_8c-source.html#l00162">mech</a>, <a class="el" href="dbus-auth_8c-source.html#l00107">DBusAuthMechanismHandler::server_encode_func</a>, and <a class="el" href="dbus-auth_8c-source.html#l00160">state</a>. </td> </tr> </table> <a name="a2" doxytag="dbus-auth.c::_dbus_auth_ref"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="structDBusAuth.html">DBusAuth</a>* _dbus_auth_ref </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname1" valign="top" nowrap> <em>auth</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Increments the refcount of an auth object. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> the auth conversation </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l01981">1981</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00154">refcount</a>. </td> </tr> </table> <a name="a9" doxytag="dbus-auth.c::_dbus_auth_return_buffer"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void _dbus_auth_return_buffer </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname" nowrap> <em>auth</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="structDBusString.html">DBusString</a> * </td> <td class="mdname" nowrap> <em>buffer</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>bytes_read</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns a buffer with new data read into it. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> <tr><td valign=top><em>buffer</em> </td><td> the buffer being returned </td></tr> <tr><td valign=top><em>bytes_read</em> </td><td> number of new bytes added </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02178">2178</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00190">buffer_outstanding</a>, and <a class="el" href="dbus-auth_8c-source.html#l00157">incoming</a>. </td> </tr> </table> <a name="a0" doxytag="dbus-auth.c::_dbus_auth_server_new"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="structDBusAuth.html">DBusAuth</a>* _dbus_auth_server_new </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Creates a new auth conversation object for the server side. <p> See doc/dbus-sasl-profile.txt for full details on what this object does. <p> <dl compact><dt><b> Returns: </b><dd> the new object or <a class="el" href="group__DBusMacros.html#a4">NULL</a> if no memory </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l01921">1921</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00211">DBusAuthServer::failures</a>, <a class="el" href="dbus-auth_8c-source.html#l00212">DBusAuthServer::max_failures</a>, <a class="el" href="dbus-auth_8c-source.html#l00155">side</a>, and <a class="el" href="dbus-auth_8c-source.html#l00160">state</a>. </td> </tr> </table> <a name="a18" doxytag="dbus-auth.c::_dbus_auth_set_context"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> _dbus_auth_set_context </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname" nowrap> <em>auth</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const <a class="el" href="structDBusString.html">DBusString</a> * </td> <td class="mdname" nowrap> <em>context</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Sets the "authentication context" which scopes cookies with the DBUS_COOKIE_SHA1 auth mechanism for example. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> <tr><td valign=top><em>context</em> </td><td> the context </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> <a class="el" href="group__DBusMacros.html#a3">FALSE</a> if no memory </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02385">2385</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00176">context</a>. </td> </tr> </table> <a name="a16" doxytag="dbus-auth.c::_dbus_auth_set_credentials"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void _dbus_auth_set_credentials </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname" nowrap> <em>auth</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const <a class="el" href="structDBusCredentials.html">DBusCredentials</a> * </td> <td class="mdname" nowrap> <em>credentials</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Sets credentials received via reliable means from the operating system. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> <tr><td valign=top><em>credentials</em> </td><td> the credentials received </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02353">2353</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00168">credentials</a>. </td> </tr> </table> <a name="a4" doxytag="dbus-auth.c::_dbus_auth_set_mechanisms"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> _dbus_auth_set_mechanisms </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname" nowrap> <em>auth</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char ** </td> <td class="mdname" nowrap> <em>mechanisms</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Sets an array of authentication mechanism names that we are willing to use. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> <tr><td valign=top><em>mechanisms</em> </td><td> <a class="el" href="group__DBusMacros.html#a4">NULL</a>-terminated array of mechanism names </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> <a class="el" href="group__DBusMacros.html#a3">FALSE</a> if no memory </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l02035">2035</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00181">allowed_mechs</a>. </td> </tr> </table> <a name="a3" doxytag="dbus-auth.c::_dbus_auth_unref"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void _dbus_auth_unref </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structDBusAuth.html">DBusAuth</a> * </td> <td class="mdname1" valign="top" nowrap> <em>auth</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Decrements the refcount of an auth object. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>auth</em> </td><td> the auth conversation </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-auth_8c-source.html#l01996">1996</a> of file <a class="el" href="dbus-auth_8c-source.html">dbus-auth.c</a>. <p> References <a class="el" href="dbus-auth_8c-source.html#l00181">allowed_mechs</a>, <a class="el" href="dbus-auth_8c-source.html#l00179">challenge</a>, <a class="el" href="dbus-auth_8c-source.html#l00176">context</a>, <a class="el" href="dbus-auth_8c-source.html#l00164">identity</a>, <a class="el" href="dbus-auth_8c-source.html#l00157">incoming</a>, <a class="el" href="dbus-auth_8c-source.html#l00177">keyring</a>, <a class="el" href="dbus-auth_8c-source.html#l00158">outgoing</a>, and <a class="el" href="dbus-auth_8c-source.html#l00154">refcount</a>. </td> </tr> </table> <hr><address align="right"><small>Generated on Wed Jun 9 05:01:27 2004 for D-BUS by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.15 </small></address> </body> </html>