]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add "panic" option to reject all servers not in fingerprint list.
authorNick Mathewson <nickm@torproject.org>
Thu, 15 Dec 2005 21:39:38 +0000 (21:39 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 15 Dec 2005 21:39:38 +0000 (21:39 +0000)
svn:r5601

src/or/config.c
src/or/dirserv.c
src/or/or.h

index 4d53f20e233f58d3e3ffe0843f1147770d679330..27478b1e082257a5d3ec62a559455e7729422ed2 100644 (file)
@@ -112,6 +112,7 @@ static config_var_t _option_vars[] = {
   VAR("AssumeReachable",     BOOL,     AssumeReachable,      "0"),
   VAR("AuthDirInvalid",      LINELIST, AuthDirInvalid,       NULL),
   VAR("AuthDirReject",       LINELIST, AuthDirReject,        NULL),
+  VAR("AuthDirRejectUnlisted",BOOL,    AuthDirRejectUnlisted,"0"),
   VAR("AuthoritativeDirectory",BOOL,   AuthoritativeDir,     "0"),
   VAR("BandwidthBurst",      MEMUNIT,  BandwidthBurst,       "5 MB"),
   VAR("BandwidthRate",       MEMUNIT,  BandwidthRate,        "2 MB"),
index 7fe5bcab3d98bdaf3ee85d2388f1d62c31b57ce1..a787f919bf19454a2dda09588a50d6816652e047 100644 (file)
@@ -280,6 +280,7 @@ dirserv_get_status_impl(const char *fp, const char *nickname,
                         const char **msg, int should_log)
 {
   fingerprint_entry_t *nn_ent = NULL, *fp_ent = NULL;
+  int reject_unlisted = get_options()->AuthDirRejectUnlisted;
   if (!fingerprint_list)
     fingerprint_list = smartlist_create();
 
@@ -327,7 +328,7 @@ dirserv_get_status_impl(const char *fp, const char *nickname,
       return FP_INVALID;
     }
     if (!platform || tor_version_as_new_as(platform,"0.1.0.2-rc"))
-      return FP_VALID;
+      return reject_unlisted ? FP_REJECT : FP_VALID;
     else
       return FP_INVALID;
     if (should_log)
index 7250265c8a96a917bb9947eadb8e21c51c432b15..75a2d66af14bbc8a25dd8a00c5fbc17b6930da85 100644 (file)
@@ -1315,6 +1315,8 @@ typedef struct {
                                  * reject. */
   config_line_t *AuthDirInvalid; /**< Address policy for descriptors to
                                   * never mark as valid. */
+  int AuthDirRejectUnlisted; /**< Boolean: do we reject all routers that
+                              * aren't named in our fingprint file? */
   char *AccountingStart; /**< How long is the accounting interval, and when
                           * does it start? */
   uint64_t AccountingMax; /**< How many bytes do we allow per accounting