Merge branch 'maint-0.2.2' into release-0.2.2

This commit is contained in:
Roger Dingledine 2011-11-20 15:08:07 -05:00
commit 509d7e02e9
20 changed files with 3409 additions and 1809 deletions

4
changes/bug4349 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes:
- When sending a NETINFO cell, include the original address
received for the other side, not its canonical address. Found
by "troll_un"; fixes bug 4349; bugfix on 0.2.0.10-alpha.

7
changes/bug4353 Normal file
View File

@ -0,0 +1,7 @@
o Minor bugfixes:
- When running as client without a geoip database, do not print a
misleading (and plain wrong) log message that we're collecting
dirreq statistics - we're not collecting statistics as clients.
Also don't create a useless (because empty) stats file in the
stats/ directory. Fixes bug 4353, bugfix on 0.2.2.34.

5
changes/bug4383 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes:
- Fix a memleak in launch_direct_bridge_descriptor_fetch() that
occured when a client tried to fetch a descriptor for a bridge
in ExcludeNodes. Fixes #4383; bugfix on 0.2.2.25-alpha.

5
changes/bug4410 Normal file
View File

@ -0,0 +1,5 @@
o Major bugfixes:
- Correctly sanity-check that we don't underflow on a memory allocation
for introduction point decryption. Bug discovered by Dan Rosenberg.
Fixes bug 4410; bugfix on 0.2.1.5-alpha.

6
changes/bug4424 Normal file
View File

@ -0,0 +1,6 @@
o Major bugfixes
- Don't leak memory when we check whether a hidden service
descriptor has any usable introduction points left. Fixes bug
4424. Bugfix on 0.2.2.25-alpha.

8
changes/bug4426 Normal file
View File

@ -0,0 +1,8 @@
o Minor features:
- When Tor ignores a hidden service specified in its
configuration, include the hidden service's directory in the
warning message. Previously, we would only tell the user that
some hidden service was ignored. Bugfix on 0.0.6; fixes bug
4426.

5
changes/bug4437 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes:
- Don't warn about unused log_mutex in log.c when building with
--disable-threads using a recent GCC. Fixes bug 4437; bugfix on
0.1.0.6-rc which introduced --disable-threads.

9
changes/bug4457 Normal file
View File

@ -0,0 +1,9 @@
o Minor bugfixes:
- Initialize Libevent with the EVENT_BASE_FLAG_NOLOCK flag enabled, so
that it doesn't attempt to allocate a socketpair. This could cause
some problems on windows systems with overzealous firewalls. Fix for
bug 4457; workaround for Libevent versions 2.0.1-alpha through
2.0.15-stable.
- Detect failure to initialize Libevent. Better detection for bug 4457.

View File

@ -0,0 +1,3 @@
o Minor features:
- Update to the November 1 2011 Maxmind GeoLite Country database.

4
changes/win-bundle-path Normal file
View File

@ -0,0 +1,4 @@
o Packaging changes:
- Remove absolute path from makensis.exe command to build Tor expert bundle
in order to make it easier to automate package builds

View File

@ -91,5 +91,5 @@ clean_localstatedir src/config/torrc.sample.in win_tmp/src/config/torrc.sample
cp contrib/tor-mingw.nsi.in win_tmp/contrib/
cd win_tmp
"C:\Program Files\NSIS\makensis.exe" contrib/tor-mingw.nsi.in
makensis.exe contrib/tor-mingw.nsi.in

View File

@ -177,6 +177,10 @@ extern INLINE double U64_TO_DBL(uint64_t x) {
/** Expands to a syntactically valid empty statement. */
#define STMT_NIL (void)0
/** Expands to a syntactically valid empty statement, explicitly (void)ing its
* argument. */
#define STMT_VOID(a) while (0) { (void)(a); }
#ifdef __GNUC__
/** STMT_BEGIN and STMT_END are used to wrap blocks inside macros so that
* the macro can be used as if it were a single C statement. */
@ -610,7 +614,7 @@ void tor_threads_init(void);
#else
#define tor_mutex_new() ((tor_mutex_t*)tor_malloc(sizeof(int)))
#define tor_mutex_init(m) STMT_NIL
#define tor_mutex_acquire(m) STMT_NIL
#define tor_mutex_acquire(m) STMT_VOID(m)
#define tor_mutex_release(m) STMT_NIL
#define tor_mutex_free(m) STMT_BEGIN tor_free(m); STMT_END
#define tor_mutex_uninit(m) STMT_NIL

View File

@ -177,11 +177,28 @@ tor_libevent_initialize(void)
#endif
#ifdef HAVE_EVENT2_EVENT_H
the_event_base = event_base_new();
{
struct event_config *cfg = event_config_new();
tor_assert(cfg);
/* In 0.2.2, we don't use locking at all. Telling Libevent not to try to
* turn it on can avoid a needless socketpair() attempt.
*/
event_config_set_flag(cfg, EVENT_BASE_FLAG_NOLOCK);
the_event_base = event_base_new_with_config(cfg);
event_config_free(cfg);
}
#else
the_event_base = event_init();
#endif
if (!the_event_base) {
log_err(LD_GENERAL, "Unable to initialize Libevent: cannot continue.");
exit(1);
}
#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD)
/* Making this a NOTICE for now so we can link bugs to a libevent versions
* or methods better. */

File diff suppressed because it is too large Load Diff

View File

@ -4670,7 +4670,6 @@ launch_direct_bridge_descriptor_fetch(bridge_info_t *bridge)
DIR_PURPOSE_FETCH_SERVERDESC))
return; /* it's already on the way */
address = tor_dup_addr(&bridge->addr);
if (routerset_contains_bridge(options->ExcludeNodes, bridge)) {
download_status_mark_impossible(&bridge->fetch_status);
log_warn(LD_APP, "Not using bridge at %s: it is in ExcludeNodes.",
@ -4678,6 +4677,8 @@ launch_direct_bridge_descriptor_fetch(bridge_info_t *bridge)
return;
}
address = tor_dup_addr(&bridge->addr);
directory_initiate_command(address, &bridge->addr,
bridge->port, 0,
0, /* does not matter */

View File

@ -1414,6 +1414,15 @@ options_act(or_options_t *old_options)
options->EntryStatistics || options->ExitPortStatistics) {
time_t now = time(NULL);
int print_notice = 0;
/* If we aren't acting as a server, we can't collect stats anyway. */
if (!server_mode(options)) {
options->CellStatistics = 0;
options->DirReqStatistics = 0;
options->EntryStatistics = 0;
options->ExitPortStatistics = 0;
}
if ((!old_options || !old_options->CellStatistics) &&
options->CellStatistics) {
rep_hist_buffer_stats_init(now);

View File

@ -1410,7 +1410,7 @@ connection_or_send_netinfo(or_connection_t *conn)
/* Their address. */
out = cell.payload + 4;
len = append_address_to_payload(out, &conn->_base.addr);
len = append_address_to_payload(out, &conn->real_addr);
if (len<0)
return -1;
out += len;

View File

@ -952,8 +952,13 @@ rend_client_get_random_intro_impl(const rend_cache_entry_t *entry,
int
rend_client_any_intro_points_usable(const rend_cache_entry_t *entry)
{
return rend_client_get_random_intro_impl(
entry, get_options()->StrictNodes, 0) != NULL;
extend_info_t *extend_info =
rend_client_get_random_intro_impl(entry, get_options()->StrictNodes, 0);
int rv = (extend_info != NULL);
extend_info_free(extend_info);
return rv;
}
/** Client-side authorizations for hidden services; map of onion address to

View File

@ -171,14 +171,17 @@ rend_add_service(rend_service_t *service)
if (service->auth_type != REND_NO_AUTH &&
smartlist_len(service->clients) == 0) {
log_warn(LD_CONFIG, "Hidden service with client authorization but no "
"clients; ignoring.");
log_warn(LD_CONFIG, "Hidden service (%s) with client authorization but no "
"clients; ignoring.",
esc_for_log(service->directory));
rend_service_free(service);
return;
}
if (!smartlist_len(service->ports)) {
log_warn(LD_CONFIG, "Hidden service with no ports configured; ignoring.");
log_warn(LD_CONFIG, "Hidden service (%s) with no ports configured; "
"ignoring.",
esc_for_log(service->directory));
rend_service_free(service);
} else {
int dupe = 0;

View File

@ -4874,6 +4874,11 @@ rend_decrypt_introduction_points(char **ipos_decrypted,
crypto_cipher_env_t *cipher;
char *dec;
int declen;
if (ipos_encrypted_size < CIPHER_IV_LEN + 2) {
log_warn(LD_REND, "Size of encrypted introduction points is too "
"small.");
return -1;
}
dec = tor_malloc_zero(ipos_encrypted_size - CIPHER_IV_LEN - 1);
cipher = crypto_create_init_cipher(descriptor_cookie, 0);
declen = crypto_cipher_decrypt_with_iv(cipher, dec,