aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-02-19 02:43:36 -0500
committerNick Mathewson <nickm@torproject.org>2013-02-19 02:43:36 -0500
commit785827606643d0bfdeba22dc73266c311456b87c (patch)
tree62712ea2c4cfbe9d121865e98ae9c3943a4ff1dd /src
parent59fc77e29b17840bf403d9ee9245846ad807b12d (diff)
downloadtor-785827606643d0bfdeba22dc73266c311456b87c.tar
tor-785827606643d0bfdeba22dc73266c311456b87c.tar.gz
Revise some comments in router.c
Avoid the phrase "legally valid" (as opposed to valid but not legal)? And document what functions really do. Fix for bug 6935.
Diffstat (limited to 'src')
-rw-r--r--src/or/router.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 1f372711c..9fced2b9b 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2715,7 +2715,9 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo,
return result;
}
-/** Return true iff <b>s</b> is a legally valid server nickname. */
+/** Return true iff <b>s</b> is a valid server nickname. (That is, a string
+ * containing between 1 and MAX_NICKNAME_LEN chracters from
+ * LEGAL_NICKNAME_CHARACTERS.) */
int
is_legal_nickname(const char *s)
{
@@ -2726,7 +2728,7 @@ is_legal_nickname(const char *s)
strspn(s,LEGAL_NICKNAME_CHARACTERS) == len;
}
-/** Return true iff <b>s</b> is a legally valid server nickname or
+/** Return true iff <b>s</b> is a valid server nickname or
* hex-encoded identity-key digest. */
int
is_legal_nickname_or_hexdigest(const char *s)
@@ -2737,8 +2739,11 @@ is_legal_nickname_or_hexdigest(const char *s)
return is_legal_hexdigest(s);
}
-/** Return true iff <b>s</b> is a legally valid hex-encoded identity-key
- * digest. */
+/** Return true iff <b>s</b> is a valid hex-encoded identity-key
+ * digest. (That is, an optional $, followed by 40 hex characters,
+ * followed by either nothing, or = or ~ followed by a nickname, or
+ * a character other thant =, ~, or a hex character.)
+ */
int
is_legal_hexdigest(const char *s)
{