16 #include "core/or/dos.h"
23 #include "core/or/or_circuit_st.h"
33 int reason = END_CIRC_REASON_TORPROTOCOL;
35 log_info(
LD_REND,
"Received an ESTABLISH_RENDEZVOUS request on circuit %u",
40 "Tried to establish rendezvous on non-OR circuit with purpose %s",
48 dos_should_refuse_single_hop_client()) {
50 dos_note_refuse_single_hop_client();
57 "Tried to establish rendezvous on non-edge circuit");
63 LD_PROTOCOL,
"Invalid length on ESTABLISH_RENDEZVOUS.");
69 "Duplicate rendezvous cookie in ESTABLISH_RENDEZVOUS.");
74 if (relay_send_command_from_edge(0,
TO_CIRCUIT(circ),
75 RELAY_COMMAND_RENDEZVOUS_ESTABLISHED,
77 log_warn(
LD_PROTOCOL,
"Couldn't send RENDEZVOUS_ESTABLISHED cell.");
88 "Established rendezvous point on circuit %u for cookie %s",
93 circuit_mark_for_close(
TO_CIRCUIT(circ), reason);
108 int reason = END_CIRC_REASON_INTERNAL;
112 "Tried to complete rendezvous on non-OR or non-edge circuit %u.",
114 reason = END_CIRC_REASON_TORPROTOCOL;
120 "Rejecting RENDEZVOUS1 cell with bad length (%d) on circuit %u.",
121 (
int)request_len, (
unsigned)circ->
p_circ_id);
122 reason = END_CIRC_REASON_TORPROTOCOL;
126 base16_encode(hexid,
sizeof(hexid), (
const char*)request, 4);
129 "Got request for rendezvous from circuit %u to cookie %s.",
135 "Rejecting RENDEZVOUS1 cell with unrecognized rendezvous cookie %s.",
137 reason = END_CIRC_REASON_TORPROTOCOL;
150 if (relay_send_command_from_edge(0,
TO_CIRCUIT(rend_circ),
151 RELAY_COMMAND_RENDEZVOUS2,
155 "Unable to send RENDEZVOUS2 cell to client on circuit %u.",
163 "Completing rendezvous: circuit %u joins circuit %u (cookie %s)",
176 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.
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