Bug 31356: Propogate protover padding support to circpad

This commit is contained in:
Mike Perry
2019-08-12 13:15:31 -05:00
parent b14bb12e39
commit b2821b72bc
5 changed files with 12 additions and 8 deletions
+3 -2
View File
@@ -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
View File
@@ -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;
+2
View File
@@ -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`
+3 -2
View File
@@ -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);
+2 -2
View File
@@ -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