Defines | |
#define | DBUS_AUTH_IN_END_STATE(auth) ((auth)->need_disconnect || (auth)->authenticated) |
Functions | |
DBusAuth * | _dbus_auth_server_new (void) |
Creates a new auth conversation object for the server side. | |
DBusAuth * | _dbus_auth_client_new (void) |
Creates a new auth conversation object for the client side. | |
DBusAuth * | _dbus_auth_ref (DBusAuth *auth) |
Increments the refcount of an auth object. | |
void | _dbus_auth_unref (DBusAuth *auth) |
Decrements the refcount of an auth object. | |
dbus_bool_t | _dbus_auth_set_mechanisms (DBusAuth *auth, const char **mechanisms) |
Sets an array of authentication mechanism names that we are willing to use. | |
DBusAuthState | _dbus_auth_do_work (DBusAuth *auth) |
Analyzes buffered input and moves the auth conversation forward, returning the new state of the auth conversation. | |
dbus_bool_t | _dbus_auth_get_bytes_to_send (DBusAuth *auth, const DBusString **str) |
Gets bytes that need to be sent to the peer we're conversing with. | |
void | _dbus_auth_bytes_sent (DBusAuth *auth, int bytes_sent) |
Notifies the auth conversation object that the given number of bytes of the outgoing buffer have been written out. | |
void | _dbus_auth_get_buffer (DBusAuth *auth, DBusString **buffer) |
Get a buffer to be used for reading bytes from the peer we're conversing with. | |
void | _dbus_auth_return_buffer (DBusAuth *auth, DBusString *buffer, int bytes_read) |
Returns a buffer with new data read into it. | |
void | _dbus_auth_get_unused_bytes (DBusAuth *auth, const DBusString **str) |
Returns leftover bytes that were not used as part of the auth conversation. | |
void | _dbus_auth_delete_unused_bytes (DBusAuth *auth) |
Gets rid of unused bytes returned by _dbus_auth_get_unused_bytes() after we've gotten them and successfully moved them elsewhere. | |
dbus_bool_t | _dbus_auth_needs_encoding (DBusAuth *auth) |
Called post-authentication, indicates whether we need to encode the message stream with _dbus_auth_encode_data() prior to sending it to the peer. | |
dbus_bool_t | _dbus_auth_encode_data (DBusAuth *auth, const DBusString *plaintext, DBusString *encoded) |
Called post-authentication, encodes a block of bytes for sending to the peer. | |
dbus_bool_t | _dbus_auth_needs_decoding (DBusAuth *auth) |
Called post-authentication, indicates whether we need to decode the message stream with _dbus_auth_decode_data() after receiving it from the peer. | |
dbus_bool_t | _dbus_auth_decode_data (DBusAuth *auth, const DBusString *encoded, DBusString *plaintext) |
Called post-authentication, decodes a block of bytes received from the peer. | |
void | _dbus_auth_set_credentials (DBusAuth *auth, const DBusCredentials *credentials) |
Sets credentials received via reliable means from the operating system. | |
void | _dbus_auth_get_identity (DBusAuth *auth, DBusCredentials *credentials) |
Gets the identity we authorized the client as. | |
dbus_bool_t | _dbus_auth_set_context (DBusAuth *auth, const DBusString *context) |
Sets the "authentication context" which scopes cookies with the DBUS_COOKIE_SHA1 auth mechanism for example. |
DBusAuth manages the authentication negotiation when a connection is first established, and also manage any encryption used over a connection.
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.
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.
the cookie keyring needs to be cached globally not just per-auth (which raises threadsafety issues too)
grep FIXME in dbus-auth.c
|
Definition at line 1979 of file dbus-auth.c. Referenced by _dbus_auth_delete_unused_bytes(), _dbus_auth_do_work(), _dbus_auth_get_bytes_to_send(), and _dbus_auth_get_unused_bytes(). |
|
Notifies the auth conversation object that the given number of bytes of the outgoing buffer have been written out.
Definition at line 2082 of file dbus-auth.c. References _dbus_string_delete(), _dbus_string_get_const_data(), _dbus_string_get_length(), DBUS_AUTH_NAME, and TRUE. |
|
Creates a new auth conversation object for the client side. See doc/dbus-sasl-profile.txt for full details on what this object does.
Definition at line 1865 of file dbus-auth.c. References _dbus_auth_unref(), _dbus_list_append(), DBUS_AUTH_CLIENT, handlers, and NULL. Referenced by _dbus_transport_init_base(). |
|
Called post-authentication, decodes a block of bytes received from the peer. If no encoding was negotiated, just copies the bytes (you can avoid this by checking _dbus_auth_needs_decoding()).
Definition at line 2269 of file dbus-auth.c. References _dbus_assert, _dbus_auth_needs_decoding(), _dbus_string_copy(), _dbus_string_get_length(), authenticated, DBusAuthMechanismHandler::client_decode_func, DBUS_AUTH_IS_CLIENT, FALSE, mech, and DBusAuthMechanismHandler::server_decode_func. |
|
Gets rid of unused bytes returned by _dbus_auth_get_unused_bytes() after we've gotten them and successfully moved them elsewhere.
Definition at line 2162 of file dbus-auth.c. References _dbus_string_set_length(), DBUS_AUTH_IN_END_STATE, and incoming. |
|
Analyzes buffered input and moves the auth conversation forward, returning the new state of the auth conversation.
Definition at line 1989 of file dbus-auth.c. References _dbus_string_get_length(), already_got_mechanisms, authenticated, DBUS_AUTH_CLIENT, DBUS_AUTH_IN_END_STATE, DBUS_AUTH_IS_SERVER, DBUS_AUTH_NAME, DBUS_AUTH_SERVER, FALSE, incoming, mech, need_disconnect, needed_memory, NULL, outgoing, and TRUE. Referenced by _dbus_transport_get_dispatch_status(), and _dbus_transport_get_is_authenticated(). |
|
Called post-authentication, encodes a block of bytes for sending to the peer. If no encoding was negotiated, just copies the bytes (you can avoid this by checking _dbus_auth_needs_encoding()).
Definition at line 2206 of file dbus-auth.c. References _dbus_assert, _dbus_auth_needs_encoding(), _dbus_string_copy(), _dbus_string_get_length(), authenticated, DBusAuthMechanismHandler::client_encode_func, DBUS_AUTH_IS_CLIENT, FALSE, mech, and DBusAuthMechanismHandler::server_encode_func. |
|
Get a buffer to be used for reading bytes from the peer we're conversing with. Bytes should be appended to this buffer.
Definition at line 2106 of file dbus-auth.c. References _dbus_assert, buffer_outstanding, incoming, NULL, and TRUE. |
|
Gets bytes that need to be sent to the peer we're conversing with. After writing some bytes, _dbus_auth_bytes_sent() must be called to notify the auth object that they were written.
Definition at line 2054 of file dbus-auth.c. References _dbus_assert, _dbus_string_get_length(), DBUS_AUTH_IN_END_STATE, FALSE, NULL, outgoing, and TRUE. |
|
Gets the identity we authorized the client as. Apps may have different policies as to what identities they allow.
Definition at line 2314 of file dbus-auth.c. References _dbus_credentials_clear(), authenticated, and authorized_identity. Referenced by _dbus_transport_get_is_authenticated(), and _dbus_transport_get_unix_user(). |
|
Returns leftover bytes that were not used as part of the auth conversation. These bytes will be part of the message stream instead. This function may not be called until authentication has succeeded.
Definition at line 2145 of file dbus-auth.c. References DBUS_AUTH_IN_END_STATE, and incoming. |
|
Called post-authentication, indicates whether we need to decode the message stream with _dbus_auth_decode_data() after receiving it from the peer.
Definition at line 2238 of file dbus-auth.c. References authenticated, DBusAuthMechanismHandler::client_decode_func, DBUS_AUTH_IS_CLIENT, FALSE, mech, NULL, and DBusAuthMechanismHandler::server_decode_func. Referenced by _dbus_auth_decode_data(). |
|
Called post-authentication, indicates whether we need to encode the message stream with _dbus_auth_encode_data() prior to sending it to the peer.
Definition at line 2179 of file dbus-auth.c. References authenticated, DBusAuthMechanismHandler::client_encode_func, DBUS_AUTH_IS_CLIENT, FALSE, mech, NULL, and DBusAuthMechanismHandler::server_encode_func. Referenced by _dbus_auth_encode_data(). |
|
Increments the refcount of an auth object.
Definition at line 1900 of file dbus-auth.c. References _dbus_assert, NULL, and refcount. |
|
Returns a buffer with new data read into it.
Definition at line 2125 of file dbus-auth.c. References _dbus_assert, buffer_outstanding, FALSE, and incoming. |
|
Creates a new auth conversation object for the server side. See doc/dbus-sasl-profile.txt for full details on what this object does.
Definition at line 1835 of file dbus-auth.c. References DBUS_AUTH_SERVER, DBusAuthServer::failures, handlers, DBusAuthServer::max_failures, and NULL. Referenced by _dbus_transport_init_base(). |
|
Sets the "authentication context" which scopes cookies with the DBUS_COOKIE_SHA1 auth mechanism for example.
Definition at line 2332 of file dbus-auth.c. References _dbus_string_get_length(), _dbus_string_replace_len(), and context. |
|
Sets credentials received via reliable means from the operating system.
Definition at line 2300 of file dbus-auth.c. References credentials. |
|
Sets an array of authentication mechanism names that we are willing to use.
Definition at line 1954 of file dbus-auth.c. References _dbus_dup_string_array(), allowed_mechs, dbus_free_string_array(), FALSE, NULL, and TRUE. Referenced by _dbus_transport_set_auth_mechanisms(). |
|
Decrements the refcount of an auth object.
Definition at line 1915 of file dbus-auth.c. References _dbus_assert, _dbus_keyring_unref(), _dbus_list_clear(), _dbus_string_free(), allowed_mechs, challenge, context, DBUS_AUTH_CLIENT, DBUS_AUTH_IS_CLIENT, dbus_free(), dbus_free_string_array(), identity, incoming, keyring, NULL, outgoing, and refcount. Referenced by _dbus_auth_client_new(), _dbus_transport_finalize_base(), and _dbus_transport_init_base(). |