From c1dd43d823c74f59f8ba0eff90f6ddab6763f408 Mon Sep 17 00:00:00 2001
From: teor <teor2345@gmail.com>
Date: Wed, 1 Oct 2014 18:37:19 +1000
Subject: [PATCH] Stop using default authorities with both Alternate Dir and
 Bridge Authority

Stop using the default authorities in networks which provide both
AlternateDirAuthority and AlternateBridgeAuthority.

This bug occurred due to an ambiguity around the use of NO_DIRINFO.
(Does it mean "any" or "none"?)

Partially fixes bug 13163.
---
 ...top-AlternateAuthorities-always-using-default-authorities | 4 ++++
 src/or/config.c                                              | 5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 changes/bug13163-stop-AlternateAuthorities-always-using-default-authorities

diff --git a/changes/bug13163-stop-AlternateAuthorities-always-using-default-authorities b/changes/bug13163-stop-AlternateAuthorities-always-using-default-authorities
new file mode 100644
index 0000000000..eeaca926a2
--- /dev/null
+++ b/changes/bug13163-stop-AlternateAuthorities-always-using-default-authorities
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Stop using the default authorities in networks which provide both
+      AlternateDirAuthority and AlternateBridgeAuthority.
+      Partially fixes bug 13163.
diff --git a/src/or/config.c b/src/or/config.c
index 921d032529..493cfcd2bc 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -959,7 +959,10 @@ consider_adding_dir_servers(const or_options_t *options,
       type |= BRIDGE_DIRINFO;
     if (!options->AlternateDirAuthority)
       type |= V3_DIRINFO | EXTRAINFO_DIRINFO | MICRODESC_DIRINFO;
-    add_default_trusted_dir_authorities(type);
+    /* if type == NO_DIRINFO, we don't want to add any of the
+     * default authorities, because we've replaced them all */
+    if (type != NO_DIRINFO)
+      add_default_trusted_dir_authorities(type);
   }
   if (!options->FallbackDir)
     add_default_fallback_dir_servers();
-- 
GitLab