digest,
NULL, /* Ed25519 ID */
NULL, NULL, /* onion keys */
- &addr, conn->socks_request->port);
+ &addr, conn->socks_request->port,
+ NULL);
} else { /* ! (want_onehop && conn->chosen_exit_name[0] == '$') */
/* We will need an onion key for the router, and we
* don't have one. Refuse or relax requirements. */
const ed25519_public_key_t *ed_id,
crypto_pk_t *onion_key,
const curve25519_public_key_t *ntor_key,
- const tor_addr_t *addr, uint16_t port)
+ const tor_addr_t *addr, uint16_t port,
+ const protover_summary_flags_t *pv)
{
extend_info_t *info = tor_malloc_zero(sizeof(extend_info_t));
if (rsa_id_digest)
extend_info_add_orport(info, addr, port);
}
- info->supports_ntor3_and_param_negotiation = false; // TODO: set this.
+ if (pv) {
+ info->supports_ntor3_and_param_negotiation =
+ pv->supports_ntor3_and_param_negotiation;
+ }
return info;
}
rsa_pubkey,
curve_pubkey,
&ap.addr,
- ap.port);
+ ap.port,
+ &node->ri->pv);
} else if (valid_addr && node->rs && node->md) {
info = extend_info_new(node->rs->nickname,
node->identity,
rsa_pubkey,
curve_pubkey,
&ap.addr,
- ap.port);
+ ap.port,
+ &node->rs->pv);
}
crypto_pk_free(rsa_pubkey);
const struct ed25519_public_key_t *ed_id,
crypto_pk_t *onion_key,
const struct curve25519_public_key_t *ntor_key,
- const tor_addr_t *addr, uint16_t port);
+ const tor_addr_t *addr, uint16_t port,
+ const struct protover_summary_flags_t *pv);
extend_info_t *extend_info_from_node(const node_t *r, int for_direct_connect);
extend_info_t *extend_info_dup(extend_info_t *info);
void extend_info_free_(extend_info_t *info);
* negotiate hs circuit setup padding. Requires Padding=2. */
unsigned int supports_hs_setup_padding : 1;
+ /** True iff this router supports ntor3 _and_ supports negotiating
+ * additional circuit parameters via the handshake used in ntor3.
+ */
+ unsigned int supports_ntor3_and_param_negotiation : 1;
} protover_summary_flags_t;
typedef struct routerinfo_t routerinfo_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. */
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.
+ out->supports_ntor3_and_param_negotiation =
+ protocol_list_supports_protocol(protocols, PRT_RELAY,
+ XXXX)
+ &&
+ protocol_list_supports_protocol(protocols, PRT_FLOWCTRL,
+ XXXX);
+ */
+
protover_summary_flags_t *new_cached = tor_memdup(out, sizeof(*out));
cached = strmap_set(protover_summary_map, protocols, new_cached);
tor_assert(!cached);
/* We do have everything for which we think we can connect successfully. */
info = extend_info_new(NULL, legacy_id,
(have_ed25519_id) ? &ed25519_pk : NULL, NULL,
- onion_key, &ap.addr, ap.port);
+ onion_key, &ap.addr, ap.port,
+ /* TODO: The protover summary here needs to explain
+ if we support the newer congestion control or
+ not. This may require new specification stuff */
+ NULL);
done:
return info;
}
/** Dummy object that should be unreturnable. Used to ensure that
* node_get_protover_summary_flags() always returns non-NULL. */
static const protover_summary_flags_t zero_protover_flags = {
- 0,0,0,0,0,0,0,0,0,0,0,0
+ 0,0,0,0,0,0,0,0,0,0,0,0,0
};
/** Return the protover_summary_flags for a given node. */
NULL, /*onion_key*/
NULL, /*curve25519_key*/
&chosen_ap->addr,
- chosen_ap->port);
+ chosen_ap->port,
+ NULL /* protover summary */);
circ->n_chan_create_cell = tor_memdup(&ec->create_cell,
sizeof(ec->create_cell));
info = extend_info_new(r->nickname, r->cache_info.identity_digest,
ed_id_key,
rsa_pubkey, r->onion_curve25519_pkey,
- &ap.addr, ap.port);
+ &ap.addr, ap.port,
+ NULL /* should self-tests use ntor3? */);
crypto_pk_free(rsa_pubkey);
return info;
}
hop->extend_info = extend_info_new(
padding ? "padding" : "non-padding",
digest, NULL, NULL, NULL,
- &addr, padding);
+ &addr, padding, NULL);
cpath_init_circuit_crypto(hop, whatevs_key, sizeof(whatevs_key), 0, 0);
/* Code path will log this exit so build it. */
ocirc->build_state->chosen_exit = extend_info_new("TestNickname", digest,
NULL, NULL, NULL, &addr,
- 4242);
+ 4242, NULL);
/* Attach socks connection to this rendezvous circuit. */
ocirc->p_streams = ENTRY_TO_EDGE_CONN(socks_conn);
/* Trigger the rendezvous failure. Timeout the circuit and free. */
/* Code path will log this exit so build it. */
ocirc->build_state->chosen_exit = extend_info_new("TestNickname", digest,
NULL, NULL, NULL, &addr,
- 4242);
+ 4242, NULL);
ed25519_pubkey_copy(ô->hs_ident->intro_auth_pk, &intro_kp.pubkey);
/* We'll make for close the circuit for a timeout failure. It should _NOT_
/* Code path will log this exit so build it. */
ocirc->build_state->chosen_exit = extend_info_new("TestNickname", digest,
NULL, NULL, NULL, &addr,
- 4242);
+ 4242, NULL);
ed25519_pubkey_copy(ô->hs_ident->intro_auth_pk, &intro_kp.pubkey);
/* On free, we should get an unreachable failure. */
/* Code path will log this exit so build it. */
ocirc->build_state->chosen_exit = extend_info_new("TestNickname", digest,
NULL, NULL, NULL, &addr,
- 4242);
+ 4242, NULL);
ed25519_pubkey_copy(ô->hs_ident->intro_auth_pk, &intro_kp.pubkey);
circuit_mark_for_close(circ, END_CIRC_REASON_TIMEOUT);