diff options
author | Rasmus Dahlberg <rasmus@mullvad.net> | 2022-10-12 20:29:11 +0200 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2022-11-28 10:25:06 -0500 |
commit | 15efc25fb502474b8a4f2ee8cb03bd5d185a3f47 (patch) | |
tree | 498d3fe4c1453f406cd88a7dae81e412e610bfc3 /src/core/or/connection_edge.h | |
parent | be7afe658e5fc6745a369d6fb3fbc4bb6037da18 (diff) | |
download | tor-15efc25fb502474b8a4f2ee8cb03bd5d185a3f47.tar.gz tor-15efc25fb502474b8a4f2ee8cb03bd5d185a3f47.zip |
dns: Make TTLs fuzzy at exit relays
This change mitigates DNS-based website oracles by making the time that
a domain name is cached uncertain (+- 4 minutes of what's measurable).
Resolves TROVE-2021-009.
Fixes #40674
Diffstat (limited to 'src/core/or/connection_edge.h')
-rw-r--r-- | src/core/or/connection_edge.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/core/or/connection_edge.h b/src/core/or/connection_edge.h index c9433adade..802ca071cd 100644 --- a/src/core/or/connection_edge.h +++ b/src/core/or/connection_edge.h @@ -188,11 +188,9 @@ void connection_ap_warn_and_unmark_if_pending_circ( entry_connection_t *entry_conn, const char *where); -/** Lowest value for DNS ttl that a server should give or a client should - * believe. */ +/** Lowest value for DNS ttl clipping excluding the random addition. */ #define MIN_DNS_TTL (5*60) -/** Highest value for DNS ttl that a server should give or a client should - * believe. */ +/** Highest value for DNS ttl clipping excluding the random addition. */ #define MAX_DNS_TTL (60*60) /** How long do we keep DNS cache entries before purging them (regardless of * their TTL)? */ @@ -200,8 +198,16 @@ void connection_ap_warn_and_unmark_if_pending_circ( /** How long do we cache/tell clients to cache DNS records when no TTL is * known? */ #define DEFAULT_DNS_TTL (30*60) +/** How much should we +- each TTL to make it fuzzy with uniform sampling at + * exits? The value 4 minutes was chosen so that the lowest possible clip is + * 60s. Such low clips were used in the past for all TTLs due to a bug in Tor, + * see "The effect of DNS on Tor's Anonymity" by Greschbach et al. In other + * words, sampling such low clips is unlikely to cause any breakage at exits. + */ +#define FUZZY_DNS_TTL (4*60) uint32_t clip_dns_ttl(uint32_t ttl); +uint32_t clip_dns_fuzzy_ttl(uint32_t ttl); int connection_half_edge_is_valid_data(const smartlist_t *half_conns, streamid_t stream_id); |