diff options
author | Micah Elizabeth Scott <beth@torproject.org> | 2023-03-31 13:36:58 -0700 |
---|---|---|
committer | Micah Elizabeth Scott <beth@torproject.org> | 2023-05-10 07:40:46 -0700 |
commit | 903c6cf1ab5ba115bbfd33385e0acd5f88ad2ba3 (patch) | |
tree | cfdc82f2f312dcf7c6567c67958ee2249b2a76d7 /src/feature/hs/hs_circuit.c | |
parent | ac466a22195f8d550a8612bb89583c5e58eadb1a (diff) | |
download | tor-903c6cf1ab5ba115bbfd33385e0acd5f88ad2ba3.tar.gz tor-903c6cf1ab5ba115bbfd33385e0acd5f88ad2ba3.zip |
hs_pow: client side effort adjustment
The goal of this patch is to add an additional mechanism for adjusting
PoW effort upwards, where clients rather than services can choose to
solve their puzzles at a higher effort than what was suggested in the
descriptor.
I wanted to use hs_cache's existing unreachability stats to drive this
effort bump, but this revealed some cases where a circuit (intro or
rend) closed early on can end up in hs_cache with an all zero intro
point key, where nobody will find it. This moves intro_auth_pk
initialization earlier in a couple places and adds nonfatal asserts to
catch the problem if it shows up elsewhere.
The actual effort adjustment method I chose is to multiply the suggested
effort by (1 + unresponsive_count), then ensure the result is at least
1. If a service has suggested effort of 0 but we fail to connect,
retries will all use an effort of 1. If the suggestion was 50, we'll try
50, 100, 150, 200, etc. This is bounded both by our client effort limit
and by the limit on unresponsive_count (currently 5).
Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_circuit.c')
-rw-r--r-- | src/feature/hs/hs_circuit.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c index 92217d760a..d5188b514f 100644 --- a/src/feature/hs/hs_circuit.c +++ b/src/feature/hs/hs_circuit.c @@ -251,6 +251,7 @@ create_intro_circuit_identifier(const hs_service_t *service, ident = hs_ident_circuit_new(&service->keys.identity_pk); ed25519_pubkey_copy(&ident->intro_auth_pk, &ip->auth_key_kp.pubkey); + tor_assert_nonfatal(!ed25519_public_key_is_zero(&ident->intro_auth_pk)); return ident; } |