#include "core/or/crypt_path_st.h"
#include "core/or/extend_info_st.h"
-/* TODO: Add this to the specification! */
+/* TODO-324: Add this to the specification! */
const uint8_t NTOR3_CIRC_VERIFICATION[] = "circuit extend";
const size_t NTOR3_CIRC_VERIFICATION_LEN = 14;
circuit_params_t *params_out)
{
int r = -1;
- memset(params_out, 0, sizeof(*params_out)); // TODO: actually set.
+ memset(params_out, 0, sizeof(*params_out)); // TODO-324: actually set this!
switch (type) {
case ONION_HANDSHAKE_TYPE_TAP:
uint8_t reply_msg[1] = { 0 };
size_t reply_msg_len = 1;
{
- /* TODO, Okay, we have a message from the client trying to negotiate
- * parameters. We need to decide whether the client's request is
- * okay, what we're going to say in response, and what circuit
- * parameters we've just negotiated
+ /* TODO-324, Okay, we have a message from the client trying to negotiate
+ * parameters. We need to decide whether the client's request is okay,
+ * what we're going to say in response, and what circuit parameters
+ * we've just negotiated
*/
/* NOTE! DANGER, DANGER, DANGER!
reply_msg, reply_msg_len,
&server_handshake, &server_handshake_len,
keys_tmp, keys_tmp_len) < 0) {
- // XXX TODO free some stuff
+ // XXX TODO-324 free some stuff
return -1;
}
if (server_handshake_len > reply_out_maxlen) {
- // XXX TODO free that stuff
+ // XXX TODO-324 free that stuff
return -1;
}
if (handshake_state->tag != type)
return -1;
- memset(params_out, 0, sizeof(*params_out)); // TODO: actually set.
+ memset(params_out, 0, sizeof(*params_out)); // TODO-324: actually set this!
switch (type) {
case ONION_HANDSHAKE_TYPE_TAP:
return -1;
}
- // XXXX handle the server message!
{
- // XXXX TODO: see what the server said, make sure it's okay, see what
+ // XXXX TODO-324: see what the server said, make sure it's okay, see what
// parameters it gave us, make sure we like them, and put them into
// `params_out`
}
goto done_processing;
}
- /* TODO! We need to use rpl.circ_params here to initialize the congestion
+ /* TODO-324! We need to use rpl.circ_params here to initialize the congestion
control parameters of the circuit. */
log_debug(LD_OR,"onionskin_answer succeeded. Yay.");
onion_handshake_state_release(&hop->handshake_state);
- // XXXX TODO: use `params` to initialize the congestion control.
+ // XXXX TODO-324: use `params` to initialize the congestion control.
if (cpath_init_circuit_crypto(hop, keys, sizeof(keys), 0, 0)<0) {
return -END_CIRC_REASON_TORPROTOCOL;
if (! ei->supports_ntor3_and_param_negotiation)
return -1;
- /* TODO: fill in the client message that gets sent. */
+ /* TODO-324: fill in the client message that gets sent. */
tor_assert_unreached();
}
created_cell.cell_type = CELL_CREATED_FAST;
created_cell.handshake_len = len;
- // TODO: We should in theory look at params here, though it will always
- // tell us to use the old-fashioned congestion control.
+ // TODO-324: We should in theory look at params here, though it will
+ // always tell us to use the old-fashioned congestion control.
if (onionskin_answer(circ, &created_cell,
(const char *)keys, sizeof(keys),
{
congestion_control_t *cc = tor_malloc_zero(sizeof(congestion_control_t));
- /* TODO: Use `params` to pick the algorithm and the window. */
+ /* TODO-324: Use `params` to pick the algorithm and the window. */
(void) params;
- // XXX: the alg and the sendme_inc need to be negotiated during
+ // TODO-324: XXX: the alg and the sendme_inc need to be negotiated during
// circuit handshake
congestion_control_init(cc, CC_ALG_VEGAS, SENDME_INC_DFLT);
void congestion_control_free_(congestion_control_t *cc);
-/* TODO: Whisky Tango Foxtot‽ Nothing calls this function anywhere! */
+/* TODO-324: Whisky Tango Foxtot‽ Nothing calls this function anywhere!
+ *
+ * It needs to be called client-side and relay-side every time we initialize a
+ * circuit!
+ */
struct circuit_params_t;
congestion_control_t *congestion_control_new(
const struct circuit_params_t *params);
#define ONION_HANDSHAKE_TYPE_TAP 0x0000
#define ONION_HANDSHAKE_TYPE_FAST 0x0001
#define ONION_HANDSHAKE_TYPE_NTOR 0x0002
-#define ONION_HANDSHAKE_TYPE_NTOR_V3 0x0003 /* TODO: Add to spec */
+#define ONION_HANDSHAKE_TYPE_NTOR_V3 0x0003 /* TODO-324: Add to spec */
#define MAX_ONION_HANDSHAKE_TYPE 0x0003
typedef struct onion_handshake_state_t onion_handshake_state_t;
* XXX: WARNING!
*/
- /* TODO: Add a new Relay=* and a new FlowCtrl=* version to indicate support
- * for Ntorv3 and prop324. Make sure they get into the spec. */
+ /* TODO-324: Add a new Relay=* and a new FlowCtrl=* version to indicate
+ * support for Ntorv3 and prop324. Make sure they get into the spec. */
return
"Cons=1-2 "
"Desc=1-2 "
protocol_list_supports_protocol(protocols, PRT_PADDING,
PROTOVER_HS_SETUP_PADDING);
- /* TODO: Set these flags based on real values.
+ /* TODO-324: Set these flags based on real values.
out->supports_ntor3_and_param_negotiation =
protocol_list_supports_protocol(protocols, PRT_RELAY,
XXXX)
info = extend_info_new(NULL, legacy_id,
(have_ed25519_id) ? &ed25519_pk : NULL, NULL,
onion_key, &ap.addr, ap.port,
- /* TODO: The protover summary here needs to explain
+ /* TODO-324: oh wow, this is a hard one.
+
+ The protover summary here needs to explain
if we support the newer congestion control or
- not. This may require new specification stuff */
+ not. This may require new specification changes.
+
+ Probably there is some analogous service-side
+ function that needs to initialize congestion
+ control structures based on what the client says.
+ */
NULL);
done:
return info;