[tor-bugs] #33609 [Core Tor/Chutney]: Check that onion services have successfully posted descriptors before verifying
Tor Bug Tracker & Wiki
blackhole at torproject.org
Wed Apr 1 09:49:26 UTC 2020
#33609: Check that onion services have successfully posted descriptors before
verifying
-------------------------------------------------+-------------------------
Reporter: teor | Owner: (none)
Type: enhancement | Status: new
Priority: Medium | Milestone:
Component: Core Tor/Chutney | Version:
Severity: Normal | Resolution:
Keywords: ipv6, prop311, outreachy-ipv6, easy | Actual Points:
Parent ID: #33050 | Points: 1
Reviewer: | Sponsor:
| Sponsor55-can
-------------------------------------------------+-------------------------
Comment (by teor):
Here is some more information about the tasks in this ticket:
Replying to [ticket:33609 teor]:
> So here is one possible design for this feature:
> * check each onion service log for a successful descriptor post to at
least one HSDir
Tor onion services log info-level messages when they post descriptors to
onion service directories.
Chutney's getLastBootstrapStatus() function searches notice-level log
files for bootstrap statuses, and returns the percentage complete,
keyword, and message:
https://github.com/torproject/chutney/blob/master/lib/chutney/TorNet.py#L1158
You could write a function getLastOnionServiceDescStatus(), which searches
info-level logs for onion service descriptor uploads.
It could return:
* an arbitrary percentage complete (the same for v2 and v3),
* an arbitrary keyword (ideally different for v2 and v3), and
* part of the log message (different for v2 and v3)
When choosing the percentage, make it bigger than 100, so we can use the
results with the existing bootstrap code.
When choosing the keyword, try to match the format of the existing
keywords.
Let's put the percentage and keywords as constants, so they can be changed
if needed. You can put the constants with these existing constants:
https://github.com/torproject/chutney/blob/master/lib/chutney/TorNet.py#L1150
> * check v2 and v3 onion services
Here are the logged messages for each onion service version:
* v2: "Launching upload for hidden service %s:
https://github.com/torproject/tor/blob/ec8d41e69931bc717b41831928c720b21719c67f/src/feature/rend/rendservice.c#L3819
* v3: "Service %s %s descriptor of revision %" PRIu64 " initiated upload
request to %s with index %s (%s)":
https://github.com/torproject/tor/blob/ec8d41e69931bc717b41831928c720b21719c67f/src/feature/hs/hs_service.c#L2868
You could just search for both messages, and use whichever one is present.
(Chutney doesn't configure v2 and v3 onion services on the same instance.)
As an alternative, you could make a function that checks the length of
hs_hostname, and returns the onion service version. (Onion services used
to be called "hidden services", so lots of old code uses the "hs"
acronym.)
Here is how you can access hs_hostname:
https://github.com/torproject/chutney/blob/master/scripts/chutney_tests/verify.py#L203
_env is also part of LocalNodeController:
https://github.com/torproject/chutney/blob/master/lib/chutney/TorNet.py#L851
getUncheckedDirInfoWaitTime() is an example function that returns
different results for onion services (but it doesn't know about different
onion service versions):
https://github.com/torproject/chutney/blob/master/lib/chutney/TorNet.py#L955
> * call it an extra 200% "bootstrap" stage (because it's a sender log
check, not a receiver cached file check)
> * require 200% bootstrap for onion services
I hope that provides some more information.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/33609#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list