jabberd2
2.2.16
|
Go to the source code of this file.
Functions | |
static int | _sx_ssl_verify_callback (int preverify_ok, X509_STORE_CTX *ctx) |
this plugin implements the traditional SSL "wrappermode" streams and STARTTLS extension documented in xmpp-core | |
static void | _sx_ssl_starttls_notify_proceed (sx_t s, void *arg) |
static int | _sx_ssl_process (sx_t s, sx_plugin_t p, nad_t nad) |
static void | _sx_ssl_features (sx_t s, sx_plugin_t p, nad_t nad) |
static void | _sx_ssl_get_external_id (sx_t s, _sx_ssl_conn_t sc) |
static int | _sx_ssl_handshake (sx_t s, _sx_ssl_conn_t sc) |
static int | _sx_ssl_wio (sx_t s, sx_plugin_t p, sx_buf_t buf) |
static int | _sx_ssl_rio (sx_t s, sx_plugin_t p, sx_buf_t buf) |
static void | _sx_ssl_client (sx_t s, sx_plugin_t p) |
static void | _sx_ssl_server (sx_t s, sx_plugin_t p) |
static void | _sx_ssl_free (sx_t s, sx_plugin_t p) |
cleanup | |
static void | _sx_ssl_unload (sx_plugin_t p) |
int | sx_ssl_init (sx_env_t env, sx_plugin_t p, va_list args) |
args: name, pemfile, cachain, mode | |
int | sx_ssl_server_addcert (sx_plugin_t p, char *name, char *pemfile, char *cachain, int mode) |
args: name, pemfile, cachain, mode | |
int | sx_ssl_client_starttls (sx_plugin_t p, sx_t s, char *pemfile) |
Variables | |
int | sx_openssl_initialized = 0 |
static int _sx_ssl_verify_callback | ( | int | preverify_ok, |
X509_STORE_CTX * | ctx | ||
) | [static] |
this plugin implements the traditional SSL "wrappermode" streams and STARTTLS extension documented in xmpp-core
Definition at line 31 of file ssl.c.
References _sx_debug, and ZONE.
Referenced by sx_ssl_server_addcert().
static void _sx_ssl_starttls_notify_proceed | ( | sx_t | s, |
void * | arg | ||
) | [static] |
Definition at line 80 of file ssl.c.
References _sx_debug, ZONE, _sx_st::req_to, _sx_reset(), sx_server_init(), _sx_st::flags, and SX_SSL_WRAPPER.
Referenced by _sx_ssl_process().
static int _sx_ssl_process | ( | sx_t | s, |
sx_plugin_t | p, | ||
nad_t | nad | ||
) | [static] |
Definition at line 99 of file ssl.c.
References _sx_st::type, type_SERVER, _sx_st::flags, SX_SSL_STARTTLS_OFFER, NAD_ENS, NAD_NURI_L, uri_TLS, NAD_NURI, NAD_ENAME_L, NAD_ENAME, nad_free(), _sx_st::ssf, _sx_debug, ZONE, _sx_st::compressed, jqueue_push(), _sx_st::wbufq, _sx_buffer_new(), _sx_ssl_starttls_notify_proceed(), _sx_st::want_write, type_CLIENT, _sx_st::ns, _sx_st::req_to, _sx_st::req_from, _sx_st::req_version, _sx_reset(), sx_client_init(), SX_SSL_WRAPPER, _sx_st::plugin_data, _sx_plugin_st::index, _sx_gen_error, SX_ERR_STARTTLS_FAILURE, _sx_event, and event_ERROR.
Referenced by sx_ssl_init().
static void _sx_ssl_features | ( | sx_t | s, |
sx_plugin_t | p, | ||
nad_t | nad | ||
) | [static] |
Definition at line 197 of file ssl.c.
References _sx_st::state, state_STREAM, _sx_st::ssf, _sx_st::flags, SX_SSL_STARTTLS_OFFER, _sx_st::compressed, _sx_debug, ZONE, nad_add_namespace(), uri_TLS, nad_append_elem(), and SX_SSL_STARTTLS_REQUIRE.
Referenced by sx_ssl_init().
static void _sx_ssl_get_external_id | ( | sx_t | s, |
_sx_ssl_conn_t | sc | ||
) | [static] |
Definition at line 215 of file ssl.c.
References _sx_debug, ZONE, and SX_CONN_EXTERNAL_ID_MAX_COUNT.
Referenced by _sx_ssl_handshake().
static int _sx_ssl_handshake | ( | sx_t | s, |
_sx_ssl_conn_t | sc | ||
) | [static] |
Definition at line 322 of file ssl.c.
References _sx_debug, ZONE, _sx_st::type, type_CLIENT, _sx_st::ssf, _sx_ssl_get_external_id(), _sx_st::state, state_STREAM, _sx_st::flags, SX_SSL_WRAPPER, _sx_gen_error, SX_ERR_SSL, _sx_event, event_ERROR, sx_error(), stream_err_UNDEFINED_CONDITION, and sx_close().
Referenced by _sx_ssl_wio(), and _sx_ssl_rio().
static int _sx_ssl_wio | ( | sx_t | s, |
sx_plugin_t | p, | ||
sx_buf_t | buf | ||
) | [static] |
Definition at line 389 of file ssl.c.
References _sx_st::plugin_data, _sx_plugin_st::index, _sx_debug, ZONE, _sx_buf_st::len, jqueue_push(), _sx_buffer_new(), _sx_buf_st::data, _sx_buf_st::notify, _sx_buf_st::notify_arg, _sx_buffer_clear(), _sx_ssl_handshake(), jqueue_size(), jqueue_pull(), _sx_close(), _sx_st::state, state_STREAM, _sx_st::flags, SX_SSL_WRAPPER, _sx_gen_error, SX_ERR_SSL, _sx_event, event_ERROR, sx_error(), stream_err_UNDEFINED_CONDITION, sx_close(), _sx_buffer_alloc_margin(), _sx_buffer_free(), and _sx_st::want_read.
Referenced by sx_ssl_init().
static int _sx_ssl_rio | ( | sx_t | s, |
sx_plugin_t | p, | ||
sx_buf_t | buf | ||
) | [static] |
Definition at line 494 of file ssl.c.
References _sx_st::plugin_data, _sx_plugin_st::index, _sx_debug, ZONE, _sx_buf_st::len, _sx_buf_st::data, _sx_buffer_clear(), _sx_ssl_handshake(), _sx_buffer_alloc_margin(), _sx_close(), _sx_st::state, state_STREAM, _sx_st::flags, SX_SSL_WRAPPER, _sx_gen_error, SX_ERR_SSL, _sx_event, event_ERROR, sx_error(), stream_err_UNDEFINED_CONDITION, sx_close(), jqueue_size(), _sx_st::want_write, and _sx_st::want_read.
Referenced by sx_ssl_init().
static void _sx_ssl_client | ( | sx_t | s, |
sx_plugin_t | p | ||
) | [static] |
Definition at line 620 of file ssl.c.
References _sx_st::flags, SX_SSL_WRAPPER, _sx_st::ssf, _sx_debug, ZONE, _sx_st::tag, _sx_st::req_from, xhash_get(), _sx_plugin_st::private, SSL_OP_NO_TICKET, SX_CONN_EXTERNAL_ID_MAX_COUNT, _sx_st::plugin_data, _sx_plugin_st::index, jqueue_new(), and _sx_chain_io_plugin().
Referenced by sx_ssl_init().
static void _sx_ssl_server | ( | sx_t | s, |
sx_plugin_t | p | ||
) | [static] |
Definition at line 714 of file ssl.c.
References _sx_st::flags, SX_SSL_WRAPPER, _sx_st::ssf, _sx_debug, ZONE, _sx_st::tag, _sx_st::req_to, xhash_get(), _sx_plugin_st::private, SX_CONN_EXTERNAL_ID_MAX_COUNT, jqueue_new(), _sx_st::plugin_data, _sx_plugin_st::index, and _sx_chain_io_plugin().
Referenced by sx_ssl_init().
static void _sx_ssl_free | ( | sx_t | s, |
sx_plugin_t | p | ||
) | [static] |
cleanup
Definition at line 760 of file ssl.c.
References _sx_st::plugin_data, _sx_plugin_st::index, log_debug, ZONE, _sx_st::type, type_NONE, SX_CONN_EXTERNAL_ID_MAX_COUNT, jqueue_pull(), _sx_buffer_free(), and jqueue_free().
Referenced by sx_ssl_init().
static void _sx_ssl_unload | ( | sx_plugin_t | p | ) | [static] |
Definition at line 797 of file ssl.c.
References _sx_plugin_st::private, xhash_iter_first(), xhash_iter_get(), xhash_iter_next(), and xhash_free().
Referenced by sx_ssl_init().
int sx_ssl_init | ( | sx_env_t | env, |
sx_plugin_t | p, | ||
va_list | args | ||
) |
args: name, pemfile, cachain, mode
Definition at line 813 of file ssl.c.
References _sx_debug, ZONE, _sx_plugin_st::private, sx_openssl_initialized, sx_ssl_server_addcert(), _sx_plugin_st::magic, SX_SSL_MAGIC, _sx_plugin_st::unload, _sx_ssl_unload(), _sx_plugin_st::client, _sx_ssl_client(), _sx_plugin_st::server, _sx_ssl_server(), _sx_plugin_st::rio, _sx_ssl_rio(), _sx_plugin_st::wio, _sx_ssl_wio(), _sx_plugin_st::features, _sx_ssl_features(), _sx_plugin_st::process, _sx_ssl_process(), _sx_plugin_st::free, and _sx_ssl_free().
Referenced by _c2s_hosts_expand(), JABBER_MAIN(), and _s2s_hosts_expand().
int sx_ssl_server_addcert | ( | sx_plugin_t | p, |
char * | name, | ||
char * | pemfile, | ||
char * | cachain, | ||
int | mode | ||
) |
args: name, pemfile, cachain, mode
Definition at line 860 of file ssl.c.
References _sx_plugin_st::private, sx_openssl_initialized, _sx_debug, ZONE, _sx_ssl_verify_callback(), xhash_new(), xhash_free(), xhash_get(), and xhash_put().
Referenced by _c2s_hosts_expand(), _s2s_hosts_expand(), and sx_ssl_init().
int sx_ssl_client_starttls | ( | sx_plugin_t | p, |
sx_t | s, | ||
char * | pemfile | ||
) |
Definition at line 983 of file ssl.c.
References _sx_st::type, type_CLIENT, _sx_st::state, state_STREAM, _sx_debug, ZONE, _sx_st::ssf, _sx_st::compressed, _sx_st::plugin_data, _sx_plugin_st::index, jqueue_push(), _sx_st::wbufq, _sx_buffer_new(), uri_TLS, _sx_st::want_write, _sx_event, and event_WANT_WRITE.
Referenced by c2s_router_sx_callback(), sm_sx_callback(), s2s_router_sx_callback(), and _out_sx_callback().
int sx_openssl_initialized = 0 |
Definition at line 810 of file ssl.c.
Referenced by sx_ssl_init(), and sx_ssl_server_addcert().