aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-06-16 02:08:30 +0000
committerNick Mathewson <nickm@torproject.org>2008-06-16 02:08:30 +0000
commit44452c2756990520ad1e88172867fbac08c64e38 (patch)
tree4c89d0981857ccd44d37d44ab694830b7d9d8622
parent9cfe70cb69931782aebc31b341d820762ded0248 (diff)
downloadtor-44452c2756990520ad1e88172867fbac08c64e38.tar
tor-44452c2756990520ad1e88172867fbac08c64e38.tar.gz
r16341@tombo: nickm | 2008-06-15 22:04:25 -0400
Allow spaces to be omitted in approved-router file fingerprints. Requested by arma. svn:r15296
-rw-r--r--ChangeLog2
-rw-r--r--doc/TODO6
-rw-r--r--src/or/dirserv.c7
3 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index c414f69d8..a7e5d230f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,8 @@ Changes in version 0.2.1.2-alpha - 2008-??-??
- When building a consensus do not include routers that are down.
This will cut down 30% to 40% on consensus size. Implements
proposal 138.
+ - In directory authorities' approved-routers files, allow
+ fingerprints with or without space.
o Bugfixes:
- Asking for a conditional consensus at .../consensus/<fingerprints>
diff --git a/doc/TODO b/doc/TODO
index 25c657959..3265d5dd3 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -186,13 +186,13 @@ Other things Roger would be excited to see:
Nick
o Send or-dev email about proposal statuses.
- - Send or-dev email about window for new proposals, once arma and
+ o Send or-dev email about window for new proposals, once arma and
nick agree.
- Finish buffer stuff in libevent; start using it in Tor.
- Tors start believing the contents of NETINFO cells.
- - Work with Steven and Roger to decide which parts of Paul's project
+ . Work with Steven and Roger to decide which parts of Paul's project
he wants to work on.
- - let approved-routers lines omit spaces in fingerprint.
+ o let approved-routers lines omit spaces in fingerprint.
Matt
- Fit Vidalia in 640x480 again.
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 83126b95d..fbe23c2fd 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -221,6 +221,7 @@ dirserv_load_fingerprint_file(void)
fingerprint_list_new = authdir_config_new();
for (list=front; list; list=list->next) {
+ char digest_tmp[DIGEST_LEN];
nickname = list->key; fingerprint = list->value;
if (strlen(nickname) > MAX_NICKNAME_LEN) {
log_notice(LD_CONFIG,
@@ -237,8 +238,10 @@ dirserv_load_fingerprint_file(void)
nickname);
continue;
}
- if (strlen(fingerprint) != FINGERPRINT_LEN ||
- !crypto_pk_check_fingerprint_syntax(fingerprint)) {
+ tor_strstrip(fingerprint, " "); /* remove spaces */
+ if (strlen(fingerprint) != HEX_DIGEST_LEN ||
+ base16_decode(digest_tmp, sizeof(digest_tmp),
+ fingerprint, HEX_DIGEST_LEN) < 0) {
log_notice(LD_CONFIG,
"Invalid fingerprint (nickname '%s', "
"fingerprint %s). Skipping.",