[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r20675: {tor} Update SVN to Git 008dc890d8d393f3a7be8ffae131632e46c5bc53 (in tor/trunk: . contrib contrib/auto-naming src/common src/or src/test)
Author: nickm
Date: 2009-09-27 16:04:15 -0400 (Sun, 27 Sep 2009)
New Revision: 20675
Added:
tor/trunk/contrib/auto-naming/
tor/trunk/contrib/auto-naming/README
Modified:
tor/trunk/ChangeLog
tor/trunk/src/common/tortls_states.h
tor/trunk/src/or/circuitbuild.c
tor/trunk/src/or/connection_edge.c
tor/trunk/src/test/test.h
tor/trunk/src/test/test_crypto.c
tor/trunk/src/test/test_dir.c
Log:
Update SVN to Git 008dc890d8d393f3a7be8ffae131632e46c5bc53
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2009-09-27 08:50:41 UTC (rev 20674)
+++ tor/trunk/ChangeLog 2009-09-27 20:04:15 UTC (rev 20675)
@@ -17,6 +17,10 @@
o Minor bugfixes:
- Fix a couple of smaller issues with gathering statistics. Bugfixes
on 0.2.2.1-alpha.
+ - Fix two memory leaks in the error case of
+ circuit_build_times_parse_state. Bugfix on 0.2.2.2-alpha.
+ - Make it explicit that we can't overflow in
+ connection_ap_handshake_send_resolve. Bugfix on 0.0.7.1-1.
Changes in version 0.2.2.3-alpha - 2009-09-23
o Major bugfixes:
Added: tor/trunk/contrib/auto-naming/README
===================================================================
--- tor/trunk/contrib/auto-naming/README (rev 0)
+++ tor/trunk/contrib/auto-naming/README 2009-09-27 20:04:15 UTC (rev 20675)
@@ -0,0 +1,6 @@
+Tor directory authorities may maintain a binding of server identities
+(their long term identity key) and nicknames.
+
+The auto-naming scripts have been moved to svn in
+projects/tor-naming/auto-naming/trunk/
+
Modified: tor/trunk/src/common/tortls_states.h
===================================================================
--- tor/trunk/src/common/tortls_states.h 2009-09-27 08:50:41 UTC (rev 20674)
+++ tor/trunk/src/common/tortls_states.h 2009-09-27 20:04:15 UTC (rev 20675)
@@ -3,9 +3,30 @@
* Copyright (c) 2007-2009, The Tor Project, Inc. */
/* See LICENSE for licensing information */
+/* Helper file: included only in tortls.c */
+
#ifndef _TORTLS_STATES_H
#define _TORTLS_STATES_H
+/* The main body of this file was mechanically generated with this
+ perl script:
+
+ my %keys = ();
+ for $fn (@ARGV) {
+ open(F, $fn);
+ while (<F>) {
+ next unless /^#define ((?:SSL|DTLS)\w*_ST_\w*)/;
+ $keys{$1} = 1;
+ }
+ close(F);
+ }
+ for $k (sort keys %keys) {
+ print "#ifdef $k\n S($k),\n#endif\n"
+ }
+*/
+
+/** Mapping from allowed value of SSL.state to the name of C macro for that
+ * state. Used for debugging an openssl connection. */
static const struct { int state; const char *name; } state_map[] = {
#define S(state) { state, #state }
#ifdef DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A
Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c 2009-09-27 08:50:41 UTC (rev 20674)
+++ tor/trunk/src/or/circuitbuild.c 2009-09-27 20:04:15 UTC (rev 20675)
@@ -427,6 +427,8 @@
if (!ok) {
*msg = tor_strdup("Unable to parse circuit build times: "
"Unparsable bin number");
+ SMARTLIST_FOREACH(args, char*, cp, tor_free(cp));
+ smartlist_free(args);
break;
}
count = (uint32_t)tor_parse_ulong(count_str, 0, 0,
@@ -434,6 +436,8 @@
if (!ok) {
*msg = tor_strdup("Unable to parse circuit build times: "
"Unparsable bin count");
+ SMARTLIST_FOREACH(args, char*, cp, tor_free(cp));
+ smartlist_free(args);
break;
}
Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c 2009-09-27 08:50:41 UTC (rev 20674)
+++ tor/trunk/src/or/connection_edge.c 2009-09-27 20:04:15 UTC (rev 20675)
@@ -2156,8 +2156,9 @@
tor_assert(payload_len <= (int)sizeof(inaddr_buf));
}
- if (payload_len > RELAY_PAYLOAD_SIZE) {
+ if (payload_len > MAX_SOCKS_ADDR_LEN) {
/* This should be impossible: we don't accept addresses this big. */
+ /* XXX Should we log a bug here? */
connection_mark_unattached_ap(ap_conn, END_STREAM_REASON_INTERNAL);
return -1;
}
Modified: tor/trunk/src/test/test.h
===================================================================
--- tor/trunk/src/test/test.h 2009-09-27 08:50:41 UTC (rev 20674)
+++ tor/trunk/src/test/test.h 2009-09-27 20:04:15 UTC (rev 20675)
@@ -51,13 +51,16 @@
#define test_memeq(expr1, expr2, len) test_mem_op((expr1), ==, (expr2), len)
#define test_memneq(expr1, expr2, len) test_mem_op((expr1), !=, (expr2), len)
+/* As test_mem_op, but decodes 'hex' before comparing. There must be a
+ * local char* variable called mem_op_hex_tmp for this to work. */
#define test_mem_op_hex(expr1, op, hex) \
STMT_BEGIN \
size_t length = strlen(hex); \
- char *value2 = tor_malloc(length/2); \
+ tor_free(mem_op_hex_tmp); \
+ mem_op_hex_tmp = tor_malloc(length/2); \
tor_assert((length&1)==0); \
- base16_decode(value2, length/2, hex, length); \
- test_mem_op(expr1, op, value2, length/2); \
+ base16_decode(mem_op_hex_tmp, length/2, hex, length); \
+ test_mem_op(expr1, op, mem_op_hex_tmp, length/2); \
STMT_END
#define test_memeq_hex(expr1, hex) test_mem_op_hex(expr1, ==, hex)
Modified: tor/trunk/src/test/test_crypto.c
===================================================================
--- tor/trunk/src/test/test_crypto.c 2009-09-27 08:50:41 UTC (rev 20674)
+++ tor/trunk/src/test/test_crypto.c 2009-09-27 20:04:15 UTC (rev 20675)
@@ -96,6 +96,7 @@
char *data1 = NULL, *data2 = NULL, *data3 = NULL;
crypto_cipher_env_t *env1 = NULL, *env2 = NULL;
int i, j;
+ char *mem_op_hex_tmp=NULL;
data1 = tor_malloc(1024);
data2 = tor_malloc(1024);
@@ -210,6 +211,7 @@
test_assert(tor_mem_is_zero(data2, 64));
done:
+ tor_free(mem_op_hex_tmp);
if (env1)
crypto_free_cipher_env(env1);
if (env2)
@@ -229,6 +231,7 @@
char digest[32];
char data[50];
char d_out1[DIGEST_LEN], d_out2[DIGEST256_LEN];
+ char *mem_op_hex_tmp=NULL;
/* Test SHA-1 with a test vector from the specification. */
i = crypto_digest(data, "abc", 3);
@@ -312,6 +315,7 @@
crypto_free_digest_env(d1);
if (d2)
crypto_free_digest_env(d2);
+ tor_free(mem_op_hex_tmp);
}
/** Run unit tests for our public key crypto functions */
Modified: tor/trunk/src/test/test_dir.c
===================================================================
--- tor/trunk/src/test/test_dir.c 2009-09-27 08:50:41 UTC (rev 20674)
+++ tor/trunk/src/test/test_dir.c 2009-09-27 20:04:15 UTC (rev 20675)
@@ -76,6 +76,8 @@
pk2 = pk_generate(1);
pk3 = pk_generate(2);
+ test_assert(pk1 && pk2 && pk3);
+
get_platform_str(platform, sizeof(platform));
r1 = tor_malloc_zero(sizeof(routerinfo_t));
r1->address = tor_strdup("18.244.0.1");
@@ -502,6 +504,7 @@
smartlist_free(vote2.net_params);
smartlist_free(vote3.net_params);
smartlist_free(vote4.net_params);
+ smartlist_free(votes);
return;
}