[or-cvs] r17953: {tor} Make dirserv_get_routerdesc_fingerprints() treat extrainfos (tor/trunk/src/or)
nickm at seul.org
nickm at seul.org
Tue Jan 6 15:37:51 UTC 2009
Author: nickm
Date: 2009-01-06 10:37:51 -0500 (Tue, 06 Jan 2009)
New Revision: 17953
Modified:
tor/trunk/src/or/directory.c
tor/trunk/src/or/dirserv.c
tor/trunk/src/or/or.h
Log:
Make dirserv_get_routerdesc_fingerprints() treat extrainfos with send_unencrypted==0 correctly. Irrelevant, since we will soon never send them at all.
Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c 2009-01-06 14:52:19 UTC (rev 17952)
+++ tor/trunk/src/or/directory.c 2009-01-06 15:37:51 UTC (rev 17953)
@@ -2708,7 +2708,8 @@
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";
Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c 2009-01-06 14:52:19 UTC (rev 17952)
+++ tor/trunk/src/or/dirserv.c 2009-01-06 15:37:51 UTC (rev 17953)
@@ -2680,7 +2680,8 @@
*/
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 @@
}
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);
Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h 2009-01-06 14:52:19 UTC (rev 17952)
+++ tor/trunk/src/or/or.h 2009-01-06 15:37:51 UTC (rev 17953)
@@ -3467,7 +3467,8 @@
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,
More information about the tor-commits
mailing list