From 7150214baf2385d0e64fd11fe4138932675d444f Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 11 Sep 2017 13:16:23 -0400 Subject: 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 --- src/or/hs_client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/or/hs_client.c') 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 = -- cgit v1.2.3-54-g00ecf