diff options
author | Roger Dingledine <arma@torproject.org> | 2004-07-21 22:54:27 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-07-21 22:54:27 +0000 |
commit | f82a36508df3d1bb6517b94c8e86325c6f6d1360 (patch) | |
tree | e8e7eea7d564bb0f4938a87110d9e1d7469f5084 | |
parent | 3783d2e682b641abe6f5e15e0501bceb90a0cc74 (diff) | |
download | tor-f82a36508df3d1bb6517b94c8e86325c6f6d1360.tar.gz tor-f82a36508df3d1bb6517b94c8e86325c6f6d1360.zip |
make router_nickname_is_approved() do the right thing
svn:r2090
-rw-r--r-- | src/or/dirserv.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index a05ed98fa7..cbdfb6b0a7 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -178,20 +178,22 @@ dirserv_router_fingerprint_is_known(const routerinfo_t *router) } } -/** Return true iff any router named <b>nickname</b> is in the fingerprint - * list. */ +/** Return true iff any router named <b>nickname</b> with <b>digest</b> + * is in the verified fingerprint list. */ static int router_nickname_is_approved(const char *nickname, const char *digest) { int i,j; fingerprint_entry_t *ent; char fp[FINGERPRINT_LEN+1]; + char hexdigest[HEX_DIGEST_LEN+1]; if (!fingerprint_list) return 0; - for (i=j=0;i<DIGEST_LEN;++i,++j) { - fp[i]=digest[j]; - if ((j%4)==3 && j != 19) + base16_encode(hexdigest, sizeof(hexdigest), digest, DIGEST_LEN); + for (i=j=0;j<HEX_DIGEST_LEN;++i,++j) { + fp[i]=hexdigest[j]; + if ((j%4)==3 && j != 39) fp[++i]=' '; } fp[i]='\0'; |