aboutsummaryrefslogtreecommitdiff
path: root/spec/tor-spec/opening-streams.md
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2023-12-07 16:11:00 -0500
committerNick Mathewson <nickm@torproject.org>2023-12-07 16:11:57 -0500
commit61945e4acdf872a392f8c24b13b40617cbf1a5fd (patch)
tree575c6d5392f1d451568a7830a0af0d51bc57a18c /spec/tor-spec/opening-streams.md
parent360808dd9670f9544f13a5bf5466b972d1c63588 (diff)
downloadtorspec-61945e4acdf872a392f8c24b13b40617cbf1a5fd.tar.gz
torspec-61945e4acdf872a392f8c24b13b40617cbf1a5fd.zip
opening-streams: clarifications around CONNECTED
Namely: * CONNECTED messages may be empty. * It is a bad idea to cache IP addresses you get from an exit.
Diffstat (limited to 'spec/tor-spec/opening-streams.md')
-rw-r--r--spec/tor-spec/opening-streams.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/tor-spec/opening-streams.md b/spec/tor-spec/opening-streams.md
index 757f776..799b4dc 100644
--- a/spec/tor-spec/opening-streams.md
+++ b/spec/tor-spec/opening-streams.md
@@ -68,6 +68,18 @@ payload is in one of the following formats:
A number of seconds (TTL) for which the address may be cached [4 octets]
```
+Implementations MUST accept either of these formats,
+and MUST also accept an empty RELAY_CONNECTED message body.
+
+Implmentations MAY ignore the address value,
+and MAY choose not to cache it.
+If an implementation chooses to cache the address,
+it SHOULD NOT reuse that address with any other circuit.
+
+> The reason not to cache an address
+> is that the exit might have lied about the actual address of the host,
+> or might have given us a unique address to identify us in the future.
+
\[Tor exit nodes before 0.1.2.0 set the TTL field to a fixed value. Later
versions set the TTL to the last value seen from a DNS server, and expire
their own cached entries after a fixed interval. This prevents certain