diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-09-30 20:04:40 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-09-30 20:04:40 +0000 |
commit | 1cd57b84664bf997422a66bf4cea3ee3aeb61aaa (patch) | |
tree | 5411f3f645578f794036997b3e2f1fefb08990d8 /src/or/dirserv.c | |
parent | f0e94dab8664db4190a5be048430ee23857b4162 (diff) | |
download | tor-1cd57b84664bf997422a66bf4cea3ee3aeb61aaa.tar tor-1cd57b84664bf997422a66bf4cea3ee3aeb61aaa.tar.gz |
make sure router descriptor doesnt eat the directory-signature
svn:r516
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 40e2ff51e..73ff278e0 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -198,9 +198,10 @@ dirserv_add_descriptor(const char **desc) log(LOG_WARNING, "no descriptor found."); goto err; } - end = strstr(start+6, "\nrouter "); - if (end) { + if ((end = strstr(start+6, "\nrouter "))) { ++end; /* Include NL. */ + } else if ((end = strstr(start+6, "\ndirectory-signature"))) { + ++end; } else { end = start+strlen(start); } @@ -336,6 +337,9 @@ dirserv_dump_directory_to_string(char *s, int maxlen, log_fn(LOG_WARNING,"couldn't sign digest"); return -1; } + log(LOG_DEBUG,"generated directory digest begins with %02x:%02x:%02x:%02x", + ((int)digest[0])&0xff,((int)digest[1])&0xff, + ((int)digest[2])&0xff,((int)digest[3])&0xff); strncpy(cp, "-----BEGIN SIGNATURE-----\n", maxlen-i); |