mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Bug 31356: Propogate protover padding support to circpad
This commit is contained in:
@@ -2696,8 +2696,9 @@ circpad_node_supports_padding(const node_t *node)
|
||||
{
|
||||
if (node->rs) {
|
||||
log_fn(LOG_INFO, LD_CIRC, "Checking padding: %s",
|
||||
node->rs->pv.supports_padding ? "supported" : "unsupported");
|
||||
return node->rs->pv.supports_padding;
|
||||
node->rs->pv.supports_hs_setup_padding ?
|
||||
"supported" : "unsupported");
|
||||
return node->rs->pv.supports_hs_setup_padding;
|
||||
}
|
||||
|
||||
log_fn(LOG_INFO, LD_CIRC, "Empty routerstatus in padding check");
|
||||
|
||||
+2
-2
@@ -841,8 +841,8 @@ typedef struct protover_summary_flags_t {
|
||||
unsigned int supports_v3_rendezvous_point: 1;
|
||||
|
||||
/** True iff this router has a protocol list that allows clients to
|
||||
* negotiate link-level padding. Requires Padding>=1. */
|
||||
unsigned int supports_padding : 1;
|
||||
* negotiate hs circuit setup padding. Requires Padding>=2. */
|
||||
unsigned int supports_hs_setup_padding : 1;
|
||||
} protover_summary_flags_t;
|
||||
|
||||
typedef struct routerinfo_t routerinfo_t;
|
||||
|
||||
@@ -28,6 +28,8 @@ struct smartlist_t;
|
||||
#define PROTOVER_HS_INTRO_V3 4
|
||||
/** The protover version number that signifies HSv3 rendezvous point support */
|
||||
#define PROTOVER_HS_RENDEZVOUS_POINT_V3 2
|
||||
/** The protover that signals support for HS circuit setup padding machines */
|
||||
#define PROTOVER_HS_SETUP_PADDING 2
|
||||
|
||||
/** List of recognized subprotocols. */
|
||||
/// C_RUST_COUPLED: src/rust/protover/ffi.rs `translate_to_rust`
|
||||
|
||||
@@ -448,8 +448,9 @@ memoize_protover_summary(protover_summary_flags_t *out,
|
||||
out->supports_v3_rendezvous_point =
|
||||
protocol_list_supports_protocol(protocols, PRT_HSREND,
|
||||
PROTOVER_HS_RENDEZVOUS_POINT_V3);
|
||||
out->supports_padding =
|
||||
protocol_list_supports_protocol(protocols, PRT_PADDING, 1);
|
||||
out->supports_hs_setup_padding =
|
||||
protocol_list_supports_protocol(protocols, PRT_PADDING,
|
||||
PROTOVER_HS_SETUP_PADDING);
|
||||
|
||||
protover_summary_flags_t *new_cached = tor_memdup(out, sizeof(*out));
|
||||
cached = strmap_set(protover_summary_map, protocols, new_cached);
|
||||
|
||||
@@ -90,10 +90,10 @@ static void
|
||||
nodes_init(void)
|
||||
{
|
||||
padding_node.rs = tor_malloc_zero(sizeof(routerstatus_t));
|
||||
padding_node.rs->pv.supports_padding = 1;
|
||||
padding_node.rs->pv.supports_hs_setup_padding = 1;
|
||||
|
||||
non_padding_node.rs = tor_malloc_zero(sizeof(routerstatus_t));
|
||||
non_padding_node.rs->pv.supports_padding = 0;
|
||||
non_padding_node.rs->pv.supports_hs_setup_padding = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user