diff options
author | David Goulet <dgoulet@torproject.org> | 2017-09-11 13:16:23 -0400 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2017-09-12 01:32:04 +0300 |
commit | 7150214baf2385d0e64fd11fe4138932675d444f (patch) | |
tree | 3379659d49978f1b43f6a54f4d69e752a4378f4b /src/or/hs_ident.h | |
parent | 67a5d4cb60a9f27e981b83195cf47183a7e9abcc (diff) | |
download | tor-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_ident.h')
-rw-r--r-- | src/or/hs_ident.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/hs_ident.h b/src/or/hs_ident.h index cfcde781d1..101c1cfffd 100644 --- a/src/or/hs_ident.h +++ b/src/or/hs_ident.h @@ -96,6 +96,11 @@ typedef struct hs_ident_dir_conn_t { * in the onion address. */ ed25519_public_key_t identity_pk; + /* The blinded public key used to uniquely identify the descriptor that this + * directory connection identifier is for. Only used by the service-side code + * to fine control descriptor uploads. */ + ed25519_public_key_t blinded_pk; + /* XXX: Client authorization. */ } hs_ident_dir_conn_t; @@ -120,6 +125,9 @@ hs_ident_circuit_t *hs_ident_circuit_dup(const hs_ident_circuit_t *src); /* Directory connection identifier API. */ hs_ident_dir_conn_t *hs_ident_dir_conn_dup(const hs_ident_dir_conn_t *src); void hs_ident_dir_conn_free(hs_ident_dir_conn_t *ident); +void hs_ident_dir_conn_init(const ed25519_public_key_t *identity_pk, + const ed25519_public_key_t *blinded_pk, + hs_ident_dir_conn_t *ident); /* Edge connection identifier API. */ hs_ident_edge_conn_t *hs_ident_edge_conn_new( |