Strophe: auth.c File Reference

Strophe 0.12 XMPP client library

Data Structures | Macros | 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. More...
#define | BIND_TIMEOUT 15000 /* 15 seconds */
| Time to wait for <bind/> stanza reply. More...
#define | SESSION_TIMEOUT 15000 /* 15 seconds */
| Time to wait for <session/> stanza reply. More...
#define | LEGACY_TIMEOUT 15000 /* 15 seconds */
| Time to wait for legacy authentication to complete. More...
#define | HANDSHAKE_TIMEOUT 15000 /* 15 seconds */
| Time to wait for component authentication to complete. More...

## Functions
static void | _auth (xmpp_conn_t *conn)
static void | _auth_legacy (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_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 char * | _make_scram_init_msg (xmpp_conn_t *conn)
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 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 | _auth_success (xmpp_conn_t *conn)
void | auth_handle_open (xmpp_conn_t *conn)
| Set up handlers at stream start. More...
static int | _do_bind (xmpp_conn_t *conn, xmpp_stanza_t *bind)
static int | _handle_missing_legacy (xmpp_conn_t *conn, void *userdata)
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.

## Function Documentation

## ◆ _auth()

static void _auth | ( | xmpp_conn_t * | conn | ) |
| static

## ◆ _auth_legacy()

static void _auth_legacy | ( | 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_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 char * _make_scram_init_msg | ( | xmpp_conn_t * | conn | ) |
| 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

## ◆ _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

## ◆ _auth_success()

static void _auth_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

  conn | a Strophe connection object

## ◆ _do_bind()

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

## ◆ _handle_missing_legacy()

static int _handle_missing_legacy | ( | xmpp_conn_t * | conn,
|  | void * | userdata
| ) |  |
| 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 | ) |