diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-01-06 15:37:51 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-01-06 15:37:51 +0000 |
commit | 9abfb564a04b498ae25a63746c72a21ee7f2dbc8 (patch) | |
tree | d970accb0a0035a61cbb0579565be99d8b6aa9cc /src | |
parent | d95b63f1e4492507b1950d74f7ec845a6786d80e (diff) | |
download | tor-9abfb564a04b498ae25a63746c72a21ee7f2dbc8.tar.gz tor-9abfb564a04b498ae25a63746c72a21ee7f2dbc8.zip |
Make dirserv_get_routerdesc_fingerprints() treat extrainfos with send_unencrypted==0 correctly. Irrelevant, since we will soon never send them at all.
svn:r17953
Diffstat (limited to 'src')
-rw-r--r-- | src/or/directory.c | 3 | ||||
-rw-r--r-- | src/or/dirserv.c | 15 | ||||
-rw-r--r-- | src/or/or.h | 3 |
3 files changed, 14 insertions, 7 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index d628035bb0..4baee04045 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -2708,7 +2708,8 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers, conn->fingerprint_stack = smartlist_create(); res = dirserv_get_routerdesc_fingerprints(conn->fingerprint_stack, url, &msg, - !connection_dir_is_encrypted(conn)); + !connection_dir_is_encrypted(conn), + is_extra); if (!strcmpstart(url, "fp/")) { request_type = compressed?"/tor/server/fp.z":"/tor/server/fp"; diff --git a/src/or/dirserv.c b/src/or/dirserv.c index eff0a380dc..2647fe275c 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2680,7 +2680,8 @@ dirserv_get_networkstatus_v2(smartlist_t *result, */ int dirserv_get_routerdesc_fingerprints(smartlist_t *fps_out, const char *key, - const char **msg, int for_unencrypted_conn) + const char **msg, int for_unencrypted_conn, + int is_extrainfo) { int by_id = 1; *msg = NULL; @@ -2708,11 +2709,15 @@ dirserv_get_routerdesc_fingerprints(smartlist_t *fps_out, const char *key, } if (for_unencrypted_conn) { - /* Remove anything whose purpose isn't general. */ + /* Remove anything that insists it not be sent unencrypted. */ SMARTLIST_FOREACH(fps_out, char *, cp, { - signed_descriptor_t *sd = - by_id ? get_signed_descriptor_by_fp(cp,0,0) : - router_get_by_descriptor_digest(cp); + signed_descriptor_t *sd; + if (by_id) + sd = get_signed_descriptor_by_fp(cp,is_extrainfo,0); + else if (is_extrainfo) + sd = extrainfo_get_by_descriptor_digest(cp); + else + sd = router_get_by_descriptor_digest(cp); if (sd && !sd->send_unencrypted) { tor_free(cp); SMARTLIST_DEL_CURRENT(fps_out, cp); diff --git a/src/or/or.h b/src/or/or.h index 765669aa2e..de1db89390 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -3467,7 +3467,8 @@ void dirserv_get_networkstatus_v2_fingerprints(smartlist_t *result, const char *key); int dirserv_get_routerdesc_fingerprints(smartlist_t *fps_out, const char *key, const char **msg, - int for_unencrypted_conn); + int for_unencrypted_conn, + int is_extrainfo); int dirserv_get_routerdescs(smartlist_t *descs_out, const char *key, const char **msg); void dirserv_orconn_tls_done(const char *address, |