]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
relay: Improve the comments on onionskin_answer()
authorteor <teor@torproject.org>
Tue, 17 Mar 2020 07:41:26 +0000 (17:41 +1000)
committerteor <teor@torproject.org>
Thu, 9 Apr 2020 01:00:04 +0000 (11:00 +1000)
Part of 33633.

src/feature/relay/circuitbuild_relay.c

index 9da89953fbbdbf81486e451b97a99ff13866e07c..85a05a86517e93abcd399e46b1172622876469d8 100644 (file)
@@ -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,