Currently, when we set DirAuthorities or AlternateDirAuthority, we don't add the default directory authorities. But, (as long as FallbackDir isn't set) we do add the default fallback directories.
It doesn't make sense to me to add the default fallback directories when we have custom DirAuthorities or AlternateDirAuthority. I think we should only add the default fallback directories when other directories are also set to their defaults.
However, the list of default fallback directories is currently NULL, so this issue currently has no effect.
I also can't imagine any scenarios where it would be useful to set an AlternateDirAuthority or DirAuthorities, and still get the default FallbackDir.
I can imagine this causing similar issues to legacy/trac#13163 (moved), where the default authorities were added to a custom set of authorities in some circumstances.
I'll create a patch to fix this, but it won't actually change tor's observable behaviour until we add directories to the default fallback directory list.
Trac: Description: Currently, when we set DirAuthorities or AlternateDirAuthority, we don't add the default directory authorities. But, (as long as FallbackDir isn't set) we do add the default fallback directories. However, the list of default fallback directories is currently NULL, so this issue has no effect.
But I can't imagine too many scenarios where it would be useful to set an AlternateDirAuthority or DirAuthorities, and still get the default FallbackDir.
I can imagine this causing similar issues to legacy/trac#13163 (moved), where the default authorities were added to a custom set of authorities in some circumstances.
I'll create a patch to fix this, but it won't actually change tor's observable behaviour until we add directories to the default fallback directory list.
Currently, when we set DirAuthorities or AlternateDirAuthority, we don't add the default directory authorities. But, (as long as FallbackDir isn't set) we do add the default fallback directories.
It doesn't make sense to me to add the default fallback directories when we have custom DirAuthorities or AlternateDirAuthority. I think we should only add the default fallback directories when other directories are also set to their defaults.
However, the list of default fallback directories is currently NULL, so this issue currently has no effect.
I also can't imagine any scenarios where it would be useful to set an AlternateDirAuthority or DirAuthorities, and still get the default FallbackDir.
I can imagine this causing similar issues to legacy/trac#13163 (moved), where the default authorities were added to a custom set of authorities in some circumstances.
I'll create a patch to fix this, but it won't actually change tor's observable behaviour until we add directories to the default fallback directory list.
I'm still trying to get my head around how to do unit tests for this issue and legacy/trac#13163 (moved).
The code here is a little more complex than I'm used to writing tor unit tests for, so I think I will have to mock some of the functions.
I'm working on unit tests for legacy/trac#13163 (moved) with these changes, likely ready in time for 0.2.7, but the changes here are not urgent at all (they don't change user-visible behaviour).
Trac: Owner: N/Ato teor Status: needs_review to assigned
Unit tests for consider_adding_dir_servers based on fixed default fallback directories behaviour. These are extensive because they cover each of 10 valid cases. There may be ways to abstract some of these shared code, but I feel it would make the tests less clear.
Shifting this to 0.2.7 based on legacy/trac#13163 (moved)'s unit tests being in 0.2.7. Feel free to kick it out again.
Trac: Milestone: Tor: 0.2.8.x-final to Tor: 0.2.7.x-final
I am also concerned that this general area of the code lacks unit tests, which it might be wise to include before we effectively activate it for the first time.
...
there's currently no coverage for the function that adds fallback directories. (In fact, I mock it in my unit tests, because I need it to do something so I know if it has been called or not.)
...
The function which loads fallback directories currently loads from a string array inside the function, so it would need to be modified to load from a signed file. I support the security benefits of signed fallback directories enough to write client code and unit tests for it, but I'm not sure how the code for the authorities would work - is the proposal to sign a section of the consensus, and output it as a separate file?
If so, we would either need to backport, and/or wait until a majority of the authorities update to tor versions with the feature. And perhaps a majority of clients as well, controlled by a consensus parameter? (Otherwise, using any entry in the file itself would allow clients to effectively be partitioned from the rest of the network by their behaviour.)
While I'm making a list, do we need to modify the existing proposal which describes fallback directories?
Is this change proposed for 0.2.7?
Or all currently supported releases?
Also:
Do we need a new configuration option to give the location of the (signed) Fallback Directories file?
How should this interact with the existing FallbackDir option? Cumulative?
I'm happy to open a new issue for these questions/changes, once we have some idea what we'd like to do about them.
* Fix to default fallback directories behaviour* Unit tests for consider_adding_dir_servers based on fixed default fallback directories behaviour. These are extensive because they cover each of 10 valid cases. There may be ways to abstract some of these shared code, but I feel it would make the tests less clear.
In 0.2.7 per nickm.
Isabella, can you please add the right keywords for 0.2.7?
Trac: Cc: nickm to nickm, isabella Status: needs_information to needs_review