tor  0.4.1.0-alpha-dev
Functions
rendclient.h File Reference
#include "feature/rend/rendcache.h"

Go to the source code of this file.

Functions

void rend_client_purge_state (void)
 
void rend_client_introcirc_has_opened (origin_circuit_t *circ)
 
void rend_client_rendcirc_has_opened (origin_circuit_t *circ)
 
int rend_client_introduction_acked (origin_circuit_t *circ, const uint8_t *request, size_t request_len)
 
void rend_client_refetch_v2_renddesc (rend_data_t *rend_query)
 
int rend_client_fetch_v2_desc (rend_data_t *query, smartlist_t *hsdirs)
 
void rend_client_cancel_descriptor_fetches (void)
 
int rend_client_report_intro_point_failure (extend_info_t *failed_intro, rend_data_t *rend_data, unsigned int failure_type)
 
int rend_client_receive_rendezvous (origin_circuit_t *circ, const uint8_t *request, size_t request_len)
 
void rend_client_desc_trynow (const char *query)
 
void rend_client_note_connection_attempt_ended (const rend_data_t *rend_data)
 
extend_info_trend_client_get_random_intro (const rend_data_t *rend_query)
 
int rend_client_any_intro_points_usable (const rend_cache_entry_t *entry)
 
int rend_client_send_introduction (origin_circuit_t *introcirc, origin_circuit_t *rendcirc)
 
int rend_parse_service_authorization (const or_options_t *options, int validate_only)
 
rend_service_authorization_trend_client_lookup_service_authorization (const char *onion_address)
 
void rend_service_authorization_free_all (void)
 

Detailed Description

Header file for rendclient.c.

Definition in file rendclient.h.

Function Documentation

◆ rend_client_any_intro_points_usable()

int rend_client_any_intro_points_usable ( const rend_cache_entry_t entry)

Return true iff any introduction points still listed in entry are usable.

Definition at line 1098 of file rendclient.c.

References rend_client_get_random_intro_impl().

◆ rend_client_cancel_descriptor_fetches()

void rend_client_cancel_descriptor_fetches ( void  )

Cancel all rendezvous descriptor fetches currently in progress.

Definition at line 729 of file rendclient.c.

References CONN_TYPE_DIR, connection_array, DIR_PURPOSE_FETCH_RENDDESC_V2, SMARTLIST_FOREACH_BEGIN, and TO_DIR_CONN().

Referenced by rend_client_purge_state().

◆ rend_client_desc_trynow()

void rend_client_desc_trynow ( const char *  query)

Find all the apconns in state AP_CONN_STATE_RENDDESC_WAIT that are waiting on query. If there's a working cache entry here with at least one intro point, move them to the next state.

Definition at line 903 of file rendclient.c.

References AP_CONN_STATE_RENDDESC_WAIT, CONN_TYPE_AP, and SMARTLIST_FOREACH_BEGIN.

◆ rend_client_fetch_v2_desc()

int rend_client_fetch_v2_desc ( rend_data_t query,
smartlist_t hsdirs 
)

Fetch a v2 descriptor using the given query. If any hsdir are specified, use them for the fetch.

On success, 1 is returned. If no hidden service is left to ask, return 0. On error, -1 is returned.

Definition at line 663 of file rendclient.c.

References tor_assert().

◆ rend_client_get_random_intro()

extend_info_t* rend_client_get_random_intro ( const rend_data_t rend_query)

Return a newly allocated extend_info_t* for a randomly chosen introduction point for the named hidden service. Return NULL if all introduction points have been tried and failed.

Definition at line 997 of file rendclient.c.

◆ rend_client_introcirc_has_opened()

void rend_client_introcirc_has_opened ( origin_circuit_t circ)

Called when we've established a circuit to an introduction point: send the introduction request.

Definition at line 67 of file rendclient.c.

References CIRCUIT_PURPOSE_C_INTRODUCING, origin_circuit_t::cpath, circuit_t::purpose, and tor_assert().

◆ rend_client_introduction_acked()

int rend_client_introduction_acked ( origin_circuit_t circ,
const uint8_t *  request,
size_t  request_len 
)

Called when get an ACK or a NAK for a REND_INTRODUCE1 cell.

Definition at line 376 of file rendclient.c.

References origin_circuit_t::build_state, cpath_build_state_t::chosen_exit, and tor_assert().

◆ rend_client_lookup_service_authorization()

rend_service_authorization_t* rend_client_lookup_service_authorization ( const char *  onion_address)

Look up the client-side authorization for the hidden service with onion_address. Return NULL if no authorization is available for that address.

Definition at line 1117 of file rendclient.c.

References auth_hid_servs, and tor_assert().

◆ rend_client_note_connection_attempt_ended()

void rend_client_note_connection_attempt_ended ( const rend_data_t rend_data)

Clear temporary state used only during an attempt to connect to the hidden service with rend_data. Called when a connection attempt has ended; it is possible for this to be called multiple times while handling an ended connection attempt, and any future changes to this function must ensure it remains idempotent.

Definition at line 955 of file rendclient.c.

Referenced by MOCK_IMPL().

◆ rend_client_purge_state()

void rend_client_purge_state ( void  )

Purge all potentially remotely-detectable state held in the hidden service client code. Called on SIGNAL NEWNYM.

Definition at line 56 of file rendclient.c.

References hs_purge_last_hid_serv_requests(), rend_cache_failure_purge(), rend_cache_purge(), and rend_client_cancel_descriptor_fetches().

◆ rend_client_receive_rendezvous()

int rend_client_receive_rendezvous ( origin_circuit_t circ,
const uint8_t *  request,
size_t  request_len 
)

The service sent us a rendezvous cell; join the circuits.

Definition at line 879 of file rendclient.c.

References DH1024_KEY_LEN, and DIGEST_LEN.

◆ rend_client_refetch_v2_renddesc()

void rend_client_refetch_v2_renddesc ( rend_data_t rend_query)

Unless we already have a descriptor for rend_query with at least one (possibly) working introduction point in it, start a connection to a hidden service directory to fetch a v2 rendezvous service descriptor.

Definition at line 697 of file rendclient.c.

◆ rend_client_rendcirc_has_opened()

void rend_client_rendcirc_has_opened ( origin_circuit_t circ)

Called when a rendezvous circuit is open; sends a establish rendezvous circuit as appropriate.

Definition at line 337 of file rendclient.c.

References CIRCUIT_PURPOSE_C_ESTABLISH_REND, circuit_t::purpose, and tor_assert().

◆ rend_client_report_intro_point_failure()

int rend_client_report_intro_point_failure ( extend_info_t failed_intro,
rend_data_t rend_data,
unsigned int  failure_type 
)

Mark failed_intro as a failed introduction point for the hidden service specified by rend_query. If the HS now has no usable intro points, or we do not have an HS descriptor for it, then launch a new renddesc fetch.

If failure_type is INTRO_POINT_FAILURE_GENERIC, remove the intro point from (our parsed copy of) the HS descriptor.

If failure_type is INTRO_POINT_FAILURE_TIMEOUT, mark the intro point as 'timed out'; it will not be retried until the current hidden service connection attempt has ended or it has appeared in a newly fetched rendezvous descriptor.

If failure_type is INTRO_POINT_FAILURE_UNREACHABLE, increment the intro point's reachability-failure count; if it has now failed MAX_INTRO_POINT_REACHABILITY_FAILURES or more times, remove the intro point from (our parsed copy of) the HS descriptor.

Return -1 if error, 0 if no usable intro points remain or service unrecognized, 1 if recognized and some intro points remain.

Definition at line 782 of file rendclient.c.

◆ rend_client_send_introduction()

int rend_client_send_introduction ( origin_circuit_t introcirc,
origin_circuit_t rendcirc 
)

Called when we're trying to connect an ap conn; sends an INTRODUCE1 cell down introcirc if possible.

Definition at line 112 of file rendclient.c.

References RELAY_PAYLOAD_SIZE.

◆ rend_parse_service_authorization()

int rend_parse_service_authorization ( const or_options_t options,
int  validate_only 
)

Parse config_line as a client-side authorization for a hidden service and add it to the local map of hidden service authorizations. Return 0 for success and -1 for failure.

Definition at line 1158 of file rendclient.c.

References or_options_t::HidServAuth, smartlist_clear(), SMARTLIST_FOREACH, smartlist_split_string(), and tor_free.

◆ rend_service_authorization_free_all()

void rend_service_authorization_free_all ( void  )

Release all the storage held in auth_hid_servs.

Definition at line 1145 of file rendclient.c.

References auth_hid_servs.