aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/circuitbuild_relay.c
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2020-03-17 17:41:26 +1000
committerteor <teor@torproject.org>2020-04-09 11:00:04 +1000
commitbeee9ca608e860ee71446e4923bf4f673eb012e3 (patch)
tree3062eda04ad442e932f057fe9397811f353c017d /src/feature/relay/circuitbuild_relay.c
parentc9b674d5110278f98c48f7e36653141bd39416dd (diff)
downloadtor-beee9ca608e860ee71446e4923bf4f673eb012e3.tar.gz
tor-beee9ca608e860ee71446e4923bf4f673eb012e3.zip
relay: Improve the comments on onionskin_answer()
Part of 33633.
Diffstat (limited to 'src/feature/relay/circuitbuild_relay.c')
-rw-r--r--src/feature/relay/circuitbuild_relay.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/feature/relay/circuitbuild_relay.c b/src/feature/relay/circuitbuild_relay.c
index 9da89953fb..85a05a8651 100644
--- a/src/feature/relay/circuitbuild_relay.c
+++ b/src/feature/relay/circuitbuild_relay.c
@@ -193,8 +193,24 @@ circuit_extend(struct cell_t *cell, struct circuit_t *circ)
return 0;
}
-/** Given a response payload and keys, initialize, then send a created
- * cell back.
+/** On a relay, accept a create cell, initialise a circuit, and send a
+ * created cell back.
+ *
+ * Given:
+ * - a response payload consisting of:
+ * - the <b>created_cell</b> and
+ * - an optional <b>rend_circ_nonce</b>, and
+ * - <b>keys</b> of length <b>keys_len</b>, which must be
+ * CPATH_KEY_MATERIAL_LEN;
+ * then:
+ * - initialize the circuit <b>circ</b>'s cryptographic material,
+ * - set the circuit's state to open, and
+ * - send a created cell back on that circuit.
+ *
+ * If we haven't found our ORPorts reachable yet, and the channel meets the
+ * necessary conditions, mark the relevant ORPorts as reachable.
+ *
+ * Returns -1 if cell or circuit initialisation fails.
*/
int
onionskin_answer(struct or_circuit_t *circ,