summaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
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 /src/or/dirserv.c
parent9cfe70cb69931782aebc31b341d820762ded0248 (diff)
downloadtor-44452c2756990520ad1e88172867fbac08c64e38.tar.gz
tor-44452c2756990520ad1e88172867fbac08c64e38.zip
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
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 83126b95d6..fbe23c2fd7 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.",