]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
be more lax about recognizing valid hexdigests.
authorRoger Dingledine <arma@torproject.org>
Tue, 13 Jun 2006 12:05:59 +0000 (12:05 +0000)
committerRoger Dingledine <arma@torproject.org>
Tue, 13 Jun 2006 12:05:59 +0000 (12:05 +0000)
svn:r6619

src/or/router.c

index ee4cba30cfa3862902a6e0032e53125ca80a8956..47224de14b5721c7736ef86bdb6460fe3376d3f6 100644 (file)
@@ -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