From 04263648c422af07489a1c55c1972dc91207de46 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 10 Jan 2008 17:48:40 +0000 Subject: r17554@catbus: nickm | 2008-01-10 12:48:29 -0500 Do not send bridge descriptors over unencrypted connections. svn:r13094 --- src/or/routerparse.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/or/routerparse.c') diff --git a/src/or/routerparse.c b/src/or/routerparse.c index eb7949000..19fbf9fa4 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -1172,6 +1172,8 @@ router_parse_entry_from_string(const char *s, const char *end, } else { router->purpose = ROUTER_PURPOSE_GENERAL; } + router->cache_info.send_unencrypted = + (router->purpose == ROUTER_PURPOSE_GENERAL) ? 1 : 0; if ((tok = find_first_by_keyword(tokens, K_UPTIME))) { tor_assert(tok->n_args >= 1); @@ -1326,7 +1328,7 @@ extrainfo_parse_entry_from_string(const char *s, const char *end, smartlist_t *tokens = NULL; directory_token_t *tok; crypto_pk_env_t *key = NULL; - routerinfo_t *router; + routerinfo_t *router = NULL; if (!end) { end = s + strlen(s); @@ -1405,6 +1407,9 @@ extrainfo_parse_entry_from_string(const char *s, const char *end, if (check_signature_token(digest, tok, key, 0, "extra-info") < 0) goto err; + if (router) + extrainfo->cache_info.send_unencrypted = + router->cache_info.send_unencrypted; } else { extrainfo->pending_sig = tor_memdup(tok->object_body, tok->object_size); -- cgit v1.2.3