Merge remote-tracking branch 'origin/maint-0.2.5' into release-0.2.5

This commit is contained in:
Nick Mathewson 2014-09-09 10:52:21 -04:00
commit 04755ff764
10 changed files with 64 additions and 13 deletions

View File

@ -1,6 +1,8 @@
all:
cd src/common
$(MAKE) /F Makefile.nmake
cd ../../src/ext
$(MAKE) /F Makefile.nmake
cd ../../src/or
$(MAKE) /F Makefile.nmake
cd ../../src/test
@ -9,6 +11,8 @@ all:
clean:
cd src/common
$(MAKE) /F Makefile.nmake clean
cd ../../src/ext
$(MAKE) /F Makefile.nmake clean
cd ../../src/or
$(MAKE) /F Makefile.nmake clean
cd ../../src/test

10
changes/bug12700 Normal file
View File

@ -0,0 +1,10 @@
o Minor bugfixes:
- When logging information about an EXTEND2 or EXTENDED2 cell, log
their names correctly. Fixes part of bug 12700; bugfix on
0.2.4.8-alpha.
o Minor bugfixes:
- When logging information about a relay cell whose command we
don't recognize, log its command as an integer. Fixes part of
bug 12700; bugfix on 0.2.1.10-alpha.

3
changes/bug13071 Normal file
View File

@ -0,0 +1,3 @@
o Minor bugfixes (relay):
- Escape all strings from the directory connection before logging them.
Fixes bug 13071; bugfix on 0.1.1.15. Patch from "teor".

3
changes/bug13081 Normal file
View File

@ -0,0 +1,3 @@
o Compilation fixes:
- Make the nmake make files work again. Fixes bug 13081. Bugfix on 0.2.5.1-alpha. Patch
from "NewEraCracker".

View File

@ -1,12 +1,13 @@
all: libor.lib libor-crypto.lib libor-event.lib
CFLAGS = /I ..\win32 /I ..\..\..\build-alpha\include /I ..\ext
CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
/I ..\ext
LIBOR_OBJECTS = address.obj compat.obj container.obj di_ops.obj \
log.obj memarea.obj mempool.obj procmon.obj util.obj \
LIBOR_OBJECTS = address.obj backtrace.obj compat.obj container.obj di_ops.obj \
log.obj memarea.obj mempool.obj procmon.obj sandbox.obj util.obj \
util_codedigest.obj
LIBOR_CRYPTO_OBJECTS = aes.obj crypto.obj torgzip.obj tortls.obj \
LIBOR_CRYPTO_OBJECTS = aes.obj crypto.obj crypto_format.obj torgzip.obj tortls.obj \
crypto_curve25519.obj curve25519-donna.obj
LIBOR_EVENT_OBJECTS = compat_libevent.obj

12
src/ext/Makefile.nmake Normal file
View File

@ -0,0 +1,12 @@
all: csiphash.lib
CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
/I ..\ext
CSIPHASH_OBJECTS = csiphash.obj
csiphash.lib: $(CSIPHASH_OBJECTS)
lib $(CSIPHASH_OBJECTS) $(CURVE25519_DONNA_OBJECTS) /out:csiphash.lib
clean:
del *.obj *.lib

View File

@ -1,6 +1,6 @@
all: tor.exe
CFLAGS = /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
/I ..\ext
LIBS = ..\..\..\build-alpha\lib\libevent.lib \
@ -15,6 +15,7 @@ LIBTOR_OBJECTS = \
buffers.obj \
channel.obj \
channeltls.obj \
circpathbias.obj \
circuitbuild.obj \
circuitlist.obj \
circuitmux.obj \
@ -35,6 +36,7 @@ LIBTOR_OBJECTS = \
dirvote.obj \
dns.obj \
dnsserv.obj \
ext_orport.obj \
fp_pair.obj \
entrynodes.obj \
geoip.obj \
@ -69,7 +71,7 @@ libtor.lib: $(LIBTOR_OBJECTS)
lib $(LIBTOR_OBJECTS) /out:$@
tor.exe: libtor.lib tor_main.obj
$(CC) $(CFLAGS) $(LIBS) libtor.lib ..\common\*.lib tor_main.obj /Fe$@
$(CC) $(CFLAGS) $(LIBS) libtor.lib ..\common\*.lib ..\ext\*.lib tor_main.obj /Fe$@
clean:
del $(LIBTOR_OBJECTS) *.lib tor.exe
del $(LIBTOR_OBJECTS) tor_main.obj *.lib tor.exe

View File

@ -2497,7 +2497,7 @@ client_likes_consensus(networkstatus_t *v, const char *want_url)
if (base16_decode(want_digest, DIGEST_LEN, d, want_len*2) < 0) {
log_fn(LOG_PROTOCOL_WARN, LD_DIR,
"Failed to decode requested authority digest %s.", d);
"Failed to decode requested authority digest %s.", escaped(d));
continue;
};
@ -2557,7 +2557,7 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers,
* act as if no If-Modified-Since header had been given. */
tor_free(header);
}
log_debug(LD_DIRSERV,"rewritten url as '%s'.", url);
log_debug(LD_DIRSERV,"rewritten url as '%s'.", escaped(url));
url_mem = url;
url_len = strlen(url);
@ -3006,7 +3006,7 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers,
const char *query = url + strlen("/tor/rendezvous2/");
if (strlen(query) == REND_DESC_ID_V2_LEN_BASE32) {
log_info(LD_REND, "Got a v2 rendezvous descriptor request for ID '%s'",
safe_str(query));
safe_str(escaped(query)));
switch (rend_cache_lookup_v2_desc_as_dir(query, &descp)) {
case 1: /* valid */
write_http_response_header(conn, strlen(descp), 0, 0);
@ -3140,7 +3140,7 @@ directory_handle_command_post(dir_connection_t *conn, const char *headers,
write_http_status_line(conn, 400, "Bad request");
return 0;
}
log_debug(LD_DIRSERV,"rewritten url as '%s'.", url);
log_debug(LD_DIRSERV,"rewritten url as '%s'.", escaped(url));
/* Handle v2 rendezvous service publish request. */
if (options->HidServDirectoryV2 &&
@ -3273,7 +3273,9 @@ directory_handle_command(dir_connection_t *conn)
}
http_set_address_origin(headers, TO_CONN(conn));
//log_debug(LD_DIRSERV,"headers %s, body %s.", headers, body);
// we should escape headers here as well,
// but we can't call escaped() twice, as it uses the same buffer
//log_debug(LD_DIRSERV,"headers %s, body %s.", headers, escaped(body));
if (!strncasecmp(headers,"GET",3))
r = directory_handle_command_get(conn, headers, body, body_len);

View File

@ -523,6 +523,7 @@ relay_header_unpack(relay_header_t *dest, const uint8_t *src)
static const char *
relay_command_to_string(uint8_t command)
{
static char buf[64];
switch (command) {
case RELAY_COMMAND_BEGIN: return "BEGIN";
case RELAY_COMMAND_DATA: return "DATA";
@ -547,7 +548,12 @@ relay_command_to_string(uint8_t command)
case RELAY_COMMAND_RENDEZVOUS_ESTABLISHED:
return "RENDEZVOUS_ESTABLISHED";
case RELAY_COMMAND_INTRODUCE_ACK: return "INTRODUCE_ACK";
default: return "(unrecognized)";
case RELAY_COMMAND_EXTEND2: return "EXTEND2";
case RELAY_COMMAND_EXTENDED2: return "EXTENDED2";
default:
tor_snprintf(buf, sizeof(buf), "Unrecognized relay command %u",
(unsigned)command);
return buf;
}
}

View File

@ -257,3 +257,11 @@
#define USE_CURVE25519_DONNA
#define ENUM_VALS_ARE_SIGNED 1
#ifndef STDOUT_FILENO
#define STDOUT_FILENO 1
#endif
#ifndef STDERR_FILENO
#define STDERR_FILENO 2
#endif