16#include "core/or/dos.h"
24#include "core/or/or_circuit_st.h"
34 int reason = END_CIRC_REASON_TORPROTOCOL;
36 log_info(
LD_REND,
"Received an ESTABLISH_RENDEZVOUS request on circuit %u",
40 relay_increment_est_rend_action(EST_REND_UNSUITABLE_CIRCUIT);
42 "Tried to establish rendezvous on non-OR circuit with purpose %s",
50 dos_should_refuse_single_hop_client()) {
51 relay_increment_est_rend_action(EST_REND_SINGLE_HOP);
53 dos_note_refuse_single_hop_client();
59 relay_increment_est_rend_action(EST_REND_UNSUITABLE_CIRCUIT);
61 "Tried to establish rendezvous on non-edge circuit");
66 relay_increment_est_rend_action(EST_REND_MALFORMED);
68 LD_PROTOCOL,
"Invalid length on ESTABLISH_RENDEZVOUS.");
73 relay_increment_est_rend_action(EST_REND_DUPLICATE_COOKIE);
75 "Duplicate rendezvous cookie in ESTABLISH_RENDEZVOUS.");
80 if (relay_send_command_from_edge(0,
TO_CIRCUIT(circ),
81 RELAY_COMMAND_RENDEZVOUS_ESTABLISHED,
83 relay_increment_est_rend_action(EST_REND_CIRCUIT_DEAD);
84 log_warn(
LD_PROTOCOL,
"Couldn't send RENDEZVOUS_ESTABLISHED cell.");
89 relay_increment_est_rend_action(EST_REND_SUCCESS);
96 "Established rendezvous point on circuit %u for cookie %s",
101 circuit_mark_for_close(
TO_CIRCUIT(circ), reason);
116 int reason = END_CIRC_REASON_INTERNAL;
119 relay_increment_rend1_action(REND1_UNSUITABLE_CIRCUIT);
121 "Tried to complete rendezvous on non-OR or non-edge circuit %u.",
123 reason = END_CIRC_REASON_TORPROTOCOL;
128 relay_increment_rend1_action(REND1_MALFORMED);
130 "Rejecting RENDEZVOUS1 cell with bad length (%d) on circuit %u.",
131 (
int)request_len, (
unsigned)circ->
p_circ_id);
132 reason = END_CIRC_REASON_TORPROTOCOL;
136 base16_encode(hexid,
sizeof(hexid), (
const char*)request, 4);
139 "Got request for rendezvous from circuit %u to cookie %s.",
148 relay_increment_rend1_action(REND1_UNKNOWN_COOKIE);
150 "Rejecting RENDEZVOUS1 cell with unrecognized rendezvous cookie %s.",
152 reason = END_CIRC_REASON_TORPROTOCOL;
165 if (relay_send_command_from_edge(0,
TO_CIRCUIT(rend_circ),
166 RELAY_COMMAND_RENDEZVOUS2,
169 relay_increment_rend1_action(REND1_CIRCUIT_DEAD);
171 "Unable to send RENDEZVOUS2 cell to client on circuit %u.",
177 relay_increment_rend1_action(REND1_SUCCESS);
180 "Completing rendezvous: circuit %u joins circuit %u (cookie %s)",
193 circuit_mark_for_close(
TO_CIRCUIT(circ), reason);
void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen)
int channel_is_client(const channel_t *chan)
Header file for channel.c.
const char * circuit_purpose_to_string(uint8_t purpose)
Header file for circuitlist.c.
#define CIRCUIT_PURPOSE_REND_POINT_WAITING
#define CIRCUIT_PURPOSE_OR
#define CIRCUIT_PURPOSE_REND_ESTABLISHED
void circuit_change_purpose(circuit_t *circ, uint8_t new_purpose)
Header file for circuituse.c.
const or_options_t * get_options(void)
Header file for config.c.
Headers for crypto_cipher.c.
void hs_circuitmap_remove_circuit(circuit_t *circ)
or_circuit_t * hs_circuitmap_get_rend_circ_relay_side(const uint8_t *cookie)
void hs_circuitmap_register_rend_circ_relay_side(or_circuit_t *circ, const uint8_t *cookie)
Header file for hs_circuitmap.c.
Header file containing denial of service defenses for the HS subsystem for all versions.
Header file for hs_intropoint.c.
#define log_fn(severity, domain, args,...)
Master header file for Tor-specific functionality.
Header for feature/relay/relay_metrics.c.
int rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request, size_t request_len)
int rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request, size_t request_len)
Header file for rendmid.c.
unsigned int circuit_carries_hs_traffic_stats
struct or_circuit_t * rend_splice
int HiddenServiceStatistics