summaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-08-22 18:47:57 -0400
committerNick Mathewson <nickm@torproject.org>2017-08-22 18:47:57 -0400
commitd7a3e336ee505bcbeb30117d91067810ad096130 (patch)
tree49197c7181ff70a6dd6c0e8dd88fb72eb77c2629 /src/or/routerlist.c
parent40887b4d2ec2e1865df8f381aa1387ba4ee10eba (diff)
downloadtor-d7a3e336ee505bcbeb30117d91067810ad096130.tar.gz
tor-d7a3e336ee505bcbeb30117d91067810ad096130.zip
Remove some support for nickname-based hexdigests
We once used $X=N to mean "A relay with RSA ID digest X with the Named flag and the nickname N." But authorities no longer assign the Named flag.
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 49caa875fe..240ee9d68c 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2926,7 +2926,7 @@ hex_digest_nickname_decode(const char *hexdigest,
* <b>hexdigest</b> is malformed, or it doesn't match. */
int
hex_digest_nickname_matches(const char *hexdigest, const char *identity_digest,
- const char *nickname, int is_named)
+ const char *nickname)
{
char digest[DIGEST_LEN];
char nn_char='\0';
@@ -2935,13 +2935,15 @@ hex_digest_nickname_matches(const char *hexdigest, const char *identity_digest,
if (hex_digest_nickname_decode(hexdigest, digest, &nn_char, nn_buf) == -1)
return 0;
- if (nn_char == '=' || nn_char == '~') {
- if (!nickname)
+ if (nn_char == '=') {
+ return 0;
+ }
+
+ if (nn_char == '~') {
+ if (!nickname) // XXX This seems wrong. -NM
return 0;
if (strcasecmp(nn_buf, nickname))
return 0;
- if (nn_char == '=' && !is_named)
- return 0;
}
return tor_memeq(digest, identity_digest, DIGEST_LEN);