Functions | |
void | _dbus_keyring_ref (DBusKeyring *keyring) |
Increments reference count of the keyring. | |
void | _dbus_keyring_unref (DBusKeyring *keyring) |
Decrements refcount and finalizes if it reaches zero. | |
DBusKeyring * | _dbus_keyring_new_homedir (const DBusString *username, const DBusString *context, DBusError *error) |
Creates a new keyring that lives in the ~/.dbus-keyrings directory of the given user. | |
dbus_bool_t | _dbus_keyring_validate_context (const DBusString *context) |
Checks whether the context is a valid context. | |
int | _dbus_keyring_get_best_key (DBusKeyring *keyring, DBusError *error) |
Gets a recent key to use for authentication. | |
dbus_bool_t | _dbus_keyring_is_for_user (DBusKeyring *keyring, const DBusString *username) |
Checks whether the keyring is for the given username. | |
dbus_bool_t | _dbus_keyring_get_hex_key (DBusKeyring *keyring, int key_id, DBusString *hex_key) |
Gets the hex-encoded secret key for the given ID. |
Types and functions related to DBusKeyring. DBusKeyring is intended to manage cookies used to authenticate clients to servers. This is essentially the "verify that client can read the user's homedir" authentication mechanism. Both client and server must have access to the homedir.
The secret keys are not kept in locked memory, and are written to a file in the user's homedir. However they are transient (only used by a single server instance for a fixed period of time, then discarded). Also, the keys are not sent over the wire.
|
Gets a recent key to use for authentication. If no recent key exists, creates one. Returns the key ID. If a key can't be written to the keyring file so no recent key can be created, returns -1. All valid keys are > 0.
Definition at line 953 of file dbus-keyring.c. References dbus_set_error_const(). |
|
Gets the hex-encoded secret key for the given ID. Returns FALSE if not enough memory. Returns TRUE but empty key on any other error such as unknown key ID.
Definition at line 1011 of file dbus-keyring.c. References _dbus_string_get_length(), _dbus_string_hex_encode(), keys, n_keys, NULL, and TRUE. |
|
Checks whether the keyring is for the given username.
Definition at line 992 of file dbus-keyring.c. References _dbus_string_equal(), and username. |
|
Creates a new keyring that lives in the ~/.dbus-keyrings directory of the given user. If the username is NULL, uses the user owning the current process.
Definition at line 697 of file dbus-keyring.c. References _dbus_assert, _dbus_assert_not_reached, _dbus_concat_dir_and_file(), _dbus_create_directory(), _dbus_getenv(), _dbus_homedir_from_current_process(), _dbus_homedir_from_username(), _dbus_keyring_unref(), _dbus_keyring_validate_context(), _dbus_string_append(), _dbus_string_copy(), _dbus_string_free(), _dbus_string_init(), _dbus_string_init_const(), _dbus_string_set_length(), _dbus_username_from_current_process(), _dbus_warn(), dbus_bool_t, dbus_error_free(), dbus_error_init(), dbus_set_error(), dbus_set_error_const(), directory, FALSE, filename, filename_lock, NULL, TRUE, and username. |
|
Increments reference count of the keyring.
Definition at line 659 of file dbus-keyring.c. References refcount. |
|
Decrements refcount and finalizes if it reaches zero.
Definition at line 671 of file dbus-keyring.c. References _dbus_string_free(), dbus_free(), directory, filename, filename_lock, keys, n_keys, refcount, and username. Referenced by _dbus_auth_unref(), and _dbus_keyring_new_homedir(). |
|
Checks whether the context is a valid context. Contexts that might cause confusion when used in filenames are not allowed (contexts can't start with a dot or contain dir separators).
Definition at line 857 of file dbus-keyring.c. References _dbus_string_find(), _dbus_string_find_blank(), _dbus_string_get_length(), _dbus_string_validate_ascii(), FALSE, and TRUE. Referenced by _dbus_keyring_new_homedir(). |