diff options
author | David Goulet <dgoulet@torproject.org> | 2017-04-25 11:55:44 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-05-01 15:50:38 -0400 |
commit | 90562fc23a7ce61f3660b507d9991a27af2eae37 (patch) | |
tree | 487fbbad1bcbbcd8772f7a4b721054875c78ab12 /src/or/rendclient.c | |
parent | 43db91bd87a6f197a93285a87df473616cc1f6c2 (diff) | |
download | tor-90562fc23a7ce61f3660b507d9991a27af2eae37.tar.gz tor-90562fc23a7ce61f3660b507d9991a27af2eae37.zip |
hs: Trigger control event when client can't pick HSDir
Inform the control port with an HS_DESC failed event when the client is unable
to pick an HSDir. It's followed by an empty HS_DESC_CONTENT event. In order to
achieve that, some control port code had to be modified to accept a NULL HSDir
identity digest.
This commit also adds a trigger of a failed event when we are unable to
base64-decode the descriptor cookie.
Fixes #22042
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r-- | src/or/rendclient.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 8d2ae03c9e..88bd5cd39e 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -724,6 +724,9 @@ directory_get_from_hs_dir(const char *desc_id, hs_dir = pick_hsdir(desc_id, desc_id_base32); if (!hs_dir) { /* No suitable hs dir can be found, stop right now. */ + control_event_hs_descriptor_failed(rend_query, NULL, "QUERY_NO_HSDIR"); + control_event_hs_descriptor_content(rend_data_get_address(rend_query), + desc_id_base32, NULL, NULL); return 0; } } @@ -744,6 +747,9 @@ directory_get_from_hs_dir(const char *desc_id, REND_DESC_COOKIE_LEN, 0)<0) { log_warn(LD_BUG, "Could not base64-encode descriptor cookie."); + control_event_hs_descriptor_failed(rend_query, hsdir_fp, "BAD_DESC"); + control_event_hs_descriptor_content(rend_data_get_address(rend_query), + desc_id_base32, hsdir_fp, NULL); return 0; } /* Remove == signs. */ |