Skip to content

onion-tunnel: Stricter bootstrap recognition

Clara Engler requested to merge cve/onionmasq:dev/cve/censorship into main

This commit makes the onion-tunnel bootstrapping more conservative in when to be considered bootstrapped.

Previously, there has been a tokio timeout task that gave the TorClient::bootstrap method a 30 second chance to complete, before indicating an error.

This works well in a censored environment where the user has never been able to download any sort of consensus, because in that case, arti will obviously be unable to fetch one, so the bootstrap method will time out.

However, when the user happens to have a valid consensus in their cache, the bootstrap call will succeed immediately, even though arti may in fact not be usable.

To mitigate this issue, we add a loop after the bootstrap call, which will terminate only if it receives at least one bootstrap status indicating a usability of the Tor network.

See #110

Merge request reports

Loading