aboutsummaryrefslogtreecommitdiff
path: root/src/feature/hs
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-11-25 12:36:59 +1000
committerteor <teor@torproject.org>2019-11-25 12:36:59 +1000
commit055f5d4d1b2c8ea5a85691f7110e82a9c468b6dd (patch)
treebeefb267f60a2800e2499cc2a7e354408ef81f9c /src/feature/hs
parentc17ab20ac0d3efb1b9c46fa12685db5b09015481 (diff)
parent501b5174d84a121fe5932433e54b2929a5c2876d (diff)
downloadtor-055f5d4d1b2c8ea5a85691f7110e82a9c468b6dd.tar.gz
tor-055f5d4d1b2c8ea5a85691f7110e82a9c468b6dd.zip
Merge branch 'maint-0.3.5' into maint-0.4.0
Diffstat (limited to 'src/feature/hs')
-rw-r--r--src/feature/hs/hs_client.c8
-rw-r--r--src/feature/hs/hs_service.c9
2 files changed, 15 insertions, 2 deletions
diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c
index 2a5765aec2..fd2d266453 100644
--- a/src/feature/hs/hs_client.c
+++ b/src/feature/hs/hs_client.c
@@ -672,8 +672,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;
}
diff --git a/src/feature/hs/hs_service.c b/src/feature/hs/hs_service.c
index e32f021742..160fb87397 100644
--- a/src/feature/hs/hs_service.c
+++ b/src/feature/hs/hs_service.c
@@ -1686,6 +1686,15 @@ build_desc_intro_points(const hs_service_t *service,
DIGEST256MAP_FOREACH(desc->intro_points.map, key,
const hs_service_intro_point_t *, ip) {
+ if (!ip->circuit_established) {
+ /* Ignore un-established intro points. They can linger in that list
+ * because their circuit has not opened and they haven't been removed
+ * yet even though we have enough intro circuits.
+ *
+ * Due to #31561, it can stay in that list until rotation so this check
+ * prevents to publish an intro point without a circuit. */
+ continue;
+ }
hs_desc_intro_point_t *desc_ip = hs_desc_intro_point_new();
if (setup_desc_intro_point(&desc->signing_kp, ip, now, desc_ip) < 0) {
hs_desc_intro_point_free(desc_ip);