Tor  0.4.7.0-alpha-dev
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.

Macros

#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))
 

Functions

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.

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_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().