Strophe 0.13 XMPP client library

Data Structures | Macros | Functions
tls_gnutls.c File Reference

TLS implementation with GNUTLS. More...

## Data Structures
struct | tls_t

## Macros
#define | GNUTLS_CB_TLS_EXPORTER 3

## Functions
void | tls_initialize (void)
void | tls_shutdown (void)
static int | _tls_password_callback (void *userdata, int attempt, const char *token_url, const char *token_label, unsigned int flags, char *pin, size_t pin_max)
static gnutls_x509_crt_t | _tls_load_cert_x509 (xmpp_conn_t *conn)
static gnutls_x509_crt_t | _tls_load_cert_p12 (xmpp_conn_t *conn)
static gnutls_x509_crt_t | _tls_load_cert (xmpp_conn_t *conn)
static void | _tls_free_cert (xmpp_conn_t *conn, gnutls_x509_crt_t cert)
static int | _tls_get_id_on_xmppaddr (xmpp_conn_t *conn, gnutls_x509_crt_t cert, unsigned int n, char **ret)
static int | _tls_id_on_xmppaddr (xmpp_conn_t *conn, gnutls_x509_crt_t cert, unsigned int n, char **ret)
char * | tls_id_on_xmppaddr (xmpp_conn_t *conn, unsigned int n)
| Search through the SubjectAlternativeNames and return the next id-on-xmppAddr element starting from `n`.
unsigned int | tls_id_on_xmppaddr_num (xmpp_conn_t *conn)
static xmpp_tlscert_t * | _x509_to_tlscert (xmpp_ctx_t *ctx, gnutls_x509_crt_t cert)
static int | _tls_verify (gnutls_session_t session)
tls_t * | tls_new (xmpp_conn_t *conn)
void | tls_free (tls_t *tls)
xmpp_tlscert_t * | tls_peer_cert (xmpp_conn_t *conn)
int | tls_set_credentials (tls_t *tls, const char *cafilename)
int | tls_init_channel_binding (tls_t *tls, const char **binding_prefix, size_t *binding_prefix_len)
const void * | tls_get_channel_binding_data (tls_t *tls, size_t *size)
int | tls_start (tls_t *tls)
int | tls_stop (tls_t *tls)
int | tls_error (struct conn_interface *intf)
int | tls_is_recoverable (struct conn_interface *intf, int error)
int | tls_pending (struct conn_interface *intf)
int | tls_read (struct conn_interface *intf, void *buff, size_t len)
int | tls_write (struct conn_interface *intf, const void *buff, size_t len)
int | tls_clear_pending_write (struct conn_interface *intf)

## Detailed Description

TLS implementation with GNUTLS.

## Macro Definition Documentation

## ◆ GNUTLS_CB_TLS_EXPORTER

#define GNUTLS_CB_TLS_EXPORTER 3

## Function Documentation

## ◆ tls_initialize()

void tls_initialize | ( | void |  | ) |

## ◆ tls_shutdown()

void tls_shutdown | ( | void |  | ) |

## ◆ _tls_password_callback()

static int _tls_password_callback | ( | void * | userdata,
|  | int | attempt,
|  | const char * | token_url,
|  | const char * | token_label,
|  | unsigned int | flags,
|  | char * | pin,
|  | size_t | pin_max )
| static

## ◆ _tls_load_cert_x509()

static gnutls_x509_crt_t _tls_load_cert_x509 | ( | xmpp_conn_t * | conn | ) |
| static

## ◆ _tls_load_cert_p12()

static gnutls_x509_crt_t _tls_load_cert_p12 | ( | xmpp_conn_t * | conn | ) |
| static

## ◆ _tls_load_cert()

static gnutls_x509_crt_t _tls_load_cert | ( | xmpp_conn_t * | conn | ) |
| static

## ◆ _tls_free_cert()

static void _tls_free_cert | ( | xmpp_conn_t * | conn,
|  | gnutls_x509_crt_t | cert )
| static

## ◆ _tls_get_id_on_xmppaddr()

static int _tls_get_id_on_xmppaddr | ( | xmpp_conn_t * | conn,
|  | gnutls_x509_crt_t | cert,
|  | unsigned int | n,
|  | char ** | ret )
| static

## ◆ _tls_id_on_xmppaddr()

static int _tls_id_on_xmppaddr | ( | xmpp_conn_t * | conn,
|  | gnutls_x509_crt_t | cert,
|  | unsigned int | n,
|  | char ** | ret )
| static

## ◆ tls_id_on_xmppaddr()

char * tls_id_on_xmppaddr | ( | xmpp_conn_t * | conn,
|  | unsigned int | n )

Search through the SubjectAlternativeNames and return the next id-on-xmppAddr element starting from `n`.

## ◆ tls_id_on_xmppaddr_num()

unsigned int tls_id_on_xmppaddr_num | ( | xmpp_conn_t * | conn | ) |

## ◆ _x509_to_tlscert()

static xmpp_tlscert_t * _x509_to_tlscert | ( | xmpp_ctx_t * | ctx,
|  | gnutls_x509_crt_t | cert )
| static

## ◆ _tls_verify()

static int _tls_verify | ( | gnutls_session_t | session | ) |
| static

## ◆ tls_new()

tls_t * tls_new | ( | xmpp_conn_t * | conn | ) |

## ◆ tls_free()

void tls_free | ( | tls_t * | tls | ) |

## ◆ tls_peer_cert()

xmpp_tlscert_t * tls_peer_cert | ( | xmpp_conn_t * | conn | ) |

## ◆ tls_set_credentials()

int tls_set_credentials | ( | tls_t * | tls,
|  | const char * | cafilename )

## ◆ tls_init_channel_binding()

int tls_init_channel_binding | ( | tls_t * | tls,
|  | const char ** | binding_prefix,
|  | size_t * | binding_prefix_len )

## ◆ tls_get_channel_binding_data()

const void * tls_get_channel_binding_data | ( | tls_t * | tls,
|  | size_t * | size )

## ◆ tls_start()

int tls_start | ( | tls_t * | tls | ) |

## ◆ tls_stop()

int tls_stop | ( | tls_t * | tls | ) |

## ◆ tls_error()

int tls_error | ( | struct conn_interface * | intf | ) |

## ◆ tls_is_recoverable()

int tls_is_recoverable | ( | struct conn_interface * | intf,
|  | int | error )

## ◆ tls_pending()

int tls_pending | ( | struct conn_interface * | intf | ) |

## ◆ tls_read()

int tls_read | ( | struct conn_interface * | intf,
|  | void * | buff,
|  | size_t | len )

## ◆ tls_write()

int tls_write | ( | struct conn_interface * | intf,
|  | const void * | buff,
|  | size_t | len )

## ◆ tls_clear_pending_write()

int tls_clear_pending_write | ( | struct conn_interface * | intf | ) |