[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Fix bug in upload/download of hsdesc with microdescs
commit b8943461c0d26074522f905eba862bd9caab591b
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Fri Jul 15 18:53:29 2011 -0400
Fix bug in upload/download of hsdesc with microdescs
Previously we were using router_get_by_id(foo) to test "do we have a
descriptor that will let us make an anonymous circuit to foo". But
that isn't right for microdescs: we should have been using node_t.
Fixes bug 3601; bugfix on 0.2.3.1-alpha.
---
changes/bug3601 | 4 ++++
src/or/rendclient.c | 9 +++++----
src/or/rendservice.c | 4 +++-
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/changes/bug3601 b/changes/bug3601
new file mode 100644
index 0000000..36686a4
--- /dev/null
+++ b/changes/bug3601
@@ -0,0 +1,4 @@
+ o Major bugfixes:
+ - Using microdescriptors no longer prevents Tor from uploading and
+ downloading hidden service descriptors. Fixes bug 3601; bugfix
+ on 0.2.3.1-alpha.
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 5164559..413d9b7 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -510,10 +510,11 @@ directory_get_from_hs_dir(const char *desc_id, const rend_data_t *rend_query)
directory_clean_last_hid_serv_requests(now);
SMARTLIST_FOREACH(responsible_dirs, routerstatus_t *, dir, {
- if (lookup_last_hid_serv_request(dir, desc_id_base32, 0, 0) +
- REND_HID_SERV_DIR_REQUERY_PERIOD >= now ||
- !router_get_by_id_digest(dir->identity_digest))
- SMARTLIST_DEL_CURRENT(responsible_dirs, dir);
+ time_t last = lookup_last_hid_serv_request(dir, desc_id_base32, 0, 0);
+ const node_t *node = node_get_by_id(dir->identity_digest);
+ if (last + REND_HID_SERV_DIR_REQUERY_PERIOD >= now ||
+ !node || !node_has_descriptor(node))
+ SMARTLIST_DEL_CURRENT(responsible_dirs, dir);
});
hs_dir = smartlist_choose(responsible_dirs);
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 47a9fc7..5888e39 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1632,12 +1632,14 @@ directory_post_to_hs_dir(rend_service_descriptor_t *renddesc,
for (j = 0; j < smartlist_len(responsible_dirs); j++) {
char desc_id_base32[REND_DESC_ID_V2_LEN_BASE32 + 1];
char *hs_dir_ip;
+ const node_t *node;
hs_dir = smartlist_get(responsible_dirs, j);
if (smartlist_digest_isin(renddesc->successful_uploads,
hs_dir->identity_digest))
/* Don't upload descriptor if we succeeded in doing so last time. */
continue;
- if (!router_get_by_id_digest(hs_dir->identity_digest)) {
+ node = node_get_by_id(hs_dir->identity_digest);
+ if (!node || !node_has_descriptor(node)) {
log_info(LD_REND, "Not sending publish request for v2 descriptor to "
"hidden service directory %s; we don't have its "
"router descriptor. Queuing for later upload.",
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits