tor/src/or
George Kadianakis cf8a2b1567 prop224: Set stricter expiration time of cached client descriptors.
In #23466 we discovered that cached descriptors can stay around on the
client-side for up to 72 hours. In reality we only want those descs to
get cached for the duration of the current time period, since after that
TP is gone the client needs to compute a new blinded key to use for the HS.

In this commit we start using the consensus time (if available) when
cleaning up cached client descriptor entries. That makes sense because
the client uses consensus time anyway for connecting to hidden
services (e.g. computing blinded keys and time periods).

If no recent consensus is available, we consider descriptors to be
expired since we will want to fetch new ones when we get a live
consensus to avoid the Roger bug. If we didn't do that, when Roger
desuspends his laptop there would be a race between Tor fetching a new
consensus, and Tor connecting to the HS which would still cause
reachability issues.

We also turned a rev counter check into a BUG, since we should never
receive a descriptor with a strictly smaller rev counter than the one we
already have, except if there is a bug or if the HSDir wants to mess
with us. In any case, let's turn this into a BUG so that we can detect
and debug such cases easily.
2017-09-13 14:54:49 -04:00
..
addressmap.c Refactor node lookup APIs to take flags 2017-08-22 19:13:40 -04:00
addressmap.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
bridges.c Add a missing bridge download status reset 2017-09-12 10:38:25 -04:00
bridges.h Make clients wait to refresh bridges when they have a recent descriptor 2017-09-12 10:38:25 -04:00
channel.c Merge branch 'maint-0.3.1' 2017-09-12 10:30:54 -04:00
channel.h Merge branch 'callgraph_reduction_v2' 2017-06-21 16:47:55 -04:00
channelpadding.c Merge branch 'ticket17857_squashed' into maint-0.3.1 2017-09-12 10:29:00 -04:00
channelpadding.h Ticket #17857: Apply padding off-switch to existing connections. 2017-09-12 10:28:45 -04:00
channeltls.c Repair buffer API so everything starts with buf_. 2017-09-05 13:57:51 -04:00
channeltls.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
circpathbias.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
circpathbias.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
circuitbuild.c Merge branch 'ed25519_lookup' 2017-09-08 12:18:22 -04:00
circuitbuild.h Explicit length checks in circuit_init_cpath_crypto(). 2017-07-07 11:12:27 -04:00
circuitlist.c circuit: Add a log info when marking for close 2017-09-11 16:10:18 -04:00
circuitlist.h prop224: Use the client-side circuitmap in hs_client.c 2017-08-24 13:03:28 -04:00
circuitmux_ewma.c Switch to offsetof() 2017-08-03 08:56:35 -04:00
circuitmux_ewma.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
circuitmux.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
circuitmux.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
circuitstats.c Don't use "0" as a "base" argument to tor_parse_*(). 2017-08-28 10:21:29 -04:00
circuitstats.h Merge branch 'maint-0.3.0' 2017-05-18 10:06:27 -04:00
circuituse.c Merge branch 'ed25519_lookup' 2017-09-08 12:18:22 -04:00
circuituse.h prop224: Pick rendezvous point of protover HSRend=2 2017-09-07 08:35:28 -04:00
command.c Explicit length checks in circuit_init_cpath_crypto(). 2017-07-07 11:12:27 -04:00
command.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
config.c Merge branch 'ticket21031' 2017-09-12 10:43:34 -04:00
config.h If writing a heartbeat message fails, retry after MIN_HEARTBEAT_PERIOD. 2017-07-12 03:08:04 +00:00
confparse.c Delete useless checks in confparse.c 2017-05-02 16:12:30 -04:00
confparse.h Add support for %include funcionality on torrc #1922 2017-05-18 23:44:16 +01:00
connection_edge.c Merge branch 'ticket21031' 2017-09-12 10:43:34 -04:00
connection_edge.h Merge branch 'http_tunnel_squashed' 2017-09-05 14:34:29 -04:00
connection_or.c Repair buffer API so everything starts with buf_. 2017-09-05 13:57:51 -04:00
connection_or.h Merge branch 'maint-0.3.0' 2017-06-05 15:52:06 -04:00
connection.c Merge remote-tracking branch 'dgoulet/ticket23355_032_01' 2017-09-08 12:13:48 -04:00
connection.h Merge remote-tracking branch 'dgoulet/ticket23355_032_01' 2017-09-08 12:13:48 -04:00
conscache.c 22752: Improve comments to explain why we're doing this fix. 2017-09-04 11:54:49 -04:00
conscache.h On windows, allow many entries in conscache directories 2017-08-29 13:03:36 -04:00
consdiff.c Request (and try to use) consensus diffs. 2017-05-04 08:37:41 -04:00
consdiff.h Request (and try to use) consensus diffs. 2017-05-04 08:37:41 -04:00
consdiffmgr.c On windows, allow many entries in conscache directories 2017-08-29 13:03:36 -04:00
consdiffmgr.h Set published_out for consensus cache entries in spooled_resource_estimate_size(). 2017-06-27 18:25:48 -04:00
control.c Merge branch 'ed25519_lookup' 2017-09-08 12:18:22 -04:00
control.h Remove the AUTHDIR_NEWDESCS feature: nobody is using it any more 2017-08-24 16:53:35 -04:00
cpuworker.c Merge branch 'maint-0.3.1' 2017-07-27 16:30:52 -04:00
cpuworker.h Queue consensus diffs at LOW priority. 2017-07-27 16:28:59 -04:00
dircollate.c Switch to offsetof() 2017-08-03 08:56:35 -04:00
dircollate.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
directory.c Merge branch 'bug23347_squashed' 2017-09-12 10:38:35 -04:00
directory.h Merge branch 'http_tunnel_squashed' 2017-09-05 14:34:29 -04:00
dirserv.c Merge branch 'ticket22377' 2017-09-08 08:06:44 -04:00
dirserv.h Store the sha3 of a networkstatus as part of the networkstatus_t 2017-05-04 08:37:41 -04:00
dirvote.c rephist: Remove unused crypto_pk statistics. 2017-07-13 20:24:48 +00:00
dirvote.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
dns_structs.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
dns.c Switch to offsetof() 2017-08-03 08:56:35 -04:00
dns.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
dnsserv.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
dnsserv.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
entrynodes.c general formatting / whitespace / typo fixes 2017-07-01 17:56:06 -04:00
entrynodes.h Merge branch 'maint-0.3.0' into maint-0.3.1 2017-06-29 15:57:48 -04:00
ext_orport.c Repair buffer API so everything starts with buf_. 2017-09-05 13:57:51 -04:00
ext_orport.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
fallback_dirs.inc Update fallback directory mirrors in May 2017 2017-05-16 19:02:42 +10:00
fp_pair.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
fp_pair.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
geoip.c New GETINFO target to check if geoip is loaded 2017-08-25 12:25:05 -04:00
geoip.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
hibernate.c Merge branch 'bug19418_029' into maint-0.3.1 2017-08-25 11:38:24 -04:00
hibernate.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
hs_cache.c prop224: Set stricter expiration time of cached client descriptors. 2017-09-13 14:54:49 -04:00
hs_cache.h prop224: Set stricter expiration time of cached client descriptors. 2017-09-13 14:54:49 -04:00
hs_cell.c prop224: Add a function to clear INTRO data 2017-08-24 13:03:28 -04:00
hs_cell.h prop224: Add a function to clear INTRO data 2017-08-24 13:03:28 -04:00
hs_circuit.c prop224: Register RP circuit when it opens 2017-08-24 13:03:29 -04:00
hs_circuit.h prop224: Build ESTABLISH_RENDEZVOUS cell and logic 2017-08-24 13:03:28 -04:00
hs_circuitmap.c hs: Handled REND_JOINED circuit when getting an INTRODUCE_ACK 2017-09-11 13:38:58 -04:00
hs_circuitmap.h prop224: Add client-side rend circuit support to HS circuitmap 2017-08-24 13:03:28 -04:00
hs_client.c Merge remote-tracking branch 'asn/bug23457_032_01' 2017-09-12 11:10:48 -04:00
hs_client.h Merge remote-tracking branch 'dgoulet/ticket23355_032_01' 2017-09-08 12:13:48 -04:00
hs_common.c prop224: Improve docs in time period funcs. 2017-09-12 21:17:35 +03:00
hs_common.h prop224: Pick the right hsdir index based on descriptor. 2017-09-08 19:07:00 +03:00
hs_config.c prop224: Move service version into config object 2017-07-13 16:50:09 -04:00
hs_config.h prop224: Configure v3 service from options 2017-07-13 16:49:44 -04:00
hs_descriptor.c test: Fix memory leak in hs_descriptor/decode_bad_signature 2017-09-05 09:26:21 -04:00
hs_descriptor.h prop224: Expand the overlap period concept to be a full SRV protocol run 2017-09-08 19:07:00 +03:00
hs_ident.c hs-v3: Cancel active descriptor directory connections before uploading 2017-09-12 01:32:04 +03:00
hs_ident.h hs-v3: Cancel active descriptor directory connections before uploading 2017-09-12 01:32:04 +03:00
hs_intropoint.c Merge branch 'ticket20657_nickm_bugfixes_squashed' 2017-08-08 20:31:57 -04:00
hs_intropoint.h Rename some free() functions that are actually clear(). 2017-08-08 20:29:34 -04:00
hs_ntor.c Explicit length checks in create_rend_cpath(). 2017-07-07 11:12:27 -04:00
hs_ntor.h Fix wide lines 2017-07-07 11:15:27 -04:00
hs_service.c Merge remote-tracking branch 'dgoulet/ticket23480_032_01' 2017-09-12 11:20:27 -04:00
hs_service.h prop224: Make client and service pick same HSDir 2017-09-08 19:07:00 +03:00
include.am Move buffers.c and buffers_tls.c into src/common 2017-09-05 13:57:51 -04:00
keypin.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
keypin.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
main.c Merge remote-tracking branch 'dgoulet/ticket23355_032_01' 2017-09-08 12:13:48 -04:00
main.h clang-i386: use house style for public-when-testing variables 2017-05-08 15:38:05 -04:00
Makefile.nmake Netflow record collapsing defense. 2017-05-08 13:49:21 -04:00
microdesc.c general formatting / whitespace / typo fixes 2017-07-01 17:56:06 -04:00
microdesc.h Merge branch 'spooling_squashed' 2017-03-28 19:55:18 +02:00
networkstatus.c Remove named_map and unnamed_map from networkstatus.c 2017-09-12 09:56:42 -04:00
networkstatus.h Remove named_map and unnamed_map from networkstatus.c 2017-09-12 09:56:42 -04:00
nodelist.c hs-v3: Rate limit some log statements 2017-09-12 11:03:13 -04:00
nodelist.h Merge branch 'ed25519_lookup' 2017-09-08 12:18:22 -04:00
ntmain.c Handle CMD_KEY_EXPIRATION in ntmain.c switch statement 2017-08-04 12:00:51 -04:00
ntmain.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
onion_fast.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
onion_fast.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
onion_ntor.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
onion_ntor.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
onion_tap.c Rename the hybrid_encrypt/decrypt functions; label them as dangerous 2017-07-24 14:34:53 -04:00
onion_tap.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
onion.c Fix ntohs() that should have been htons() 2017-08-04 12:17:53 -04:00
onion.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
or.h Merge branch 'ticket21031' 2017-09-12 10:43:34 -04:00
parsecommon.c Extract intro point onion key even with multiple types. 2017-08-08 20:29:34 -04:00
parsecommon.h Extract intro point onion key even with multiple types. 2017-08-08 20:29:34 -04:00
periodic.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
periodic.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
policies.c Switch to offsetof() 2017-08-03 08:56:35 -04:00
policies.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
proto_cell.c Refactor buffer APIs to put a buf_t first. 2017-09-05 13:57:51 -04:00
proto_cell.h Move protocol-specific functions out of buffers.c 2017-09-05 13:57:51 -04:00
proto_control0.c Refactor buffer APIs to put a buf_t first. 2017-09-05 13:57:51 -04:00
proto_control0.h Move protocol-specific functions out of buffers.c 2017-09-05 13:57:51 -04:00
proto_ext_or.c Refactor buffer APIs to put a buf_t first. 2017-09-05 13:57:51 -04:00
proto_ext_or.h Make buffers.c independent of or.h 2017-09-05 13:57:51 -04:00
proto_http.c Refactor buffer APIs to put a buf_t first. 2017-09-05 13:57:51 -04:00
proto_http.h Move protocol-specific functions out of buffers.c 2017-09-05 13:57:51 -04:00
proto_socks.c Repair buffer API so everything starts with buf_. 2017-09-05 13:57:51 -04:00
proto_socks.h Move protocol-specific functions out of buffers.c 2017-09-05 13:57:51 -04:00
protover.c Dircache protocol version 2 adds support for diffs 2017-05-15 17:53:36 -04:00
protover.h prop224: Pick rendezvous point of protover HSRend=2 2017-09-07 08:35:28 -04:00
reasons.c Add support for HTTP Connect tunnels 2017-09-05 14:34:09 -04:00
reasons.h Add support for HTTP Connect tunnels 2017-09-05 14:34:09 -04:00
relay.c Make ClientDNSRejectInternalAddresses testing-only. 2017-09-07 10:03:31 -04:00
relay.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
rendcache.c prop224: Purge client state on NEWNYM 2017-08-30 09:15:54 -04:00
rendcache.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
rendclient.c Merge branch 'maint-0.3.1' 2017-08-25 11:39:38 -04:00
rendclient.h hs: Remove unused rend_client_rendezvous_acked() 2017-08-24 13:03:28 -04:00
rendcommon.c Merge branch 'maint-0.3.1' 2017-08-25 11:39:38 -04:00
rendcommon.h prop224: Helper function to assert on invalid client intro circuit 2017-08-24 13:03:28 -04:00
rendmid.c rephist: Remove unused crypto_pk statistics. 2017-07-13 20:24:48 +00:00
rendmid.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
rendservice.c Merge branch 'ed25519_lookup' 2017-09-08 12:18:22 -04:00
rendservice.h hs: Rename num_rend_services() 2017-08-08 20:29:34 -04:00
rephist.c Apply ahf's ceil_div.cocci patch. 2017-08-24 15:33:27 -04:00
rephist.h rephist: Remove unused crypto_pk statistics. 2017-07-13 20:24:48 +00:00
replaycache.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
replaycache.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
router.c Remove named_map and unnamed_map from networkstatus.c 2017-09-12 09:56:42 -04:00
router.h Remove obsolete authdir_mode_any_nonhidserv() 2017-06-21 13:49:17 -04:00
routerkeys.c Merge branch 'maint-0.3.1' 2017-08-25 11:39:38 -04:00
routerkeys.h routerkeys: Add cmdline option for learning signing key expiration. 2017-08-03 22:20:02 +00:00
routerlist.c Remove named_map and unnamed_map from networkstatus.c 2017-09-12 09:56:42 -04:00
routerlist.h Remove named_map and unnamed_map from networkstatus.c 2017-09-12 09:56:42 -04:00
routerparse.c prop224: Pick rendezvous point of protover HSRend=2 2017-09-07 08:35:28 -04:00
routerparse.h bug#22143/prop#140: identify input diffs by their digest-as-signed 2017-05-03 13:09:08 -04:00
routerset.c Refactor node lookup APIs to take flags 2017-08-22 19:13:40 -04:00
routerset.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
scheduler.c Switch to offsetof() 2017-08-03 08:56:35 -04:00
scheduler.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
shared_random_state.c sr: Log voting schedule at debug level 2017-08-19 16:20:07 +03:00
shared_random_state.h prop224 tests: Improve SRV protocol tests. 2017-08-08 20:29:35 -04:00
shared_random.c Don't set HSDir index if we don't have a live consensus. 2017-08-08 20:29:34 -04:00
shared_random.h Don't set HSDir index if we don't have a live consensus. 2017-08-08 20:29:34 -04:00
statefile.c Merge branch 'ticket20657_nickm_bugfixes_squashed' 2017-08-08 20:31:57 -04:00
statefile.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
status.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
status.h Run the copyright update script. 2017-03-15 16:13:17 -04:00
tor_main.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
torcert.c Merge remote-tracking branch 'haxxpop/fuzzing-hsv3' 2017-08-28 13:46:24 -04:00
torcert.h Mock rsa_ed25519_crosscert_check 2017-08-13 16:15:40 +07:00
transports.c Run the copyright update script. 2017-03-15 16:13:17 -04:00
transports.h Run the copyright update script. 2017-03-15 16:13:17 -04:00