Merge branch 'maint-0.2.7' into release-0.2.7

This commit is contained in:
Nick Mathewson 2016-07-05 12:25:24 -04:00
commit 31f17cb1de
17 changed files with 3575 additions and 1217 deletions

View File

@ -106,7 +106,7 @@ test-network: need-chutney-path all
test-network-all: need-chutney-path all test-driver
mkdir -p $(TEST_NETWORK_ALL_LOG_DIR)
@flavors="$(TEST_CHUTNEY_FLAVORS)"; \
if ping6 -q -o ::1 >/dev/null 2>&1; then \
if ping6 -q -c 1 -o ::1 >/dev/null 2>&1; then \
echo "ping6 ::1 succeeded, running IPv6 flavors: $(TEST_CHUTNEY_FLAVORS_IPV6)."; \
flavors="$$flavors $(TEST_CHUTNEY_FLAVORS_IPV6)"; \
else \

7
changes/bug18841.1 Normal file
View File

@ -0,0 +1,7 @@
o Major bugfixes (compilation):
- Correctly detect compiler flags on systems where _FORTIFY_SOURCE
is predefined. Previously, our use of -D_FORTIFY_SOURCE would
cause a compiler warning, thereby making other checks fail.
Fixes one case of bug 18841; bugfix on 0.2.3.17-beta. Patch from
"trudokal".

4
changes/bug18977 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes (time handling):
- When correcting a corrupt 'struct tm' value, fill in the tm_wday
field. Otherwise, our unit tests crash on Windows.
Fixes bug 18977; bugfix on 0.2.2.25-alpha.

3
changes/bug19008 Normal file
View File

@ -0,0 +1,3 @@
o Major bugfixes (testing):
- Fix a bug that would block 'make test-network-all' on systems
where IPv6 packets were lost. Fixes bug 19008; bugfix on tor-0.2.7.3-rc.

4
changes/bug19032 Normal file
View File

@ -0,0 +1,4 @@
o Major bugfixes (security, directory authorities):
- Fix a crash and out-of-bounds write during authority voting, when the
list of relays includes duplicate ed25519 identity keys. Fixes bug 19032;
bugfix on 0.2.8.2-alpha.

3
changes/bug19213 Normal file
View File

@ -0,0 +1,3 @@
o Minor bugfixes (compilation):
- Cause the unit tests to compile correctly on mingw64 versions
that lack sscanf. Fixes bug 19213. Bugfix on 0.2.7.1-alpha.

4
changes/geoip-jun2016 Normal file
View File

@ -0,0 +1,4 @@
o Minor features:
- Update geoip and geoip6 to the June 7 2016 Maxmind GeoLite2
Country database.

View File

@ -718,7 +718,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
#endif])], have_clang=yes, have_clang=no)
if test x$enable_gcc_hardening != xno; then
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
if test x$have_clang = xyes; then
TOR_CHECK_CFLAGS(-Qunused-arguments)
fi

View File

@ -2766,6 +2766,7 @@ correct_tm(int islocal, const time_t *timep, struct tm *resultbuf,
r->tm_mon = 11;
r->tm_mday = 31;
r->tm_yday = 364;
r->tm_wday = 6;
r->tm_hour = 23;
r->tm_min = 59;
r->tm_sec = 59;
@ -2774,6 +2775,7 @@ correct_tm(int islocal, const time_t *timep, struct tm *resultbuf,
r->tm_mon = 0;
r->tm_mday = 1;
r->tm_yday = 0;
r->tm_wday = 0;
r->tm_hour = 0;
r->tm_min = 0;
r->tm_sec = 0;
@ -2791,6 +2793,7 @@ correct_tm(int islocal, const time_t *timep, struct tm *resultbuf,
r->tm_mon = 0;
r->tm_mday = 1;
r->tm_yday = 0;
r->tm_wday = 0;
r->tm_hour = 0;
r->tm_min = 0 ;
r->tm_sec = 0;
@ -2804,6 +2807,7 @@ correct_tm(int islocal, const time_t *timep, struct tm *resultbuf,
r->tm_mon = 11;
r->tm_mday = 31;
r->tm_yday = 364;
r->tm_wday = 6;
r->tm_hour = 23;
r->tm_min = 59;
r->tm_sec = 59;

View File

@ -1676,6 +1676,7 @@ parse_iso_time_(const char *cp, time_t *t, int strict)
st_tm.tm_hour = hour;
st_tm.tm_min = minute;
st_tm.tm_sec = second;
st_tm.tm_wday = 0; /* Should be ignored. */
if (st_tm.tm_year < 70) {
char *esc = esc_for_log(cp);
@ -1743,6 +1744,7 @@ parse_http_time(const char *date, struct tm *tm)
tm->tm_hour = (int)tm_hour;
tm->tm_min = (int)tm_min;
tm->tm_sec = (int)tm_sec;
tm->tm_wday = 0; /* Leave this unset. */
month[3] = '\0';
/* Okay, now decode the month. */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -877,9 +877,6 @@ static const char *default_authorities[] = {
"dannenberg orport=443 "
"v3ident=0232AF901C31A04EE9848595AF9BB7620D4C5B2E "
"193.23.244.244:80 7BE6 83E6 5D48 1413 21C5 ED92 F075 C553 64AC 7123",
"urras orport=80 "
"v3ident=80550987E1D626E3EBA5E5E75A458DE0626D088C "
"208.83.223.34:443 0AD3 FA88 4D18 F89E EA2D 89C0 1937 9E0E 7FD9 4417",
"maatuska orport=80 "
"v3ident=49015F787433103580E3B66A1707A00E60F2D15B "
"171.25.193.9:443 BD6A 8292 55CB 08E6 6FBE 7D37 4836 3586 E46B 3810",

View File

@ -1422,13 +1422,13 @@ router_counts_toward_thresholds(const node_t *node, time_t now,
*
* Also, set the is_exit flag of each router appropriately. */
static void
dirserv_compute_performance_thresholds(const smartlist_t *routers,
digestmap_t *omit_as_sybil)
dirserv_compute_performance_thresholds(digestmap_t *omit_as_sybil)
{
int n_active, n_active_nonexit, n_familiar;
uint32_t *uptimes, *bandwidths_kb, *bandwidths_excluding_exits_kb;
long *tks;
double *mtbfs, *wfus;
smartlist_t *nodelist;
time_t now = time(NULL);
const or_options_t *options = get_options();
@ -1446,27 +1446,28 @@ dirserv_compute_performance_thresholds(const smartlist_t *routers,
guard_tk = 0;
guard_wfu = 0;
nodelist_assert_ok();
nodelist = nodelist_get_list();
/* Initialize arrays that will hold values for each router. We'll
* sort them and use that to compute thresholds. */
n_active = n_active_nonexit = 0;
/* Uptime for every active router. */
uptimes = tor_calloc(smartlist_len(routers), sizeof(uint32_t));
uptimes = tor_calloc(smartlist_len(nodelist), sizeof(uint32_t));
/* Bandwidth for every active router. */
bandwidths_kb = tor_calloc(smartlist_len(routers), sizeof(uint32_t));
bandwidths_kb = tor_calloc(smartlist_len(nodelist), sizeof(uint32_t));
/* Bandwidth for every active non-exit router. */
bandwidths_excluding_exits_kb =
tor_calloc(smartlist_len(routers), sizeof(uint32_t));
tor_calloc(smartlist_len(nodelist), sizeof(uint32_t));
/* Weighted mean time between failure for each active router. */
mtbfs = tor_calloc(smartlist_len(routers), sizeof(double));
mtbfs = tor_calloc(smartlist_len(nodelist), sizeof(double));
/* Time-known for each active router. */
tks = tor_calloc(smartlist_len(routers), sizeof(long));
tks = tor_calloc(smartlist_len(nodelist), sizeof(long));
/* Weighted fractional uptime for each active router. */
wfus = tor_calloc(smartlist_len(routers), sizeof(double));
nodelist_assert_ok();
wfus = tor_calloc(smartlist_len(nodelist), sizeof(double));
/* Now, fill in the arrays. */
SMARTLIST_FOREACH_BEGIN(nodelist_get_list(), node_t *, node) {
SMARTLIST_FOREACH_BEGIN(nodelist, node_t *, node) {
if (options->BridgeAuthoritativeDir &&
node->ri &&
node->ri->purpose != ROUTER_PURPOSE_BRIDGE)
@ -1542,7 +1543,7 @@ dirserv_compute_performance_thresholds(const smartlist_t *routers,
* fill wfus with the wfu of every such "familiar" router. */
n_familiar = 0;
SMARTLIST_FOREACH_BEGIN(nodelist_get_list(), node_t *, node) {
SMARTLIST_FOREACH_BEGIN(nodelist, node_t *, node) {
if (router_counts_toward_thresholds(node, now,
omit_as_sybil, require_mbw)) {
routerinfo_t *ri = node->ri;
@ -1596,11 +1597,10 @@ dirserv_compute_performance_thresholds(const smartlist_t *routers,
* networkstatus_getinfo_by_purpose().
*/
void
dirserv_compute_bridge_flag_thresholds(const smartlist_t *routers)
dirserv_compute_bridge_flag_thresholds(void)
{
digestmap_t *omit_as_sybil = digestmap_new();
dirserv_compute_performance_thresholds(routers, omit_as_sybil);
dirserv_compute_performance_thresholds(omit_as_sybil);
digestmap_free(omit_as_sybil, NULL);
}
@ -2870,7 +2870,7 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
* this must come before dirserv_compute_performance_thresholds() */
dirserv_count_measured_bws(routers);
dirserv_compute_performance_thresholds(routers, omit_as_sybil);
dirserv_compute_performance_thresholds(omit_as_sybil);
routerstatuses = smartlist_new();
microdescriptors = smartlist_new();

View File

@ -50,7 +50,7 @@ int list_server_status_v1(smartlist_t *routers, char **router_status_out,
int dirserv_dump_directory_to_string(char **dir_out,
crypto_pk_t *private_key);
char *dirserv_get_flag_thresholds_line(void);
void dirserv_compute_bridge_flag_thresholds(const smartlist_t *routers);
void dirserv_compute_bridge_flag_thresholds(void);
int directory_fetches_from_authorities(const or_options_t *options);
int directory_fetches_dir_info_early(const or_options_t *options);

View File

@ -1697,11 +1697,10 @@ networkstatus_dump_bridge_status_to_file(time_t now)
char *fname = NULL;
char *thresholds = NULL;
char *published_thresholds_and_status = NULL;
routerlist_t *rl = router_get_routerlist();
char published[ISO_TIME_LEN+1];
format_iso_time(published, now);
dirserv_compute_bridge_flag_thresholds(rl->routers);
dirserv_compute_bridge_flag_thresholds();
thresholds = dirserv_get_flag_thresholds_line();
tor_asprintf(&published_thresholds_and_status,
"published %s\nflag-thresholds %s\n%s",

View File

@ -4377,7 +4377,7 @@ test_util_writepid(void *arg)
contents = read_file_to_str(fname, 0, NULL);
tt_assert(contents);
int n = sscanf(contents, "%lu\n%c", &pid, &c);
int n = tor_sscanf(contents, "%lu\n%c", &pid, &c);
tt_int_op(n, OP_EQ, 1);
#ifdef _WIN32