Tor  0.4.3.0-alpha-dev
Data Structures | Macros | Enumerations | Functions
hs_ident.h File Reference

Header file containing circuit and connection identifier data for the whole HS subsytem. More...

#include "lib/crypt_ops/crypto_ed25519.h"
#include "feature/hs/hs_common.h"

Go to the source code of this file.

Data Structures

struct  hs_ident_circuit_t
 
struct  hs_ident_dir_conn_t
 
struct  hs_ident_edge_conn_t
 

Macros

#define HS_REND_COOKIE_LEN   DIGEST_LEN
 
#define hs_ident_circuit_free(id)   FREE_AND_NULL(hs_ident_circuit_t, hs_ident_circuit_free_, (id))
 
#define hs_ident_dir_conn_free(id)   FREE_AND_NULL(hs_ident_dir_conn_t, hs_ident_dir_conn_free_, (id))
 
#define hs_ident_edge_conn_free(id)   FREE_AND_NULL(hs_ident_edge_conn_t, hs_ident_edge_conn_free_, (id))
 

Enumerations

enum  hs_ident_circuit_type_t { HS_IDENT_CIRCUIT_INTRO = 1, HS_IDENT_CIRCUIT_RENDEZVOUS = 2 }
 

Functions

hs_ident_circuit_ths_ident_circuit_new (const ed25519_public_key_t *identity_pk)
 
void hs_ident_circuit_free_ (hs_ident_circuit_t *ident)
 
hs_ident_circuit_ths_ident_circuit_dup (const hs_ident_circuit_t *src)
 
hs_ident_dir_conn_ths_ident_dir_conn_dup (const hs_ident_dir_conn_t *src)
 
void hs_ident_dir_conn_free_ (hs_ident_dir_conn_t *ident)
 
void hs_ident_dir_conn_init (const ed25519_public_key_t *identity_pk, const ed25519_public_key_t *blinded_pk, hs_ident_dir_conn_t *ident)
 
hs_ident_edge_conn_ths_ident_edge_conn_new (const ed25519_public_key_t *identity_pk)
 
void hs_ident_edge_conn_free_ (hs_ident_edge_conn_t *ident)
 
int hs_ident_intro_circ_is_valid (const hs_ident_circuit_t *ident)
 

Detailed Description

Header file containing circuit and connection identifier data for the whole HS subsytem.

This interface is used to uniquely identify a hidden service on a circuit or connection using the service identity public key. Once the circuit or connection subsystem calls in the hidden service one, we use those identifiers to lookup the corresponding objects like service, intro point and descriptor.

Furthermore, the circuit identifier holds cryptographic material needed for the e2e encryption on the rendezvous circuit which is set once the rendezvous circuit has opened and ready to be used.

Definition in file hs_ident.h.

Macro Definition Documentation

◆ HS_REND_COOKIE_LEN

#define HS_REND_COOKIE_LEN   DIGEST_LEN

Length of the rendezvous cookie that is used to connect circuits at the rendezvous point.

Definition at line 30 of file hs_ident.h.

Enumeration Type Documentation

◆ hs_ident_circuit_type_t

Type of circuit an hs_ident_t object is associated with.

Definition at line 33 of file hs_ident.h.

Function Documentation

◆ hs_ident_circuit_dup()

hs_ident_circuit_t* hs_ident_circuit_dup ( const hs_ident_circuit_t src)

For a given circuit identifier src, return a newly allocated copy of it. This can't fail.

Definition at line 37 of file hs_ident.c.

◆ hs_ident_circuit_free_()

void hs_ident_circuit_free_ ( hs_ident_circuit_t ident)

Free the given circuit identifier.

Definition at line 25 of file hs_ident.c.

◆ hs_ident_circuit_new()

hs_ident_circuit_t* hs_ident_circuit_new ( const ed25519_public_key_t identity_pk)

Return a newly allocated circuit identifier. The given public key is copied identity_pk into the identifier.

Definition at line 16 of file hs_ident.c.

Referenced by create_intro_circuit_identifier(), and create_rp_circuit_identifier().

◆ hs_ident_dir_conn_dup()

hs_ident_dir_conn_t* hs_ident_dir_conn_dup ( const hs_ident_dir_conn_t src)

For a given directory connection identifier src, return a newly allocated copy of it. This can't fail.

Definition at line 47 of file hs_ident.c.

◆ hs_ident_dir_conn_free_()

void hs_ident_dir_conn_free_ ( hs_ident_dir_conn_t ident)

Free the given directory connection identifier.

Definition at line 56 of file hs_ident.c.

◆ hs_ident_dir_conn_init()

void hs_ident_dir_conn_init ( const ed25519_public_key_t identity_pk,
const ed25519_public_key_t blinded_pk,
hs_ident_dir_conn_t ident 
)

Initialized the allocated ident object with identity_pk and blinded_pk. None of them can be NULL since a valid directory connection identifier must have all fields set.

Definition at line 69 of file hs_ident.c.

Referenced by directory_launch_v3_desc_fetch(), and hs_service_upload_desc_to_dir().

◆ hs_ident_edge_conn_free_()

void hs_ident_edge_conn_free_ ( hs_ident_edge_conn_t ident)

Free the given edge connection identifier.

Definition at line 93 of file hs_ident.c.

◆ hs_ident_edge_conn_new()

hs_ident_edge_conn_t* hs_ident_edge_conn_new ( const ed25519_public_key_t identity_pk)

Return a newly allocated edge connection identifier. The given public key identity_pk is copied into the identifier.

Definition at line 84 of file hs_ident.c.

◆ hs_ident_intro_circ_is_valid()

int hs_ident_intro_circ_is_valid ( const hs_ident_circuit_t ident)

Return true if the given ident is valid for an introduction circuit.

Definition at line 104 of file hs_ident.c.