dbus-auth.c File Reference

Typedef DBusInitialResponseFunction

typedef dbus_bool_t (* DBusInitialResponseFunction

This function appends an initial client response to the given string

Typedef DBusAuthDataFunction

typedef dbus_bool_t (* DBusAuthDataFunction

This function processes a block of data received from the peer. i.e. handles a DATA command.

Typedef DBusAuthEncodeFunction

typedef dbus_bool_t (* DBusAuthEncodeFunction

This function encodes a block of data from the peer.

Typedef DBusAuthDecodeFunction

typedef dbus_bool_t (* DBusAuthDecodeFunction

This function decodes a block of data from the peer.

Typedef DBusAuthShutdownFunction

typedef void(* DBusAuthShutdownFunction

This function is called when the mechanism is abandoned.

Enum DBusAuthCommand

Enumeration for the known authentication commands.

Enumerators

DBUS_AUTH_COMMAND_AUTH
DBUS_AUTH_COMMAND_CANCEL
DBUS_AUTH_COMMAND_DATA
DBUS_AUTH_COMMAND_BEGIN
DBUS_AUTH_COMMAND_REJECTED
DBUS_AUTH_COMMAND_OK
DBUS_AUTH_COMMAND_ERROR
DBUS_AUTH_COMMAND_UNKNOWN

Typedef DBusAuthStateFunction

typedef dbus_bool_t (* DBusAuthStateFunction

Auth state function, determines the reaction to incoming events for a particular state. Returns whether we had enough memory to complete the operation.

goto_state(DBusAuth *, const DBusAuthStateData *)

void goto_state ( DBusAuth * auth,
const DBusAuthStateData * new_state
) [static]

Parameters

DBusAuth * auth
const DBusAuthStateData * new_state

send_auth(DBusAuth *, const DBusAuthMechanismHandler *)

dbus_bool_t send_auth ( DBusAuth * auth,
const DBusAuthMechanismHandler * mech
) [static]

Parameters

DBusAuth * auth
const DBusAuthMechanismHandler * mech

send_data(DBusAuth *, DBusString *)

dbus_bool_t send_data ( DBusAuth * auth,
DBusString * data
) [static]

Parameters

DBusAuth * auth
DBusString * data

send_rejected(DBusAuth *)

dbus_bool_t send_rejected ( DBusAuth * auth ) [static]

Parameters

DBusAuth * auth

send_error(DBusAuth *, const char *)

dbus_bool_t send_error ( DBusAuth * auth,
const char * message
) [static]

Parameters

DBusAuth * auth
const char * message

send_ok(DBusAuth *)

dbus_bool_t send_ok ( DBusAuth * auth ) [static]

Parameters

DBusAuth * auth

send_begin(DBusAuth *, const DBusString *)

dbus_bool_t send_begin ( DBusAuth * auth,
const DBusString * args_from_ok
) [static]

Parameters

DBusAuth * auth
const DBusString * args_from_ok

send_cancel(DBusAuth *)

dbus_bool_t send_cancel ( DBusAuth * auth ) [static]

Parameters

DBusAuth * auth

handle_server_state_waiting_for_auth(DBusAuth *, DBusAuthCommand, const DBusString *)

dbus_bool_t handle_server_state_waiting_for_auth ( DBusAuth * auth,
DBusAuthCommand command,
const DBusString * args
) [static]

Client states

Parameters

DBusAuth * auth
DBusAuthCommand command
const DBusString * args

handle_server_state_waiting_for_data(DBusAuth *, DBusAuthCommand, const DBusString *)

dbus_bool_t handle_server_state_waiting_for_data ( DBusAuth * auth,
DBusAuthCommand command,
const DBusString * args
) [static]

Parameters

DBusAuth * auth
DBusAuthCommand command
const DBusString * args

handle_server_state_waiting_for_begin(DBusAuth *, DBusAuthCommand, const DBusString *)

dbus_bool_t handle_server_state_waiting_for_begin ( DBusAuth * auth,
DBusAuthCommand command,
const DBusString * args
) [static]

Parameters

DBusAuth * auth
DBusAuthCommand command
const DBusString * args

const DBusAuthStateData server_state_waiting_for_auth

const DBusAuthStateData server_state_waiting_for_auth [static]

const DBusAuthStateData server_state_waiting_for_data

const DBusAuthStateData server_state_waiting_for_data [static]

const DBusAuthStateData server_state_waiting_for_begin

const DBusAuthStateData server_state_waiting_for_begin [static]

handle_client_state_waiting_for_data(DBusAuth *, DBusAuthCommand, const DBusString *)

dbus_bool_t handle_client_state_waiting_for_data ( DBusAuth * auth,
DBusAuthCommand command,
const DBusString * args
) [static]

Client states

Parameters

DBusAuth * auth
DBusAuthCommand command
const DBusString * args

handle_client_state_waiting_for_ok(DBusAuth *, DBusAuthCommand, const DBusString *)

dbus_bool_t handle_client_state_waiting_for_ok ( DBusAuth * auth,
DBusAuthCommand command,
const DBusString * args
) [static]

Parameters

DBusAuth * auth
DBusAuthCommand command
const DBusString * args

handle_client_state_waiting_for_reject(DBusAuth *, DBusAuthCommand, const DBusString *)

dbus_bool_t handle_client_state_waiting_for_reject ( DBusAuth * auth,
DBusAuthCommand command,
const DBusString * args
) [static]

Parameters

DBusAuth * auth
DBusAuthCommand command
const DBusString * args

const DBusAuthStateData client_state_need_send_auth

const DBusAuthStateData client_state_need_send_auth [static]

const DBusAuthStateData client_state_waiting_for_data

const DBusAuthStateData client_state_waiting_for_data [static]

const DBusAuthStateData client_state_waiting_for_ok

const DBusAuthStateData client_state_waiting_for_ok [static]

const DBusAuthStateData client_state_waiting_for_reject

const DBusAuthStateData client_state_waiting_for_reject [static]

const DBusAuthStateData common_state_authenticated

const DBusAuthStateData common_state_authenticated [static]

Common terminal states. Terminal states have handler == NULL.

const DBusAuthStateData common_state_need_disconnect

const DBusAuthStateData common_state_need_disconnect [static]

const char auth_side_client

const char auth_side_client [static]

const char auth_side_server

const char auth_side_server [static]

DBUS_AUTH_IS_SERVER

DBUS_AUTH_IS_CLIENT

DBUS_AUTH_CLIENT

DBUS_AUTH_SERVER

DBUS_AUTH_NAME

The name of the auth ("client" or "server")

_dbus_auth_new(int)

DBusAuth * _dbus_auth_new ( int size ) [static]

Parameters

int size

shutdown_mech(DBusAuth *)

void shutdown_mech ( DBusAuth * auth ) [static]

Parameters

DBusAuth * auth

sha1_compute_hash(DBusAuth *, int, const DBusString *, const DBusString *, DBusString *)

dbus_bool_t sha1_compute_hash ( DBusAuth * auth,
int cookie_id,
const DBusString * server_challenge,
const DBusString * client_challenge,
DBusString * hash
) [static]

Parameters

DBusAuth * auth
int cookie_id
const DBusString * server_challenge
const DBusString * client_challenge
DBusString * hash

N_CHALLENGE_BYTES

http://www.ietf.org/rfc/rfc2831.txt suggests at least 64 bits of entropy, we use 128. This is the number of bytes in the random challenge.

sha1_handle_first_client_response(DBusAuth *, const DBusString *)

dbus_bool_t sha1_handle_first_client_response ( DBusAuth * auth,
const DBusString * data
) [static]

Parameters

DBusAuth * auth
const DBusString * data

sha1_handle_second_client_response(DBusAuth *, const DBusString *)

dbus_bool_t sha1_handle_second_client_response ( DBusAuth * auth,
const DBusString * data
) [static]

Parameters

DBusAuth * auth
const DBusString * data

handle_server_data_cookie_sha1_mech(DBusAuth *, const DBusString *)

dbus_bool_t handle_server_data_cookie_sha1_mech ( DBusAuth * auth,
const DBusString * data
) [static]

Parameters

DBusAuth * auth
const DBusString * data

platform_security_handle_first_client_response(DBusAuth *, const DBusString *)

dbus_bool_t platform_security_handle_first_client_response ( DBusAuth * auth,
const DBusString * data
) [static]

Parameters

DBusAuth * auth
const DBusString * data

platform_security_handle_second_client_response(DBusAuth *, const DBusString *)

dbus_bool_t platform_security_handle_second_client_response ( DBusAuth * auth,
const DBusString * data
) [static]

Parameters

DBusAuth * auth
const DBusString * data

handle_server_data_platform_security_mech(DBusAuth *, const DBusString *)

dbus_bool_t handle_server_data_platform_security_mech ( DBusAuth * auth,
const DBusString * data
) [static]

Parameters

DBusAuth * auth
const DBusString * data

handle_server_shutdown_platform_security_mech(DBusAuth *)

void handle_server_shutdown_platform_security_mech ( DBusAuth * auth ) [static]

Parameters

DBusAuth * auth

handle_server_shutdown_cookie_sha1_mech(DBusAuth *)

void handle_server_shutdown_cookie_sha1_mech ( DBusAuth * auth ) [static]

Parameters

DBusAuth * auth

handle_client_initial_response_platform_security_mech(DBusAuth *, DBusString *)

dbus_bool_t handle_client_initial_response_platform_security_mech ( DBusAuth * auth,
DBusString * response
) [static]

Parameters

DBusAuth * auth
DBusString * response

handle_client_initial_response_cookie_sha1_mech(DBusAuth *, DBusString *)

dbus_bool_t handle_client_initial_response_cookie_sha1_mech ( DBusAuth * auth,
DBusString * response
) [static]

Parameters

DBusAuth * auth
DBusString * response

handle_client_data_platform_security_mech(DBusAuth *, const DBusString *)

dbus_bool_t handle_client_data_platform_security_mech ( DBusAuth * auth,
const DBusString * data
) [static]

Parameters

DBusAuth * auth
const DBusString * data

handle_client_data_cookie_sha1_mech(DBusAuth *, const DBusString *)

dbus_bool_t handle_client_data_cookie_sha1_mech ( DBusAuth * auth,
const DBusString * data
) [static]

Parameters

DBusAuth * auth
const DBusString * data

handle_client_shutdown_platform_security_mech(DBusAuth *)

void handle_client_shutdown_platform_security_mech ( DBusAuth * auth ) [static]

Parameters

DBusAuth * auth

handle_client_shutdown_cookie_sha1_mech(DBusAuth *)

void handle_client_shutdown_cookie_sha1_mech ( DBusAuth * auth ) [static]

Parameters

DBusAuth * auth

handle_server_data_external_mech(DBusAuth *, const DBusString *)

dbus_bool_t handle_server_data_external_mech ( DBusAuth * auth,
const DBusString * data
) [static]

Parameters

DBusAuth * auth
const DBusString * data

handle_server_shutdown_external_mech(DBusAuth *)

void handle_server_shutdown_external_mech ( DBusAuth * auth ) [static]

Parameters

DBusAuth * auth

handle_client_initial_response_external_mech(DBusAuth *, DBusString *)

dbus_bool_t handle_client_initial_response_external_mech ( DBusAuth * auth,
DBusString * response
) [static]

Parameters

DBusAuth * auth
DBusString * response

handle_client_data_external_mech(DBusAuth *, const DBusString *)

dbus_bool_t handle_client_data_external_mech ( DBusAuth * auth,
const DBusString * data
) [static]

Parameters

DBusAuth * auth
const DBusString * data

handle_client_shutdown_external_mech(DBusAuth *)

void handle_client_shutdown_external_mech ( DBusAuth * auth ) [static]

Parameters

DBusAuth * auth

const DBusAuthMechanismHandler all_mechanisms

const DBusAuthMechanismHandler all_mechanisms [static]

find_mech(const DBusString *, char **)

const DBusAuthMechanismHandler * find_mech ( const DBusString * name,
char ** allowed_mechs
) [static]

Parameters

const DBusString * name
char ** allowed_mechs

process_data(DBusAuth *, const DBusString *, DBusAuthDataFunction)

dbus_bool_t process_data ( DBusAuth * auth,
const DBusString * args,
DBusAuthDataFunction data_func
) [static]

Parameters

DBusAuth * auth
const DBusString * args
DBusAuthDataFunction data_func

handle_auth(DBusAuth *, const DBusString *)

dbus_bool_t handle_auth ( DBusAuth * auth,
const DBusString * args
) [static]

Parameters

DBusAuth * auth
const DBusString * args

get_word(const DBusString *, int *, DBusString *)

dbus_bool_t get_word ( const DBusString * str,
int * start,
DBusString * word
) [static]

Parameters

const DBusString * str
int * start
DBusString * word

record_mechanisms(DBusAuth *, const DBusString *)

dbus_bool_t record_mechanisms ( DBusAuth * auth,
const DBusString * args
) [static]

Parameters

DBusAuth * auth
const DBusString * args

process_rejected(DBusAuth *, const DBusString *)

dbus_bool_t process_rejected ( DBusAuth * auth,
const DBusString * args
) [static]

Parameters

DBusAuth * auth
const DBusString * args

const DBusAuthCommandName auth_command_names

const DBusAuthCommandName auth_command_names [static]

lookup_command_from_name(DBusString *)

DBusAuthCommand lookup_command_from_name ( DBusString * command ) [static]

Parameters

DBusString * command

process_command(DBusAuth *)

dbus_bool_t process_command ( DBusAuth * auth ) [static]

Parameters

DBusAuth * auth

_dbus_auth_client_new_test(void)

DBusAuth * _dbus_auth_client_new_test ( void )

Creates a new auth conversation object for the client side. See doc/dbus-sasl-profile.txt for full details on what this object does.

Parameters

void

DBUS_AUTH_IN_END_STATE

MAX_BUFFER