Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sendme: Introduce consensus param sendme_dir_min_version #1027

Closed

Conversation

Labels
None yet
Projects
None yet
4 participants
@dgoulet-tor
Copy link
Contributor

@dgoulet-tor dgoulet-tor commented May 15, 2019

See section 4.5 of proposal 289 which describes why we need this parameter. To
summarize, this is to accomodate old clients not supporting authenticated
SENDMEs and booting up for the first time.

They need to be able to fetch a consensus to actually learn that the required
protocols is FlowCtrl=1 and thus not start up. And for that, we need to allow
a SENDME minimum version on a directory request circuit. That new consensus
parameter handles that.

Closes #30364

Signed-off-by: David Goulet dgoulet@torproject.org

See section 4.5 of proposal 289 which describes why we need this parameter. To
summarize, this is to accomodate old clients not supporting authenticated
SENDMEs and booting up for the first time.

They need to be able to fetch a consensus to actually learn that the required
protocols is FlowCtrl=1 and thus not start up. And for that, we need to allow
a SENDME minimum version on a directory request circuit. That new consensus
parameter handles that.

Closes #30364

Signed-off-by: David Goulet <dgoulet@torproject.org>
@coveralls
Copy link

@coveralls coveralls commented May 15, 2019

Pull Request Test Coverage Report for Build 5032

  • 6 of 8 (75.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.0003%) to 62.486%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/core/or/relay.c 0 2 0.0%
Totals Coverage Status
Change from base Build 5030: 0.0003%
Covered Lines: 46618
Relevant Lines: 74606

💛 - Coveralls

@@ -1670,6 +1670,11 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ,
"from intermediary node. Dropping.");
return 0;
}
if (circ->purpose == CIRCUIT_PURPOSE_OR) {
Copy link
Contributor

@nmathewson nmathewson May 16, 2019

This code is reached for BEGIN and BEGIN_DIR.

@@ -39,6 +39,11 @@
#define SENDME_ACCEPT_MIN_VERSION_MIN 0
#define SENDME_ACCEPT_MIN_VERSION_MAX UINT8_MAX

/* Minimum version allowed on a one-hop directory circuit. */
Copy link
Contributor

@nmathewson nmathewson May 16, 2019

This comment isn't accurate?

* circuit that is for a directory request. It is only relevant if we are
* the directory server and thus on an OR circuit. */
if (CIRCUIT_IS_ORCIRC(circ) && CONST_TO_OR_CIRCUIT(circ)->begin_dir_seen) {
accept_version = get_dir_min_version();
Copy link
Contributor

@nmathewson nmathewson May 16, 2019

This calculation is expensive enough that maybe we don't want to do it for every sendme?

* mechanism in order to know if this circuit will serve a consensus for
* which we need to obey a specific consensus parameter about the minimal
* SENDME version we accept. */
unsigned int begin_dir_seen : 1;
Copy link
Contributor

@nmathewson nmathewson May 16, 2019

I think this might be backwards: If I understand correctly, we don't want somebody to be able to send a BEGIN_DIR in order to make all a circuit exempt from the minimum. I think instead we wanted to have it so that if the circuit got a regular BEGIN, we know that it is not a directory circuit?

Copy link
Contributor Author

@dgoulet-tor dgoulet-tor May 21, 2019

Hmmm interesting, I haven't thought of gaming this by sending a RELAY_BEGIN_DIR and then performing other tasks than a directory request...

Actually, is this assertion always true?: if no BEGIN than must be a directory circuit?

In other words, it is safe and reliable to apply this minimal version for the SENDME as long as we haven't seen a BEGIN on it?

@@ -61,6 +61,13 @@ struct or_circuit_t {
* statistics. */
unsigned int circuit_carries_hs_traffic_stats : 1;

/** If set, this circuit got a BEGIN_DIR, meaning a directory request, and
* not for any hidden service documents. We use this flag for SENDME
Copy link
Contributor

@nmathewson nmathewson May 16, 2019

There's nothing in this patch that checks for hidden service documents?

@torproject-pusher torproject-pusher deleted the branch torproject:master May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment