D-Bus 1.14.10
|
Macros | |
#define | DBUS_AUTH_IN_END_STATE(auth) ((auth)->state->handler == NULL) |
Functions | |
DBusAuth * | _dbus_auth_server_new (const DBusString *guid) |
Creates a new auth conversation object for the server side. More... | |
DBusAuth * | _dbus_auth_client_new (void) |
Creates a new auth conversation object for the client side. More... | |
DBusAuth * | _dbus_auth_ref (DBusAuth *auth) |
Increments the refcount of an auth object. More... | |
void | _dbus_auth_unref (DBusAuth *auth) |
Decrements the refcount of an auth object. More... | |
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. More... | |
DBusAuthState | _dbus_auth_do_work (DBusAuth *auth) |
Analyzes buffered input and moves the auth conversation forward, returning the new state of the auth conversation. More... | |
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. More... | |
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. More... | |
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. More... | |
void | _dbus_auth_return_buffer (DBusAuth *auth, DBusString *buffer) |
Returns a buffer with new data read into it. More... | |
void | _dbus_auth_get_unused_bytes (DBusAuth *auth, const DBusString **str) |
Returns leftover bytes that were not used as part of the auth conversation. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
dbus_bool_t | _dbus_auth_set_credentials (DBusAuth *auth, DBusCredentials *credentials) |
Sets credentials received via reliable means from the operating system. More... | |
DBusCredentials * | _dbus_auth_get_identity (DBusAuth *auth) |
Gets the identity we authorized the client as. More... | |
const char * | _dbus_auth_get_guid_from_server (DBusAuth *auth) |
Gets the GUID from the server if we've authenticated; gets NULL otherwise. More... | |
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. More... | |
void | _dbus_auth_set_unix_fd_possible (DBusAuth *auth, dbus_bool_t b) |
Sets whether unix fd passing is potentially on the transport and hence shall be negotiated. More... | |
dbus_bool_t | _dbus_auth_get_unix_fd_negotiated (DBusAuth *auth) |
Queries whether unix fd passing was successfully negotiated. More... | |
dbus_bool_t | _dbus_auth_is_supported_mechanism (DBusString *name) |
Queries whether the given auth mechanism is supported. More... | |
dbus_bool_t | _dbus_auth_dump_supported_mechanisms (DBusString *buffer) |
Return a human-readable string containing all supported auth mechanisms. More... | |
DBusAuth object.
DBusAuth manages the authentication negotiation when a connection is first established, and also manages any encryption used over a connection.
#define DBUS_AUTH_IN_END_STATE | ( | auth | ) | ((auth)->state->handler == NULL) |
auth | the auth conversation object |
Definition at line 2528 of file dbus-auth.c.
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.
auth | the auth conversation |
bytes_sent | number of bytes written out |
Definition at line 2607 of file dbus-auth.c.
References _dbus_string_delete(), DBUS_AUTH_NAME, and outgoing.
DBusAuth * _dbus_auth_client_new | ( | void | ) |
Creates a new auth conversation object for the client side.
See http://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol for full details on what this object does.
Definition at line 2400 of file dbus-auth.c.
References _dbus_string_init(), and NULL.
Referenced by _dbus_transport_init_base().
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.
If no encoding was negotiated, just copies the bytes (you can avoid this by checking _dbus_auth_needs_decoding()).
auth | the auth conversation |
encoded | the encoded data |
plaintext | initialized string where decoded data is appended |
Definition at line 2788 of file dbus-auth.c.
References _dbus_assert, and state.
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.
auth | the auth conversation |
Definition at line 2681 of file dbus-auth.c.
References _dbus_string_set_length(), DBUS_AUTH_IN_END_STATE, and incoming.
DBusAuthState _dbus_auth_do_work | ( | DBusAuth * | auth | ) |
Analyzes buffered input and moves the auth conversation forward, returning the new state of the auth conversation.
auth | the auth conversation |
Definition at line 2538 of file dbus-auth.c.
References DBUS_AUTH_IN_END_STATE, FALSE, incoming, needed_memory, and outgoing.
Referenced by _dbus_transport_get_dispatch_status(), and _dbus_transport_try_to_authenticate().
dbus_bool_t _dbus_auth_dump_supported_mechanisms | ( | DBusString * | buffer | ) |
Return a human-readable string containing all supported auth mechanisms.
string | to hold the supported auth mechanisms |
Definition at line 2934 of file dbus-auth.c.
References _dbus_assert, and NULL.
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.
If no encoding was negotiated, just copies the bytes (you can avoid this by checking _dbus_auth_needs_encoding()).
auth | the auth conversation |
plaintext | the plain text data |
encoded | initialized string to where encoded data is appended |
Definition at line 2725 of file dbus-auth.c.
References _dbus_assert, and state.
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.
Bytes should be appended to this buffer.
auth | the auth conversation |
buffer | return location for buffer to append bytes to |
Definition at line 2627 of file dbus-auth.c.
References _dbus_assert, buffer_outstanding, incoming, NULL, and TRUE.
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.
After writing some bytes, _dbus_auth_bytes_sent() must be called to notify the auth object that they were written.
auth | the auth conversation |
str | return location for a ref to the buffer to send |
Definition at line 2582 of file dbus-auth.c.
References _dbus_assert, FALSE, NULL, outgoing, and TRUE.
const char * _dbus_auth_get_guid_from_server | ( | DBusAuth * | auth | ) |
Gets the GUID from the server if we've authenticated; gets NULL otherwise.
auth | the auth object |
Definition at line 2862 of file dbus-auth.c.
References _dbus_assert, DBUS_AUTH_IS_CLIENT, and state.
Referenced by _dbus_transport_get_server_id(), and _dbus_transport_try_to_authenticate().
DBusCredentials * _dbus_auth_get_identity | ( | DBusAuth * | auth | ) |
Gets the identity we authorized the client as.
Apps may have different policies as to what identities they allow.
Returned credentials are not a copy and should not be modified
auth | the auth conversation |
Definition at line 2838 of file dbus-auth.c.
References state.
Referenced by _dbus_transport_get_adt_audit_session_data(), _dbus_transport_get_credentials(), _dbus_transport_get_is_anonymous(), _dbus_transport_get_unix_process_id(), _dbus_transport_get_unix_user(), _dbus_transport_get_windows_user(), and _dbus_transport_try_to_authenticate().
dbus_bool_t _dbus_auth_get_unix_fd_negotiated | ( | DBusAuth * | auth | ) |
Queries whether unix fd passing was successfully negotiated.
auth | the auth conversion |
Definition at line 2908 of file dbus-auth.c.
References unix_fd_negotiated.
void _dbus_auth_get_unused_bytes | ( | DBusAuth * | auth, |
const DBusString ** | str | ||
) |
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.
auth | the auth conversation |
str | return location for pointer to string of unused bytes |
Definition at line 2664 of file dbus-auth.c.
References DBUS_AUTH_IN_END_STATE, and incoming.
dbus_bool_t _dbus_auth_is_supported_mechanism | ( | DBusString * | name | ) |
Queries whether the given auth mechanism is supported.
auth | the auth mechanism to query for |
Definition at line 2920 of file dbus-auth.c.
References _dbus_assert, and NULL.
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.
auth | the auth conversation |
Definition at line 2757 of file dbus-auth.c.
References state.
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.
auth | the auth conversation |
Definition at line 2698 of file dbus-auth.c.
References state.
Increments the refcount of an auth object.
auth | the auth conversation |
Definition at line 2438 of file dbus-auth.c.
References _dbus_assert, NULL, and refcount.
void _dbus_auth_return_buffer | ( | DBusAuth * | auth, |
DBusString * | buffer | ||
) |
Returns a buffer with new data read into it.
auth | the auth conversation |
buffer | the buffer being returned |
Definition at line 2645 of file dbus-auth.c.
References _dbus_assert, buffer_outstanding, FALSE, and incoming.
DBusAuth * _dbus_auth_server_new | ( | const DBusString * | guid | ) |
Creates a new auth conversation object for the server side.
See http://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol for full details on what this object does.
Definition at line 2354 of file dbus-auth.c.
References _dbus_string_copy(), _dbus_string_free(), _dbus_string_init(), and NULL.
Referenced by _dbus_transport_init_base().
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.
auth | the auth conversation |
context | the context |
Definition at line 2881 of file dbus-auth.c.
References _dbus_string_replace_len(), and context.
dbus_bool_t _dbus_auth_set_credentials | ( | DBusAuth * | auth, |
DBusCredentials * | credentials | ||
) |
Sets credentials received via reliable means from the operating system.
auth | the auth conversation |
credentials | the credentials received |
Definition at line 2820 of file dbus-auth.c.
References _dbus_credentials_add_credentials(), _dbus_credentials_clear(), and credentials.
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.
auth | the auth conversation |
mechanisms | NULL-terminated array of mechanism names |
Definition at line 2503 of file dbus-auth.c.
Referenced by _dbus_transport_set_auth_mechanisms().
void _dbus_auth_set_unix_fd_possible | ( | DBusAuth * | auth, |
dbus_bool_t | b | ||
) |
Sets whether unix fd passing is potentially on the transport and hence shall be negotiated.
auth | the auth conversation |
b | TRUE when unix fd passing shall be negotiated, otherwise FALSE |
Definition at line 2896 of file dbus-auth.c.
References unix_fd_possible.
void _dbus_auth_unref | ( | DBusAuth * | auth | ) |
Decrements the refcount of an auth object.
auth | the auth conversation |
Definition at line 2453 of file dbus-auth.c.
References _dbus_assert, NULL, and refcount.
Referenced by _dbus_transport_finalize_base(), and _dbus_transport_init_base().