When using a bridge, if my own Tor client builds the circuit, how does it know relays IP addresses (middle and exit IP addresses and their public keys) ?
Does it take them from the bridge?
Tor Stack Exchange is a question and answer site for researchers, developers, and users of Tor. It only takes a minute to sign up.Sign up to join this community
Yes, they are taken from the bridge.
Every bridge has the latest directory information cached (just like any directory mirror), and Tor clients fetch them directly and build circuits with the bridge as an entry guard.
A bridge that has just started for few minutes could cause clients who connect to it fail since directory information has not been downloaded yet. This is sometimes (in old versions) caused by a bug, but also happens when the bridge has trouble doing directory fetches.
nobody_is_wrong is wrong.
The bridge proposal tells that a bridge client will send non-anonymized directory requests directly to the bridge, and do anonymized directory fetches through regular multi-hop directory circuits.
Bridge users are like ordinary Tor users except they use encrypted directory connections by default, and they use bridge relays as both entry guards (their first hop) and directory guards (the source of all their directory information).
3.3. Bridges as directory guards
In addition to using bridges as the first hop in their circuits, bridge users also use them to fetch directory updates. Other than initial bootstrapping to find a working bridge descriptor (see Section 3.4 below), all further non-anonymized directory fetches will be redirected to the bridge.
This means that bridge relays need to have cached answers for all questions the bridge user might ask. This makes the upgrade path tricky --- for example, if we migrate to a v4 directory design, the bridge user would need to keep using v3 so long as his bridge relays only knew how to answer v3 queries.
In a future design, for cases where the user has enough information to build circuits yet the chosen bridge doesn't know how to answer a given query, we might teach bridge users to make an anonymized request to a more suitable directory server.
According to the current code (see networkstatus.c), anonymized directory connection is never used for fetching microdescs and consensuses.