Macros | Functions
tortls_internal.h File Reference

Declare internal functions for lib/tls. More...

#include "lib/tls/x509.h"

Go to the source code of this file.


#define tor_tls_impl_free(tls)    FREE_AND_NULL(tor_tls_impl_t, tor_tls_impl_free_, (tls))
#define tor_tls_context_impl_free(ctx)    FREE_AND_NULL(tor_tls_context_impl_t, tor_tls_context_impl_free_, (ctx))


int tor_errno_to_tls_error (int e)
void try_to_extract_certs_from_tls (int severity, tor_tls_t *tls, tor_x509_cert_impl_t **cert_out, tor_x509_cert_impl_t **id_cert_out)
tor_tls_context_ttor_tls_context_new (crypto_pk_t *identity, unsigned int key_lifetime, unsigned flags, int is_client)
int tor_tls_context_init_one (tor_tls_context_t **ppcontext, crypto_pk_t *identity, unsigned int key_lifetime, unsigned int flags, int is_client)
int tor_tls_context_init_certificates (tor_tls_context_t *result, crypto_pk_t *identity, unsigned key_lifetime, unsigned flags)
void tor_tls_impl_free_ (tor_tls_impl_t *ssl)
void tor_tls_context_impl_free_ (tor_tls_context_impl_t *)

Detailed Description

Declare internal functions for lib/tls.

Definition in file tortls_internal.h.

Macro Definition Documentation

◆ tor_tls_context_impl_free

#define tor_tls_context_impl_free (   ctx)     FREE_AND_NULL(tor_tls_context_impl_t, tor_tls_context_impl_free_, (ctx))

Definition at line 42 of file tortls_internal.h.

◆ tor_tls_impl_free

#define tor_tls_impl_free (   tls)     FREE_AND_NULL(tor_tls_impl_t, tor_tls_impl_free_, (tls))

Definition at line 38 of file tortls_internal.h.

Function Documentation

◆ tor_errno_to_tls_error()

int tor_errno_to_tls_error ( int  e)

Convert an errno (or a WSAerrno on windows) into a TOR_TLS_* error code.

Definition at line 53 of file tortls.c.

◆ tor_tls_context_impl_free_()

void tor_tls_context_impl_free_ ( tor_tls_context_impl_t *  ctx)

Definition at line 338 of file tortls_nss.c.

◆ tor_tls_context_init_certificates()

int tor_tls_context_init_certificates ( tor_tls_context_t result,
crypto_pk_t identity,
unsigned  key_lifetime,
unsigned  flags 

Initialize the certificates and keys for a TLS context result

Other arguments as for tor_tls_context_new().

Definition at line 292 of file tortls.c.

◆ tor_tls_context_init_one()

int tor_tls_context_init_one ( tor_tls_context_t **  ppcontext,
crypto_pk_t identity,
unsigned int  key_lifetime,
unsigned int  flags,
int  is_client 

Create a new global TLS context.

You can call this function multiple times. Each time you call it, it generates new certificates; all new connections will use the new SSL context.

Definition at line 254 of file tortls.c.

◆ tor_tls_context_new()

tor_tls_context_t * tor_tls_context_new ( crypto_pk_t identity,
unsigned int  key_lifetime,
unsigned  flags,
int  is_client 

Create a new TLS context for use with Tor TLS handshakes. identity should be set to the identity key used to sign the certificate.

Definition at line 182 of file tortls_nss.c.

Referenced by tor_tls_context_init_one().

◆ tor_tls_impl_free_()

void tor_tls_impl_free_ ( tor_tls_impl_t *  ssl)

Definition at line 521 of file tortls_nss.c.

◆ try_to_extract_certs_from_tls()

void try_to_extract_certs_from_tls ( int  severity,
tor_tls_t tls,
tor_x509_cert_impl_t **  cert_out,
tor_x509_cert_impl_t **  id_cert_out 

Definition at line 52 of file tortls_nss.c.