summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/auth_dirs.inc4
-rw-r--r--src/or/config.c9
-rw-r--r--src/or/dirserv.c43
-rw-r--r--src/or/dirserv.h3
-rw-r--r--src/or/dirvote.c9
5 files changed, 56 insertions, 12 deletions
diff --git a/src/or/auth_dirs.inc b/src/or/auth_dirs.inc
index e0937541ea..08a919b053 100644
--- a/src/or/auth_dirs.inc
+++ b/src/or/auth_dirs.inc
@@ -8,8 +8,8 @@
"dizum orport=443 "
"v3ident=E8A9C45EDE6D711294FADF8E7951F4DE6CA56B58 "
"194.109.206.212:80 7EA6 EAD6 FD83 083C 538F 4403 8BBF A077 587D D755",
-"Bifroest orport=443 bridge "
- "37.218.247.217:80 1D8F 3A91 C37C 5D1C 4C19 B1AD 1D0C FBE8 BF72 D8E1",
+"Serge orport=9001 bridge "
+ "66.111.2.131:9030 BA44 A889 E64B 93FA A2B1 14E0 2C2A 279A 8555 C533",
"gabelmoo orport=443 "
"v3ident=ED03BB616EB2F60BEC80151114BB25CEF515B226 "
"ipv6=[2001:638:a000:4140::ffff:189]:443 "
diff --git a/src/or/config.c b/src/or/config.c
index 79cfcb4111..8f4b5ab5a1 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -3295,6 +3295,14 @@ options_validate(or_options_t *old_options, or_options_t *options,
!options->RecommendedServerVersions))
REJECT("Versioning authoritative dir servers must set "
"Recommended*Versions.");
+
+ char *t;
+ /* Call these functions to produce warnings only. */
+ t = format_recommended_version_list(options->RecommendedClientVersions, 1);
+ tor_free(t);
+ t = format_recommended_version_list(options->RecommendedServerVersions, 1);
+ tor_free(t);
+
if (options->UseEntryGuards) {
log_info(LD_CONFIG, "Authoritative directory servers can't set "
"UseEntryGuards. Disabling.");
@@ -8278,4 +8286,3 @@ init_cookie_authentication(const char *fname, const char *header,
tor_free(cookie_file_str);
return retval;
}
-
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 95bef9889d..08557a6a10 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -74,7 +74,6 @@
static int routers_with_measured_bw = 0;
static void directory_remove_invalid(void);
-static char *format_versions_list(config_line_t *ln);
struct authdir_config_t;
static uint32_t
dirserv_get_status_impl(const char *fp, const char *nickname,
@@ -1061,8 +1060,8 @@ list_server_status_v1(smartlist_t *routers, char **router_status_out,
* allocate and return a new string containing the version numbers, in order,
* separated by commas. Used to generate Recommended(Client|Server)?Versions
*/
-static char *
-format_versions_list(config_line_t *ln)
+char *
+format_recommended_version_list(const config_line_t *ln, int warn)
{
smartlist_t *versions;
char *result;
@@ -1071,6 +1070,37 @@ format_versions_list(config_line_t *ln)
smartlist_split_string(versions, ln->value, ",",
SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
}
+
+ /* Handle the case where a dirauth operator has accidentally made some
+ * versions space-separated instead of comma-separated. */
+ smartlist_t *more_versions = smartlist_new();
+ SMARTLIST_FOREACH_BEGIN(versions, char *, v) {
+ if (strchr(v, ' ')) {
+ if (warn)
+ log_warn(LD_DIRSERV, "Unexpected space in versions list member %s. "
+ "(These are supposed to be comma-separated; I'll pretend you "
+ "used commas instead.)", escaped(v));
+ SMARTLIST_DEL_CURRENT(versions, v);
+ smartlist_split_string(more_versions, v, NULL,
+ SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
+ tor_free(v);
+ }
+ } SMARTLIST_FOREACH_END(v);
+ smartlist_add_all(versions, more_versions);
+ smartlist_free(more_versions);
+
+ /* Check to make sure everything looks like a version. */
+ if (warn) {
+ SMARTLIST_FOREACH_BEGIN(versions, const char *, v) {
+ tor_version_t ver;
+ if (tor_version_parse(v, &ver) < 0) {
+ log_warn(LD_DIRSERV, "Recommended version %s does not look valid. "
+ " (I'll include it anyway, since you told me to.)",
+ escaped(v));
+ }
+ } SMARTLIST_FOREACH_END(v);
+ }
+
sort_version_list(versions, 1);
result = smartlist_join_strings(versions,",",0,NULL);
SMARTLIST_FOREACH(versions,char *,s,tor_free(s));
@@ -2891,8 +2921,10 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
}
if (options->VersioningAuthoritativeDir) {
- client_versions = format_versions_list(options->RecommendedClientVersions);
- server_versions = format_versions_list(options->RecommendedServerVersions);
+ client_versions =
+ format_recommended_version_list(options->RecommendedClientVersions, 0);
+ server_versions =
+ format_recommended_version_list(options->RecommendedServerVersions, 0);
}
contact = get_options()->ContactInfo;
@@ -4035,4 +4067,3 @@ dirserv_free_all(void)
dirserv_clear_measured_bw_cache();
}
-
diff --git a/src/or/dirserv.h b/src/or/dirserv.h
index 46967a6cb2..5f195442ce 100644
--- a/src/or/dirserv.h
+++ b/src/or/dirserv.h
@@ -154,7 +154,7 @@ char *routerstatus_format_entry(
void dirserv_free_all(void);
void cached_dir_decref(cached_dir_t *d);
cached_dir_t *new_cached_dir(char *s, time_t published);
-
+char *format_recommended_version_list(const config_line_t *line, int warn);
int validate_recommended_package_line(const char *line);
#ifdef DIRSERV_PRIVATE
@@ -205,4 +205,3 @@ void dirserv_spool_sort(dir_connection_t *conn);
void dir_conn_clear_spool(dir_connection_t *conn);
#endif /* !defined(TOR_DIRSERV_H) */
-
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index ce82a5ef4a..fbd112d488 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -705,6 +705,14 @@ compute_consensus_versions_list(smartlist_t *lst, int n_versioning)
int min = n_versioning / 2;
smartlist_t *good = smartlist_new();
char *result;
+ SMARTLIST_FOREACH_BEGIN(lst, const char *, v) {
+ if (strchr(v, ' ')) {
+ log_warn(LD_DIR, "At least one authority has voted for a version %s "
+ "that contains a space. This probably wasn't intentional, and "
+ "is likely to cause trouble. Please tell them to stop it.",
+ escaped(v));
+ }
+ } SMARTLIST_FOREACH_END(v);
sort_version_list(lst, 0);
get_frequent_members(good, lst, min);
result = smartlist_join_strings(good, ",", 0, NULL);
@@ -4057,4 +4065,3 @@ vote_routerstatus_find_microdesc_hash(char *digest256_out,
}
return -1;
}
-