summaryrefslogtreecommitdiff
path: root/src/or/hs_client.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-09-11 13:16:23 -0400
committerGeorge Kadianakis <desnacked@riseup.net>2017-09-12 01:32:04 +0300
commit7150214baf2385d0e64fd11fe4138932675d444f (patch)
tree3379659d49978f1b43f6a54f4d69e752a4378f4b /src/or/hs_client.c
parent67a5d4cb60a9f27e981b83195cf47183a7e9abcc (diff)
downloadtor-7150214baf2385d0e64fd11fe4138932675d444f.tar.gz
tor-7150214baf2385d0e64fd11fe4138932675d444f.zip
hs-v3: Cancel active descriptor directory connections before uploading
It is possible that two descriptor upload requests are launched in a very short time frame which can lead to the second request finishing before the first one and where that first one will make the HSDir send back a 400 malformed descriptor leading to a warning. To avoid such, cancel all active directory connections for the specific descriptor we are about to upload. Note that this race is still possible on the HSDir side which triggers a log info to be printed out but that is fine. Fixes #23457 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_client.c')
-rw-r--r--src/or/hs_client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/hs_client.c b/src/or/hs_client.c
index f85ebc8473..2f8953ba78 100644
--- a/src/or/hs_client.c
+++ b/src/or/hs_client.c
@@ -156,7 +156,8 @@ directory_launch_v3_desc_fetch(const ed25519_public_key_t *onion_identity_pk,
}
/* Copy onion pk to a dir_ident so that we attach it to the dir conn */
- ed25519_pubkey_copy(&hs_conn_dir_ident.identity_pk, onion_identity_pk);
+ hs_ident_dir_conn_init(onion_identity_pk, &blinded_pubkey,
+ &hs_conn_dir_ident);
/* Setup directory request */
directory_request_t *req =