[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-bugs] #2250 [Tor Relay]: TorTestingNetwork vs. GETINFO config-text



#2250: TorTestingNetwork vs. GETINFO config-text
-----------------------+----------------------------------------------------
 Reporter:  weasel     |       Owner:                     
     Type:  defect     |      Status:  new                
 Priority:  normal     |   Milestone:                     
Component:  Tor Relay  |     Version:  Tor: 0.2.2.19-alpha
 Keywords:             |      Parent:                     
-----------------------+----------------------------------------------------
 So,

 if one has a Tor instance running with !TorTestingNetwork set to 1, and
 sends it a GETINFO config-text on the control port, tor will assert(0).

 {{{
 | Dec 05 00:34:26.000 [err] config_dump(): Bug: validate_fn said:
 TestingV3AuthInitialVotingInterval may only be changed in testing Tor
 networks!
 | Dec 05 00:34:26.000 [err] config_dump(): Bug: Failed to validate default
 config.
 | Dec 05 00:34:26.000 [err] config_dump(): Bug: config.c:2750:
 config_dump: Assertion 0 failed; aborting.
 }}}
 [the first log line is mine.]

 The problem results from several things, as always.

 When !TorTestingNetwork is set, Tor overwrites some of the default values,
 that is it directly modifies the initval attributes of the _option_vars
 elements in the global options_format.  It does this in
 options_init_from_string() around line 4230.  One of those options that
 are changed is TestingV3AuthInitialVotingInterval.

 Also, in options_validate() we verify that
 TestingV3AuthInitialVotingInterval is 30*60 (the non-testing default).

 Now, GETINFO config-text causes config_dump() to be called.  That function
 wants to get a list of default values, so it can ignore them later on.
 For that it first gets a list of all the default values.  It does that by
 getting a fresh config and initialising it with the (modified) defaults.
 Then it goes to check if Tor likes the default config.

 Unfortunately we don't like the default config we just created - the
 default is !TorTestingNetwork 0 and TestingV3AuthInitialVotingInterval not
 30*60 (because we changed initval before) so we blow up (the check is
 around line 3690).

 Note that just setting TestingTorNetwork in the config to be checked (so
 that we like the new non-default values) is not sufficient - the next
 obstacle is that TestingTorNetwork only is allowed with non-default
 directory authorities.


 Cheers,
 weasel



 Not enough.  and would also require special handling in config_dump())
 {{{
 |  static config_var_t testing_tor_network_defaults[] = {
 |    V(ServerDNSAllowBrokenConfig,  BOOL,  "1"),
 | +  V(TestingTorNetwork,           BOOL,     "1"),
 |    V(DirAllowPrivateAddresses,    BOOL,     "1"),
 }}}

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/2250>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs