Question about HS code

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi, I've been trying to get to grips with the hidden service code, and I have a question that I was hoping someone on the list could answer. The constant REND_HID_SERV_DIR_REQUERY_PERIOD is defined as 15 * 60 (15 minutes) in rendclient.c, with the comment "The period for which a hidden service directory cannot be queried for the same descriptor ID again." As far as I can tell, the purpose of this constant is to prevent a client from repeatedly asking an HS directory for a descriptor that the directory doesn't have. However, when a descriptor fetch fails and there's no reusable cached descriptor, rend_client_desc_trynow(query) calls rend_client_note_connection_attempt_ended(onion_address), which calls purge_hid_serv_from_last_hid_serv_requests(onion_address), which (as far as I can tell) forgets which HS directories have been tried for the descriptor, allowing the same directories to be tried again before REND_HID_SERV_DIR_REQUERY_PERIOD elapses. So what's the effect of REND_HID_SERV_DIR_REQUERY_PERIOD? Thanks for any guidance, Michael -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBCAAGBQJThJI1AAoJEBEET9GfxSfMHxwH/3DH2ZpWsmjfu8wX/Zaw2m1T 5NBYhrzpQqJ5C3doVd5cSsCuZINQOG/kHFda3HAf4a0UwANkGZQzSKiB78IXL/VG yEVts1ZpDEF3rtGgnQMBnFQ9JChNzYRuJ5uT+EFJBjW9fgWVuh+8KugNev9wLiR8 V8ayDaekZxUaT11+qEqS974IRI1wWVIzUvGFylMsCsuf/NAKkUalXscOOT3ckKUN g2b1M5f38uzpFqdvRtTIgL/p0dS3JtrrGcuYnwD2+THzeAQpIHGuFPxnbjoauCBd HwyGCo0v3UKr4e00YSKlhJBAZjB2Y41jwi5vasp7IefFvsuVOXfcc8b4BP5Syyk= =d/B4 -----END PGP SIGNATURE-----

On Tue, May 27, 2014 at 9:25 AM, Michael Rogers <michael@briarproject.org> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hi,
I've been trying to get to grips with the hidden service code, and I have a question that I was hoping someone on the list could answer.
The constant REND_HID_SERV_DIR_REQUERY_PERIOD is defined as 15 * 60 (15 minutes) in rendclient.c, with the comment "The period for which a hidden service directory cannot be queried for the same descriptor ID again." As far as I can tell, the purpose of this constant is to prevent a client from repeatedly asking an HS directory for a descriptor that the directory doesn't have.
However, when a descriptor fetch fails and there's no reusable cached descriptor, rend_client_desc_trynow(query) calls rend_client_note_connection_attempt_ended(onion_address), which calls purge_hid_serv_from_last_hid_serv_requests(onion_address), which (as far as I can tell) forgets which HS directories have been tried for the descriptor, allowing the same directories to be tried again before REND_HID_SERV_DIR_REQUERY_PERIOD elapses.
So what's the effect of REND_HID_SERV_DIR_REQUERY_PERIOD?
Hello, Michael! This looks like a possible bug to me. Could you open a ticket at trac.torproject.org? cheers, -- Nick

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 29/05/14 19:36, Nick Mathewson wrote:
So what's the effect of REND_HID_SERV_DIR_REQUERY_PERIOD?
Hello, Michael!
This looks like a possible bug to me. Could you open a ticket at trac.torproject.org?
Hi Nick, Robert Ransom replied off-list explaining the intent of this code. For the sake of the list archives: the constant prevents repeated successful queries to the same HSDir, and repeated unsuccessful queries during a single connection attempt. The rationale for not also using it to limit unsuccessful queries during distinct connection attempts is given in ticket 3335. Cheers, Michael -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBCAAGBQJTjL9CAAoJEBEET9GfxSfMeO8H/jculsD8xuVjYAb/55aOB3qx 8OQ4CCaVYhyCl80rpkN0VnI25eLpRjLxPOuwQE86uBwF4bB2jSaPAXGP42UmMFr8 +SyU8uF/QZxpK9MpB3EJRZ9nArGvLyHLmB5lmakgJJx/oJ4SYW0pBfdnK/7Feq49 RO0bqcZXUtEzQrbGl/u3/RJwuu9V5LAGVAvJgkkIuqnSqF/DFJuKh5Z/VLLQQASy bnS5/794KViNZbDGqBTBSh3ep9BgqgcRONWDdWGOtORyRvHOlfJUsg1wk5TyMlGH 6kWdFTNJNE0VXyndBFJmTBT/mXNyoWP5F/A0hpSC+b2xq7D8LdgMeamIZfZJM10= =6SvT -----END PGP SIGNATURE-----
participants (2)
-
Michael Rogers
-
Nick Mathewson