How Tor Verifies Its First Network Map
A fresh Tor client needs a list of relays before it can send a request through any of them. Say the first server it contacts makes up its own list and hands it over as the network’s current view. What lets the client reject it?
The Tor client starts with the expected cryptographic identities of a standard set of directory authorities. These servers vote on the public relay network. The result is a signed document called the network-status consensus. The client can download a copy from a mirror and verify it using identities it knew before it connected. Directory protocol overview , Client operation
Where signatures come from
A relay sends the authorities a signed server descriptor containing its identity, keys, addresses and other properties. Its signature tells the authorities whose statement they received. Each authority forms its own view of the network and publishes a signed vote. The authorities exchange those votes, compute the consensus under common rules and sign the result. Computing a consensus
The consensus includes relay identities, flags and weights. A flag such as Guard gives the client information about which relays qualify for a role. The weights affect selection probabilities. That is why adding a line to a relay’s own descriptor cannot give it a new role in the network view clients use. Consensus formats
The mirror supplies a copy
The software ships with the expected authority identities and a separate list of contacts. On first start, a client can ask one of those contacts, a fallback directory mirror, for a copy of the consensus. The client first verifies the certificates linking the authorities’ signing keys to their trusted identities. It then uses those signing keys to verify the consensus signatures and checks that a majority of the recognized authorities signed it. A signature made by the mirror cannot stand in for an authority’s. Publishing the consensus , Client operation
| Document | Where it comes from | What the client uses it for |
|---|---|---|
| Network-status consensus | Authorities compute and sign it. Mirrors can serve a copy. | Find the agreed relay list, flags and weights. |
| Microdescriptor | Authorities derive it from relay information. The consensus carries its digest. | Verify the document against the signed digest, then read details such as the relay’s circuit extension key. |
A digest is a fingerprint of the document’s bytes. In the microdescriptor form of the consensus, the signed document commits to those fingerprints. If a cache sends different bytes, the digest check fails. A cache can still delay the client or refuse to deliver the file. The client can try another cache. Computing microdescriptors , Client operation
A verified map can still be incomplete
The consensus carries a validity window. A signature can still verify on an old copy, so the client checks the dates to determine how current its network view is. It also needs enough relay details to build usable paths. A client can therefore have the signed map and still be waiting on missing microdescriptors. The readiness threshold depends on parameters and available paths. When Tor builds circuits
The mirror supplies the bytes. The figure shows how the client verifies the consensus itself. Once the client trusts the consensus, it can check downloaded microdescriptors against the digests it carries.
Once it has enough directory information, the client can choose its own path. The next decision starts with an unexpected relay. How Tor chooses a circuit