From d7a3e336ee505bcbeb30117d91067810ad096130 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 22 Aug 2017 18:47:57 -0400 Subject: 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. --- src/or/routerlist.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/or/routerlist.c') 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, * hexdigest 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); -- cgit v1.2.3-54-g00ecf