summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-01-08 15:06:39 +0200
committerGeorge Kadianakis <desnacked@riseup.net>2017-01-08 15:21:13 +0200
commitab6a977b4d22ba76f7f219182a234f3a175d4eba (patch)
tree152da351bde32415193023d8092e600c96b6f2d3
parent794310d3a1cd5ec65e53d3657f5bdf2892d4d6f2 (diff)
Improve a few comments.ticket20029_030_05
- Also remove LCOV marks from blocks of code that can be reachable by tests if we mock relay_send_command_from_edge().
-rw-r--r--src/or/hs_intropoint.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/or/hs_intropoint.c b/src/or/hs_intropoint.c
index a82e0bc96..4a52a8bbb 100644
--- a/src/or/hs_intropoint.c
+++ b/src/or/hs_intropoint.c
@@ -27,8 +27,8 @@
#include "hs_intropoint.h"
#include "hs_common.h"
-/** Extract the authentication key from an ESTABLISH_INTRO <b>cell</b> and
- * place it in <b>auth_key_out</b>. */
+/** Extract the authentication key from an ESTABLISH_INTRO or INTRODUCE1
+ * <b>cell</b> and place it in <b>auth_key_out</b>. */
STATIC void
get_auth_key_from_cell(ed25519_public_key_t *auth_key_out,
unsigned int cell_type, const void *cell)
@@ -283,7 +283,7 @@ circuit_is_suitable_intro_point(const or_circuit_t *circ,
return 1;
}
-/* Return True if circuit is suitable for becoming an intro circuit. */
+/* Return True if circuit is suitable for being service-side intro circuit. */
int
hs_intro_circuit_is_suitable_for_establish_intro(const or_circuit_t *circ)
{
@@ -444,7 +444,7 @@ handle_introduce1(or_circuit_t *client_circ, const uint8_t *request,
goto send_ack;
}
- /* Once parsed, validate the cell expected format once parsed. */
+ /* Once parsed validate the cell format. */
if (validate_introduce1_parsed_cell(parsed_cell) < 0) {
/* Inform client that the INTRODUCE1 has bad format. */
status = HS_INTRO_ACK_STATUS_BAD_FORMAT;
@@ -474,12 +474,10 @@ handle_introduce1(or_circuit_t *client_circ, const uint8_t *request,
if (relay_send_command_from_edge(CONTROL_CELL_ID, TO_CIRCUIT(service_circ),
RELAY_COMMAND_INTRODUCE2,
(char *) request, request_len, NULL)) {
- /* LCOV_EXCL_START */
log_warn(LD_REND, "Unable to send INTRODUCE2 cell to the service.");
/* Inform the client that we can't relay the cell. */
status = HS_INTRO_ACK_STATUS_CANT_RELAY;
goto send_ack;
- /* LCOV_EXCL_STOP */
}
/* Success! Send an INTRODUCE_ACK success status onto the client circuit. */
@@ -487,14 +485,12 @@ handle_introduce1(or_circuit_t *client_circ, const uint8_t *request,
ret = 0;
send_ack:
- /* Send the INTRODUCE_ACK cell to the client with a specific status. */
+ /* Send INTRODUCE_ACK or INTRODUCE_NACK to client */
if (send_introduce_ack_cell(client_circ, status) < 0) {
- /* LCOV_EXCL_START */
log_warn(LD_REND, "Unable to send an INTRODUCE ACK status %d to client.",
status);
/* Circuit has been closed on failure of transmission. */
goto done;
- /* LCOV_EXCL_STOP */
}
if (status != HS_INTRO_ACK_STATUS_SUCCESS) {
/* We just sent a NACK that is a non success status code so close the
@@ -530,7 +526,7 @@ circuit_is_suitable_for_introduce1(const or_circuit_t *circ)
{
tor_assert(circ);
- /* First of all, do we have a valid circuit to be an introduction point? */
+ /* Is this circuit an intro point circuit? */
if (!circuit_is_suitable_intro_point(circ, "INTRODUCE1")) {
return 0;
}