[or-cvs] Implement AllowUnverifiedNodes

Nick Mathewson nickm at seul.org
Tue Aug 17 05:14:01 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv19930/src/or

Modified Files:
	config.c or.h 
Log Message:
Implement AllowUnverifiedNodes

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- config.c	17 Aug 2004 02:00:36 -0000	1.136
+++ config.c	17 Aug 2004 05:13:57 -0000	1.137
@@ -231,6 +231,7 @@
 
     /* string options */
     config_compare(list, "Address",        CONFIG_TYPE_STRING, &options->Address) ||
+    config_compare(list, "AllowUnverifiedNodes", CONFIG_TYPE_CSV, &options->AllowUnverifiedNodes) ||
     config_compare(list, "AuthoritativeDirectory",CONFIG_TYPE_BOOL, &options->AuthoritativeDir) ||
 
     config_compare(list, "BandwidthRate",  CONFIG_TYPE_INT, &options->BandwidthRate) ||
@@ -808,9 +809,25 @@
   }
   if(options->FirewallPorts) {
     SMARTLIST_FOREACH(options->FirewallPorts, const char *, cp,
-    { i = atoi(cp); 
+    { i = atoi(cp);
       if (i < 1 || i > 65535) {
-        log(LOG_WARN, "Port %s out of range in FirewallPorts", cp);
+        log(LOG_WARN, "Port '%s' out of range in FirewallPorts", cp);
+        result=-1;
+      }
+    });
+  }
+  options->_AllowUnverified = 0;
+  if(options->AllowUnverifiedNodes) {
+    SMARTLIST_FOREACH(options->AllowUnverifiedNodes, const char *, cp,
+    { if (!strcasecmp(cp, "entry"))
+        options->_AllowUnverified |= ALLOW_UNVERIFIED_ENTRY;
+      else if (!strcasecmp(cp, "exit"))
+        options->_AllowUnverified |= ALLOW_UNVERIFIED_EXIT;
+      else if (!strcasecmp(cp, "middle"))
+        options->_AllowUnverified |= ALLOW_UNVERIFIED_MIDDLE;
+      else {
+        log(LOG_WARN, "Unrecognized value '%s' in AllowUnverifiedNodes",
+            cp);
         result=-1;
       }
     });

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.406
retrieving revision 1.407
diff -u -d -r1.406 -r1.407
--- or.h	16 Aug 2004 20:47:00 -0000	1.406
+++ or.h	17 Aug 2004 05:13:58 -0000	1.407
@@ -808,6 +808,11 @@
 
 typedef struct circuit_t circuit_t;
 
+#define ALLOW_UNVERIFIED_ENTRY  1
+#define ALLOW_UNVERIFIED_EXIT   2
+#define ALLOW_UNVERIFIED_MIDDLE 4
+
+
 /** Configuration options for a Tor process */
 typedef struct {
   struct config_line_t *LogOptions; /**< List of configuration lines
@@ -836,6 +841,8 @@
   char *RendExcludeNodes; /**< Comma-separated list of nicknames not to use
                            * as introduction points. */
 
+  smartlist_t *AllowUnverifiedNodes; /**< List of "entry", "middle", "exit" */
+  int _AllowUnverified; /**< Bitmask; derived from AllowUnverifiedNodes; */
   struct config_line_t *ExitPolicy; /**< Lists of exit policy components. */
   struct config_line_t *SocksPolicy; /**< Lists of socks policy components */
   /** Addresses to bind for listening for SOCKS connections. */



More information about the tor-commits mailing list