Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #2250

Closed (moved)
Open
Opened Dec 05, 2010 by weasel (Peter Palfrader)@weasel

TorTestingNetwork vs. GETINFO config-text

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"),
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Tor: 0.2.2.x-final
Milestone
Tor: 0.2.2.x-final
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#2250