[or-cvs] be more lax about recognizing valid hexdigests.

arma at seul.org arma at seul.org
Tue Jun 13 12:06:01 UTC 2006


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

Modified Files:
	router.c 
Log Message:
be more lax about recognizing valid hexdigests.


Index: router.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.265
retrieving revision 1.266
diff -u -p -d -r1.265 -r1.266
--- router.c	7 Jun 2006 06:10:54 -0000	1.265
+++ router.c	13 Jun 2006 12:05:59 -0000	1.266
@@ -1230,10 +1230,10 @@ is_legal_hexdigest(const char *s)
 {
   size_t len;
   tor_assert(s);
+  if (s[0] == '$') s++;
   len = strlen(s);
-  return (len == HEX_DIGEST_LEN+1 &&
-          s[0] == '$' &&
-          strspn(s+1,HEX_CHARACTERS)==len-1);
+  return (len == HEX_DIGEST_LEN &&
+          strspn(s,HEX_CHARACTERS)==len);
 }
 
 /** Forget that we have issued any router-related warnings, so that we'll



More information about the tor-commits mailing list