[tor-commits] [tor/master] Merge branch 'bug12844'

nickm at torproject.org nickm at torproject.org
Wed Feb 11 20:06:13 UTC 2015


commit caf28519d9a4f7f0a5fa36a0cd94fe9c0ee292dc
Merge: 0c81dfa 0899f51
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Feb 11 15:06:04 2015 -0500

    Merge branch 'bug12844'
    
    Conflicts:
    	src/or/circuituse.c
    	src/test/include.am
    	src/test/test_entrynodes.c

 changes/feature12844       |    5 +++
 doc/tor.1.txt              |   16 ++++++++
 src/or/circuitbuild.c      |   87 ++++++++++++++++++++++++++++++++++++++++++--
 src/or/circuitbuild.h      |    3 ++
 src/or/circuituse.c        |   12 +++++-
 src/or/config.c            |   13 ++++++-
 src/or/or.h                |    3 ++
 src/or/routerlist.c        |    2 +-
 src/or/routerlist.h        |    4 ++
 src/test/include.am        |    5 ++-
 src/test/test_entrynodes.c |   68 +++-------------------------------
 src/test/test_hs.c         |   80 ++++++++++++++++++++++++++++++++++++++++
 src/test/testhelper.c      |   67 ++++++++++++++++++++++++++++++++++
 src/test/testhelper.h      |   10 +++++
 14 files changed, 305 insertions(+), 70 deletions(-)

diff --cc src/or/circuituse.c
index 612b536,6304a4d..c463b0a
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@@ -1676,14 -1646,11 +1676,15 @@@ circuit_launch_by_extend_info(uint8_t p
  {
    origin_circuit_t *circ;
    int onehop_tunnel = (flags & CIRCLAUNCH_ONEHOP_TUNNEL) != 0;
 +  int have_path = have_enough_path_info(! (flags & CIRCLAUNCH_IS_INTERNAL) );
+   int need_specific_rp = 0;
  
 -  if (!onehop_tunnel && !router_have_minimum_dir_info()) {
 -    log_debug(LD_CIRC,"Haven't fetched enough directory info yet; canceling "
 -              "circuit launch.");
 +  if (!onehop_tunnel && (!router_have_minimum_dir_info() || !have_path)) {
 +    log_debug(LD_CIRC,"Haven't %s yet; canceling "
 +              "circuit launch.",
 +              !router_have_minimum_dir_info() ?
 +              "fetched enough directory info" :
 +              "received a consensus with exits");
      return NULL;
    }
  
diff --cc src/or/config.c
index de0baa4,999b134..ad4fd45
--- a/src/or/config.c
+++ b/src/or/config.c
@@@ -78,8 -63,10 +78,9 @@@ static config_abbrev_t option_abbrevs_[
    PLURAL(AuthDirBadExitCC),
    PLURAL(AuthDirInvalidCC),
    PLURAL(AuthDirRejectCC),
 -  PLURAL(ExitNode),
    PLURAL(EntryNode),
    PLURAL(ExcludeNode),
+   PLURAL(Tor2webRendezvousPoint),
    PLURAL(FirewallPort),
    PLURAL(LongLivedPort),
    PLURAL(HiddenServiceNode),
@@@ -400,10 -401,14 +401,11 @@@ static config_var_t option_vars_[] = 
    OBSOLETE("StrictEntryNodes"),
    OBSOLETE("StrictExitNodes"),
    V(StrictNodes,                 BOOL,     "0"),
 -  V(Support022HiddenServices,    AUTOBOOL, "auto"),
 -  OBSOLETE("SysLog"),
 +  OBSOLETE("Support022HiddenServices"),
    V(TestSocks,                   BOOL,     "0"),
 -  OBSOLETE("TestVia"),
    V(TokenBucketRefillInterval,   MSEC_INTERVAL, "100 msec"),
    V(Tor2webMode,                 BOOL,     "0"),
+   V(Tor2webRendezvousPoints,      ROUTERSET, NULL),
    V(TLSECGroup,                  STRING,   NULL),
    V(TrackHostExits,              CSV,      NULL),
    V(TrackHostExitsExpire,        INTERVAL, "30 minutes"),
diff --cc src/test/include.am
index 595be0b,28f3a83..71041b1
--- a/src/test/include.am
+++ b/src/test/include.am
@@@ -54,24 -39,17 +54,25 @@@ src_test_test_SOURCES = 
  	src/test/test_relaycell.c \
  	src/test/test_replay.c \
  	src/test/test_routerkeys.c \
 +	src/test/test_routerlist.c \
 +	src/test/test_routerset.c \
 +	src/test/test_scheduler.c \
  	src/test/test_socks.c \
 -	src/test/test_util.c \
 -	src/test/test_config.c \
 -	src/test/test_hs.c \
 -	src/test/test_nodelist.c \
 -	src/test/test_policy.c \
  	src/test/test_status.c \
 -	src/test/test_routerset.c \
 +	src/test/test_threads.c \
 +	src/test/test_util.c \
 +	src/test/testing_common.c \
+ 	src/test/testhelper.c \
  	src/ext/tinytest.c
  
 +src_test_test_slow_SOURCES = \
 +	src/test/test_slow.c \
 +	src/test/test_crypto_slow.c \
 +	src/test/test_util_slow.c \
 +	src/test/testing_common.c \
 +	src/ext/tinytest.c
 +
 +
  src_test_test_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
  
  src_test_test_CPPFLAGS= $(src_test_AM_CPPFLAGS)
@@@ -117,13 -74,11 +118,15 @@@ src_test_test_workqueue_LDADD = src/or/
  	@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
  
  noinst_HEADERS+= \
 +	src/test/fakechans.h \
  	src/test/test.h \
+ 	src/test/testhelper.h \
 +	src/test/test_descriptors.inc \
 +	src/test/example_extrainfo.inc \
 +	src/test/failing_routerdescs.inc \
- 	src/test/ed25519_vectors.inc
++	src/test/ed25519_vectors.inc \
+ 	src/test/test_descriptors.inc
  
 -if CURVE25519_ENABLED
  noinst_PROGRAMS+= src/test/test-ntor-cl
  src_test_test_ntor_cl_SOURCES  = src/test/test_ntor_cl.c
  src_test_test_ntor_cl_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@
diff --cc src/test/test_entrynodes.c
index 19071a1,1298159..5f2051c
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@@ -197,7 -141,7 +141,7 @@@ populate_live_entry_guards_test_helper(
  
    /* Walk the nodelist and add all nodes as entry guards. */
    our_nodelist = nodelist_get_list();
-   tt_int_op(smartlist_len(our_nodelist), OP_EQ, NUMBER_OF_DESCRIPTORS);
 -  tt_int_op(smartlist_len(our_nodelist), ==, HELPER_NUMBER_OF_DESCRIPTORS);
++  tt_int_op(smartlist_len(our_nodelist), OP_EQ, HELPER_NUMBER_OF_DESCRIPTORS);
  
    SMARTLIST_FOREACH_BEGIN(our_nodelist, const node_t *, node) {
      const node_t *node_tmp;
@@@ -206,10 -150,10 +150,10 @@@
    } SMARTLIST_FOREACH_END(node);
  
    /* Make sure the nodes were added as entry guards. */
-   tt_int_op(smartlist_len(all_entry_guards), OP_EQ, NUMBER_OF_DESCRIPTORS);
 -  tt_int_op(smartlist_len(all_entry_guards), ==, HELPER_NUMBER_OF_DESCRIPTORS);
++  tt_int_op(smartlist_len(all_entry_guards), OP_EQ, HELPER_NUMBER_OF_DESCRIPTORS);
  
    /* Ensure that all the possible entry guards are enough to satisfy us. */
 -  tt_int_op(smartlist_len(all_entry_guards), >=, num_needed);
 +  tt_int_op(smartlist_len(all_entry_guards), OP_GE, num_needed);
  
    /* Walk the entry guard list for some sanity checking */
    SMARTLIST_FOREACH_BEGIN(all_entry_guards, const entry_guard_t *, entry) {
@@@ -647,7 -590,7 +591,7 @@@ test_entry_is_live(void *arg
  
    /* Walk the nodelist and add all nodes as entry guards. */
    our_nodelist = nodelist_get_list();
-   tt_int_op(smartlist_len(our_nodelist), OP_EQ, NUMBER_OF_DESCRIPTORS);
 -  tt_int_op(smartlist_len(our_nodelist), ==, HELPER_NUMBER_OF_DESCRIPTORS);
++  tt_int_op(smartlist_len(our_nodelist), OP_EQ, HELPER_NUMBER_OF_DESCRIPTORS);
  
    SMARTLIST_FOREACH_BEGIN(our_nodelist, const node_t *, node) {
      const node_t *node_tmp;
@@@ -659,7 -602,7 +603,7 @@@
    } SMARTLIST_FOREACH_END(node);
  
    /* Make sure the nodes were added as entry guards. */
-   tt_int_op(smartlist_len(all_entry_guards), OP_EQ, NUMBER_OF_DESCRIPTORS);
 -  tt_int_op(smartlist_len(all_entry_guards), ==, HELPER_NUMBER_OF_DESCRIPTORS);
++  tt_int_op(smartlist_len(all_entry_guards), OP_EQ, HELPER_NUMBER_OF_DESCRIPTORS);
  
    /* Now get a random test entry that we will use for this unit test. */
    which_node = 3;  /* (chosen by fair dice roll) */



More information about the tor-commits mailing list