Strophe 0.13
XMPP client library
Data Structures | Macros | Typedefs | Functions
auth.c File Reference

Authentication function and handlers. More...

Data Structures

struct  scram_user_data
 

Macros

#define FEATURES_TIMEOUT   15000 /* 15 seconds */
 Time to wait for <stream:features/> stanza.
 
#define BIND_TIMEOUT   15000 /* 15 seconds */
 Time to wait for <bind/> stanza reply.
 
#define SESSION_TIMEOUT   15000 /* 15 seconds */
 Time to wait for <session/> stanza reply.
 
#define LEGACY_TIMEOUT   15000 /* 15 seconds */
 Time to wait for legacy authentication to complete.
 
#define HANDSHAKE_TIMEOUT   15000 /* 15 seconds */
 Time to wait for component authentication to complete.
 

Typedefs

typedef void(* text_handler) (xmpp_conn_t *conn, const char *text)
 

Functions

static void _auth (xmpp_conn_t *conn)
 
static void _auth_legacy (xmpp_conn_t *conn)
 
static void _handle_open_compress (xmpp_conn_t *conn)
 
static void _handle_open_sasl (xmpp_conn_t *conn)
 
static void _handle_open_tls (xmpp_conn_t *conn)
 
static int _handle_component_auth (xmpp_conn_t *conn)
 
static int _handle_component_hs_response (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static int _handle_features_sasl (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static int _handle_features_compress (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static int _handle_sasl_result (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static int _handle_digestmd5_challenge (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static int _handle_digestmd5_rspauth (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static int _handle_scram_challenge (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static int _make_scram_init_msg (struct scram_user_data *scram)
 
static int _handle_missing_features_sasl (xmpp_conn_t *conn, void *userdata)
 
static int _handle_missing_bind (xmpp_conn_t *conn, void *userdata)
 
static int _handle_bind (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static int _handle_session (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static int _handle_missing_session (xmpp_conn_t *conn, void *userdata)
 
static int _handle_missing_handshake (xmpp_conn_t *conn, void *userdata)
 
static int _handle_sm (xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata)
 
static int _handle_error (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static int _handle_missing_features (xmpp_conn_t *conn, void *userdata)
 
static void _foreach_child (xmpp_conn_t *conn, xmpp_stanza_t *parent, const char *name, text_handler hndl)
 
static void _handle_sasl_children (xmpp_conn_t *conn, const char *text)
 
static int _handle_features (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static char * _get_authid (xmpp_conn_t *conn)
 
static int _handle_proceedtls_default (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
static xmpp_stanza_t * _make_starttls (xmpp_conn_t *conn)
 
static xmpp_stanza_t * _make_sasl_auth (xmpp_conn_t *conn, const char *mechanism)
 
static void _stream_negotiation_success (xmpp_conn_t *conn)
 
void auth_handle_open (xmpp_conn_t *conn)
 Set up handlers at stream start.
 
static int _do_bind (xmpp_conn_t *conn, xmpp_stanza_t *bind)
 
static int _handle_compress_result (xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata)
 
static int _handle_missing_legacy (xmpp_conn_t *conn, void *userdata)
 
static int _get_h_attribute (xmpp_stanza_t *stanza, unsigned long *ul_h)
 
static void _sm_queue_cleanup (xmpp_conn_t *conn, unsigned long ul_h)
 
static void _sm_queue_resend (xmpp_conn_t *conn)
 
static int _handle_legacy (xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata)
 
void auth_handle_component_open (xmpp_conn_t *conn)
 
void auth_handle_open_raw (xmpp_conn_t *conn)
 
void auth_handle_open_stub (xmpp_conn_t *conn)
 

Detailed Description

Authentication function and handlers.

Macro Definition Documentation

◆ FEATURES_TIMEOUT

#define FEATURES_TIMEOUT   15000 /* 15 seconds */

Time to wait for <stream:features/> stanza.

◆ BIND_TIMEOUT

#define BIND_TIMEOUT   15000 /* 15 seconds */

Time to wait for <bind/> stanza reply.

◆ SESSION_TIMEOUT

#define SESSION_TIMEOUT   15000 /* 15 seconds */

Time to wait for <session/> stanza reply.

◆ LEGACY_TIMEOUT

#define LEGACY_TIMEOUT   15000 /* 15 seconds */

Time to wait for legacy authentication to complete.

◆ HANDSHAKE_TIMEOUT

#define HANDSHAKE_TIMEOUT   15000 /* 15 seconds */

Time to wait for component authentication to complete.

Typedef Documentation

◆ text_handler

typedef void(* text_handler) (xmpp_conn_t *conn, const char *text)

Function Documentation

◆ _auth()

static void _auth ( xmpp_conn_t *  conn)
static

◆ _auth_legacy()

static void _auth_legacy ( xmpp_conn_t *  conn)
static

◆ _handle_open_compress()

static void _handle_open_compress ( xmpp_conn_t *  conn)
static

◆ _handle_open_sasl()

static void _handle_open_sasl ( xmpp_conn_t *  conn)
static

◆ _handle_open_tls()

static void _handle_open_tls ( xmpp_conn_t *  conn)
static

◆ _handle_component_auth()

int _handle_component_auth ( xmpp_conn_t *  conn)
static

◆ _handle_component_hs_response()

int _handle_component_hs_response ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _handle_features_sasl()

static int _handle_features_sasl ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _handle_features_compress()

static int _handle_features_compress ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _handle_sasl_result()

static int _handle_sasl_result ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _handle_digestmd5_challenge()

static int _handle_digestmd5_challenge ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _handle_digestmd5_rspauth()

static int _handle_digestmd5_rspauth ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _handle_scram_challenge()

static int _handle_scram_challenge ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _make_scram_init_msg()

static int _make_scram_init_msg ( struct scram_user_data scram)
static

◆ _handle_missing_features_sasl()

static int _handle_missing_features_sasl ( xmpp_conn_t *  conn,
void *  userdata 
)
static

◆ _handle_missing_bind()

static int _handle_missing_bind ( xmpp_conn_t *  conn,
void *  userdata 
)
static

◆ _handle_bind()

static int _handle_bind ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _handle_session()

static int _handle_session ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _handle_missing_session()

static int _handle_missing_session ( xmpp_conn_t *  conn,
void *  userdata 
)
static

◆ _handle_missing_handshake()

int _handle_missing_handshake ( xmpp_conn_t *  conn,
void *  userdata 
)
static

◆ _handle_sm()

static int _handle_sm ( xmpp_conn_t *const  conn,
xmpp_stanza_t *const  stanza,
void *const  userdata 
)
static

◆ _handle_error()

static int _handle_error ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _handle_missing_features()

static int _handle_missing_features ( xmpp_conn_t *  conn,
void *  userdata 
)
static

◆ _foreach_child()

static void _foreach_child ( xmpp_conn_t *  conn,
xmpp_stanza_t *  parent,
const char *  name,
text_handler  hndl 
)
static

◆ _handle_sasl_children()

static void _handle_sasl_children ( xmpp_conn_t *  conn,
const char *  text 
)
static

◆ _handle_features()

static int _handle_features ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _get_authid()

static char * _get_authid ( xmpp_conn_t *  conn)
static

◆ _handle_proceedtls_default()

static int _handle_proceedtls_default ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ _make_starttls()

static xmpp_stanza_t * _make_starttls ( xmpp_conn_t *  conn)
static

◆ _make_sasl_auth()

static xmpp_stanza_t * _make_sasl_auth ( xmpp_conn_t *  conn,
const char *  mechanism 
)
static

◆ _stream_negotiation_success()

static void _stream_negotiation_success ( xmpp_conn_t *  conn)
static

◆ auth_handle_open()

void auth_handle_open ( xmpp_conn_t *  conn)

Set up handlers at stream start.

This function is called internally to Strophe for handling the opening of an XMPP stream. It's called by the parser when a stream is opened or reset, and adds the initial handlers for <stream:error/> and <stream:features/>. This function is not intended for use outside of Strophe.

Parameters
conna Strophe connection object

◆ _do_bind()

static int _do_bind ( xmpp_conn_t *  conn,
xmpp_stanza_t *  bind 
)
static

◆ _handle_compress_result()

static int _handle_compress_result ( xmpp_conn_t *const  conn,
xmpp_stanza_t *const  stanza,
void *const  userdata 
)
static

◆ _handle_missing_legacy()

static int _handle_missing_legacy ( xmpp_conn_t *  conn,
void *  userdata 
)
static

◆ _get_h_attribute()

static int _get_h_attribute ( xmpp_stanza_t *  stanza,
unsigned long *  ul_h 
)
static

◆ _sm_queue_cleanup()

static void _sm_queue_cleanup ( xmpp_conn_t *  conn,
unsigned long  ul_h 
)
static

◆ _sm_queue_resend()

static void _sm_queue_resend ( xmpp_conn_t *  conn)
static

◆ _handle_legacy()

static int _handle_legacy ( xmpp_conn_t *  conn,
xmpp_stanza_t *  stanza,
void *  userdata 
)
static

◆ auth_handle_component_open()

void auth_handle_component_open ( xmpp_conn_t *  conn)

◆ auth_handle_open_raw()

void auth_handle_open_raw ( xmpp_conn_t *  conn)

◆ auth_handle_open_stub()

void auth_handle_open_stub ( xmpp_conn_t *  conn)