summaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-10-25 09:41:48 +1000
committerteor <teor@torproject.org>2019-10-25 09:41:48 +1000
commitacd27f4b419907052d0677933fe5068a5c25953f (patch)
treeb965fd101145efbdc23014d55c123886fa4d89d0 /src/feature
parent570d1367ea6c03335d1c4ee781c5197e26c6b24a (diff)
parented57a04a65a59ee744910a9db22a81359dac3491 (diff)
downloadtor-acd27f4b419907052d0677933fe5068a5c25953f.tar.gz
tor-acd27f4b419907052d0677933fe5068a5c25953f.zip
Merge remote-tracking branch 'tor-github/pr/1464' into maint-0.4.2
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/hs/hs_client.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c
index f8d47f0114..492e77faff 100644
--- a/src/feature/hs/hs_client.c
+++ b/src/feature/hs/hs_client.c
@@ -682,8 +682,12 @@ setup_intro_circ_auth_key(origin_circuit_t *circ)
tor_assert(circ);
desc = hs_cache_lookup_as_client(&circ->hs_ident->identity_pk);
- if (BUG(desc == NULL)) {
- /* Opening intro circuit without the descriptor is no good... */
+ if (desc == NULL) {
+ /* There is a very small race window between the opening of this circuit
+ * and the client descriptor cache that gets purged (NEWNYM) or the
+ * cleaned up because it expired. Mark the circuit for close so a new
+ * descriptor fetch can occur. */
+ circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL);
goto end;
}