[or-cvs] make router_nickname_is_approved() do the right thing

Roger Dingledine arma at seul.org
Wed Jul 21 22:54:32 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	dirserv.c 
Log Message:
make router_nickname_is_approved() do the right thing


Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dirserv.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- dirserv.c	21 Jul 2004 22:37:03 -0000	1.63
+++ dirserv.c	21 Jul 2004 22:54:27 -0000	1.64
@@ -178,20 +178,22 @@
   }
 }
 
-/** Return true iff any router named <b>nickname</b> is in the fingerprint
- * list. */
+/** Return true iff any router named <b>nickname</b> with <b>digest</b>
+ * is in the verified fingerprint list. */
 static int
 router_nickname_is_approved(const char *nickname, const char *digest)
 {
   int i,j;
   fingerprint_entry_t *ent;
   char fp[FINGERPRINT_LEN+1];
+  char hexdigest[HEX_DIGEST_LEN+1];
   if (!fingerprint_list)
     return 0;
 
-  for (i=j=0;i<DIGEST_LEN;++i,++j) {
-    fp[i]=digest[j];
-    if ((j%4)==3 && j != 19)
+  base16_encode(hexdigest, sizeof(hexdigest), digest, DIGEST_LEN);
+  for (i=j=0;j<HEX_DIGEST_LEN;++i,++j) {
+    fp[i]=hexdigest[j];
+    if ((j%4)==3 && j != 39)
       fp[++i]=' ';
   }
   fp[i]='\0';



More information about the tor-commits mailing list