jabberd2
2.3.6
|
Go to the source code of this file.
Data Structures | |
struct | _sx_sasl_st |
our sasl application context More... | |
struct | _sx_sasl_sess_st |
our sasl per session context More... | |
Typedefs | |
typedef struct _sx_sasl_st * | _sx_sasl_t |
our sasl application context More... | |
typedef struct _sx_sasl_sess_st * | _sx_sasl_sess_t |
our sasl per session context More... | |
Functions | |
static nad_t | _sx_sasl_success (sx_t s, const char *data, int dlen) |
utility: generate a success nad More... | |
static nad_t | _sx_sasl_failure (sx_t s, const char *err) |
utility: generate a failure nad More... | |
static nad_t | _sx_sasl_challenge (sx_t s, const char *data, int dlen) |
utility: generate a challenge nad More... | |
static nad_t | _sx_sasl_response (sx_t s, const char *data, int dlen) |
utility: generate a response nad More... | |
static nad_t | _sx_sasl_abort (sx_t s) |
utility: generate an abort nad More... | |
static int | _sx_sasl_wio (sx_t s, sx_plugin_t p, sx_buf_t buf) |
static int | _sx_sasl_rio (sx_t s, sx_plugin_t p, sx_buf_t buf) |
void | _sx_sasl_open (sx_t s, Gsasl_session *sd) |
move the stream to the auth state More... | |
static void | _sx_sasl_stream (sx_t s, sx_plugin_t p) |
make the stream authenticated second time round More... | |
static void | _sx_sasl_features (sx_t s, sx_plugin_t p, nad_t nad) |
static void | _sx_sasl_notify_success (sx_t s, void *arg) |
auth done, restart the stream More... | |
static void | _sx_sasl_client_process (sx_t s, sx_plugin_t p, Gsasl_session *sd, const char *mech, const char *in, int inlen) |
process handshake packets from the client More... | |
static void | _sx_sasl_server_process (sx_t s, sx_plugin_t p, Gsasl_session *sd, const char *in, int inlen) |
process handshake packets from the server More... | |
static int | _sx_sasl_process (sx_t s, sx_plugin_t p, nad_t nad) |
main nad processor More... | |
static void | _sx_sasl_free (sx_t s, sx_plugin_t p) |
cleanup More... | |
static int | _sx_sasl_gsasl_callback (Gsasl *gsasl_ctx, Gsasl_session *sd, Gsasl_property prop) |
static void | _sx_sasl_unload (sx_plugin_t p) |
int | sx_sasl_init (sx_env_t env, sx_plugin_t p, va_list args) |
args: appname, callback, cb arg More... | |
int | sx_sasl_auth (sx_plugin_t p, sx_t s, const char *appname, const char *mech, const char *user, const char *pass) |
kick off the auth handshake More... | |
typedef struct _sx_sasl_st * _sx_sasl_t |
our sasl application context
typedef struct _sx_sasl_sess_st * _sx_sasl_sess_t |
our sasl per session context
utility: generate a success nad
Definition at line 47 of file sasl.c.
References nad_add_namespace(), nad_append_cdata(), nad_append_elem(), nad_new(), and uri_SASL.
Referenced by _sx_sasl_client_process().
utility: generate a failure nad
Definition at line 62 of file sasl.c.
References nad_add_namespace(), nad_append_elem(), nad_new(), and uri_SASL.
Referenced by _sx_sasl_client_process(), and _sx_sasl_process().
utility: generate a challenge nad
Definition at line 77 of file sasl.c.
References nad_add_namespace(), nad_append_cdata(), nad_append_elem(), nad_new(), and uri_SASL.
Referenced by _sx_sasl_client_process().
utility: generate a response nad
Definition at line 92 of file sasl.c.
References nad_add_namespace(), nad_append_cdata(), nad_append_elem(), nad_new(), and uri_SASL.
Referenced by _sx_sasl_server_process().
utility: generate an abort nad
Definition at line 107 of file sasl.c.
References nad_add_namespace(), nad_append_elem(), nad_new(), and uri_SASL.
Referenced by _sx_sasl_server_process().
|
static |
Definition at line 119 of file sasl.c.
References _sx_buffer_set(), _sx_debug, _sx_event, _sx_gen_error, _sx_buf_st::data, event_ERROR, _sx_plugin_st::index, _sx_buf_st::len, _sx_st::plugin_data, SX_ERR_AUTH, and ZONE.
Referenced by sx_sasl_init().
|
static |
Definition at line 147 of file sasl.c.
References _sx_buffer_set(), _sx_debug, _sx_event, _sx_gen_error, _sx_buf_st::data, event_ERROR, _sx_plugin_st::index, _sx_buf_st::len, _sx_st::plugin_data, SX_ERR_AUTH, and ZONE.
Referenced by sx_sasl_init().
void _sx_sasl_open | ( | sx_t | s, |
Gsasl_session * | sd | ||
) |
move the stream to the auth state
Definition at line 176 of file sasl.c.
References _sx_debug, sx_sasl_creds_st::authnid, sx_sasl_creds_st::authzid, _sx_sasl_st::cb, _sx_sasl_st::cbarg, _sx_sasl_sess_st::ctx, sx_sasl_creds_st::realm, _sx_st::req_to, sx_auth(), sx_sasl_cb_CHECK_AUTHZID, sx_sasl_ret_OK, and ZONE.
Referenced by _sx_sasl_stream().
|
static |
make the stream authenticated second time round
Definition at line 222 of file sasl.c.
References _sx_debug, _sx_sasl_open(), _sx_plugin_st::index, _sx_st::plugin_data, and ZONE.
Referenced by sx_sasl_init().
|
static |
Definition at line 239 of file sasl.c.
References _sx_debug, _sx_sasl_st::cb, _sx_sasl_st::cbarg, _sx_st::flags, _sx_sasl_st::gsasl_ctx, _sx_plugin_st::index, nad_add_namespace(), nad_append_cdata(), nad_append_elem(), _sx_st::plugin_data, _sx_plugin_st::private, _sx_st::ssf, sx_sasl_cb_CHECK_MECH, SX_SASL_OFFER, sx_sasl_ret_OK, SX_SSL_STARTTLS_REQUIRE, _sx_st::type, type_SERVER, uri_SASL, and ZONE.
Referenced by sx_sasl_init().
|
static |
auth done, restart the stream
Definition at line 302 of file sasl.c.
References _sx_chain_io_plugin(), _sx_debug, _sx_reset(), _sx_st::flags, sx_server_init(), and ZONE.
Referenced by _sx_sasl_client_process().
|
static |
process handshake packets from the client
Definition at line 314 of file sasl.c.
References _sasl_err_INCORRECT_ENCODING, _sasl_err_INVALID_MECHANISM, _sasl_err_MALFORMED_REQUEST, _sasl_err_MECH_TOO_WEAK, _sasl_err_TEMPORARY_FAILURE, _sx_debug, _sx_nad_write(), _sx_sasl_challenge(), _sx_sasl_failure(), _sx_sasl_notify_success(), _sx_sasl_success(), _sx_sasl_st::appname, _sx_sasl_st::cb, _sx_sasl_st::cbarg, _jqueue_node_st::data, _sx_sasl_st::ext_id, _jqueue_st::front, _sx_sasl_st::gsasl_ctx, _sx_plugin_st::index, _sx_plugin_st::private, sx_sasl_creds_st::realm, SX_CONN_EXTERNAL_ID_MAX_COUNT, sx_sasl_cb_GEN_AUTHZID, sx_sasl_cb_GET_REALM, SX_SSL_MAGIC, _sx_st::wbufq, and ZONE.
Referenced by _sx_sasl_process().
|
static |
process handshake packets from the server
Definition at line 502 of file sasl.c.
References _sx_debug, _sx_nad_write(), _sx_sasl_abort(), _sx_sasl_response(), and ZONE.
Referenced by _sx_sasl_process().
|
static |
main nad processor
Definition at line 546 of file sasl.c.
References _sasl_err_ABORTED, _sasl_err_INVALID_MECHANISM, _sx_debug, _sx_event, _sx_gen_error, _sx_nad_write(), _sx_reset(), _sx_sasl_client_process(), _sx_sasl_failure(), _sx_sasl_server_process(), event_ERROR, _sx_st::flags, _sx_plugin_st::index, NAD_AVAL, NAD_AVAL_L, NAD_CDATA, NAD_CDATA_L, NAD_ENAME, NAD_ENAME_L, NAD_ENS, nad_find_attr(), nad_free(), NAD_NURI, NAD_NURI_L, _sx_st::ns, _sx_st::plugin_data, _sx_st::req_from, _sx_st::req_to, _sx_st::req_version, _sx_st::ssf, _sx_st::state, state_STREAM, sx_client_init(), SX_ERR_AUTH, SX_SASL_OFFER, SX_SSL_STARTTLS_REQUIRE, _sx_st::type, type_CLIENT, type_SERVER, uri_SASL, and ZONE.
Referenced by sx_sasl_init().
|
static |
cleanup
Definition at line 692 of file sasl.c.
References _sx_debug, _sx_plugin_st::index, _sx_st::plugin_data, and ZONE.
Referenced by sx_sasl_init().
|
static |
Definition at line 712 of file sasl.c.
References _sx_debug, sx_sasl_creds_st::authnid, sx_sasl_creds_st::authzid, _sx_sasl_st::cb, _sx_sasl_st::cbarg, _sx_sasl_sess_st::ctx, _sx_sasl_st::ext_id, sx_sasl_creds_st::pass, sx_sasl_creds_st::realm, _sx_sasl_sess_st::s, SX_CONN_EXTERNAL_ID_MAX_COUNT, sx_sasl_cb_CHECK_PASS, sx_sasl_cb_GET_PASS, sx_sasl_ret_OK, and ZONE.
Referenced by sx_sasl_init().
|
static |
Definition at line 839 of file sasl.c.
References _sx_sasl_st::appname, _sx_sasl_st::ext_id, _sx_sasl_st::gsasl_ctx, _sx_plugin_st::private, and SX_CONN_EXTERNAL_ID_MAX_COUNT.
Referenced by sx_sasl_init().
int sx_sasl_init | ( | sx_env_t | env, |
sx_plugin_t | p, | ||
va_list | args | ||
) |
args: appname, callback, cb arg
init function
Definition at line 855 of file sasl.c.
References _sx_debug, _sx_sasl_features(), _sx_sasl_free(), _sx_sasl_gsasl_callback(), _sx_sasl_process(), _sx_sasl_rio(), _sx_sasl_stream(), _sx_sasl_unload(), _sx_sasl_wio(), _sx_sasl_st::appname, _sx_sasl_st::cb, _sx_sasl_st::cbarg, _sx_sasl_st::ext_id, _sx_plugin_st::features, _sx_plugin_st::free, _sx_sasl_st::gsasl_ctx, _sx_plugin_st::private, _sx_plugin_st::process, _sx_plugin_st::rio, _sx_plugin_st::stream, SX_CONN_EXTERNAL_ID_MAX_COUNT, _sx_plugin_st::unload, _sx_plugin_st::wio, and ZONE.
Referenced by JABBER_MAIN().
int sx_sasl_auth | ( | sx_plugin_t | p, |
sx_t | s, | ||
const char * | appname, | ||
const char * | mech, | ||
const char * | user, | ||
const char * | pass | ||
) |
kick off the auth handshake
trigger for client auth
Definition at line 908 of file sasl.c.
References _sx_debug, _sx_sasl_st::gsasl_ctx, _sx_plugin_st::index, nad_add_namespace(), nad_append_attr(), nad_append_cdata(), nad_append_elem(), nad_new(), _sx_st::plugin_data, _sx_plugin_st::private, _sx_st::state, state_STREAM, sx_nad_write, _sx_st::type, type_CLIENT, uri_SASL, and ZONE.
Referenced by c2s_router_sx_callback(), s2s_router_sx_callback(), and sm_sx_callback().