Strophe 0.9 XMPP client library

Data Structures | Enumerations | Functions | Variables
tls_openssl.c File Reference

TLS implementation with OpenSSL. More...

## Data Structures
struct | tls_t

## Enumerations
enum | { TLS_SHUTDOWN_MAX_RETRIES = 10 , TLS_TIMEOUT_SEC = 0 , TLS_TIMEOUT_USEC = 100000 }

## Functions
static void | _tls_sock_wait (tls_t *tls, int error)
static void | _tls_set_error (tls_t *tls, int error)
static void | _tls_log_error (xmpp_ctx_t *ctx)
static void | _tls_dump_cert_info (tls_t *tls)
void | tls_initialize (void)
void | tls_shutdown (void)
int | tls_error (tls_t *tls)
int | convert_ASN1TIME (ASN1_TIME *ansi_time, char *buf, size_t len)
static void | _hex_encode (unsigned char *readbuf, void *writebuf, size_t len)
static void | _print_certificate (X509 *cert)
static struct _tlscert_t * | _x509_to_tlscert (xmpp_ctx_t *ctx, X509 *cert)
static int | verify_callback (int preverify_ok, X509_STORE_CTX *x509_ctx)
struct _tlscert_t * | tls_peer_cert (xmpp_conn_t *conn)
tls_t * | tls_new (xmpp_conn_t *conn)
void | tls_free (tls_t *tls)
int | tls_set_credentials (tls_t *tls, const char *cafilename)
int | tls_start (tls_t *tls)
int | tls_stop (tls_t *tls)
int | tls_is_recoverable (int error)
int | tls_pending (tls_t *tls)
int | tls_read (tls_t *tls, void *const buff, const size_t len)
int | tls_write (tls_t *tls, const void *const buff, const size_t len)
int | tls_clear_pending_write (tls_t *tls)

## Variables
static xmpp_ctx_t * | _xmppctx
xmpp_certfail_handler | _certfail_handler
static int | _cert_handled
static int | _last_cb_res

## Detailed Description

TLS implementation with OpenSSL.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
TLS_SHUTDOWN_MAX_RETRIES |
TLS_TIMEOUT_SEC |
TLS_TIMEOUT_USEC |

## Function Documentation

## ◆ _tls_sock_wait()

static void _tls_sock_wait | ( | tls_t * | tls,
|  | int | error )
| static

## ◆ _tls_set_error()

static void _tls_set_error | ( | tls_t * | tls,
|  | int | error )
| static

## ◆ _tls_log_error()

static void _tls_log_error | ( | xmpp_ctx_t * | ctx | ) |
| static

## ◆ _tls_dump_cert_info()

static void _tls_dump_cert_info | ( | tls_t * | tls | ) |
| static

## ◆ tls_initialize()

void tls_initialize | ( | void |  | ) |

## ◆ tls_shutdown()

void tls_shutdown | ( | void |  | ) |

## ◆ tls_error()

int tls_error | ( | tls_t * | tls | ) |

## ◆ convert_ASN1TIME()

int convert_ASN1TIME | ( | ASN1_TIME * | ansi_time,
|  | char * | buf,
|  | size_t | len )

## ◆ _hex_encode()

static void _hex_encode | ( | unsigned char * | readbuf,
|  | void * | writebuf,
|  | size_t | len )
| static

## ◆ _print_certificate()

static void _print_certificate | ( | X509 * | cert | ) |
| static

## ◆ _x509_to_tlscert()

static struct _tlscert_t * _x509_to_tlscert | ( | xmpp_ctx_t * | ctx,
|  | X509 * | cert )
| static

## ◆ verify_callback()

static int verify_callback | ( | int | preverify_ok,
|  | X509_STORE_CTX * | x509_ctx )
| static

## ◆ tls_peer_cert()

struct _tlscert_t * tls_peer_cert | ( | xmpp_conn_t * | conn | ) |

## ◆ tls_new()

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

## ◆ tls_free()

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

## ◆ tls_set_credentials()

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

## ◆ tls_start()

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

## ◆ tls_stop()

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

## ◆ tls_is_recoverable()

int tls_is_recoverable | ( | int | error | ) |

## ◆ tls_pending()

int tls_pending | ( | tls_t * | tls | ) |

## ◆ tls_read()

int tls_read | ( | tls_t * | tls,
|  | void *const | buff,
|  | const size_t | len )

## ◆ tls_write()

int tls_write | ( | tls_t * | tls,
|  | const void *const | buff,
|  | const size_t | len )

## ◆ tls_clear_pending_write()

int tls_clear_pending_write | ( | tls_t * | tls | ) |

## Variable Documentation

## ◆ _xmppctx

xmpp_ctx_t* _xmppctx
| static

## ◆ _certfail_handler

xmpp_certfail_handler _certfail_handler

## ◆ _cert_handled

int _cert_handled
| static

## ◆ _last_cb_res

int _last_cb_res
| static