Tor 0.4.9.8
Loading...
Searching...
No Matches
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)
 
#define tor_tls_context_impl_free(ctx)
 

Functions

int tor_errno_to_tls_error (int e)
 
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)
Value:
FREE_AND_NULL(tor_tls_context_impl_t, tor_tls_context_impl_free_, (ctx))

Definition at line 38 of file tortls_internal.h.

◆ tor_tls_impl_free

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

Definition at line 34 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 315 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 278 of file tortls.c.

Referenced by tor_tls_context_new().

◆ 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 240 of file tortls.c.

Referenced by tor_tls_context_init().

◆ 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 159 of file tortls_nss.c.

Referenced by tor_tls_context_init_one(), and tor_tls_context_new().

◆ tor_tls_impl_free_()

void tor_tls_impl_free_ ( tor_tls_impl_t * ssl)

Definition at line 486 of file tortls_nss.c.