summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-08-25 20:33:17 +0000
committerNick Mathewson <nickm@torproject.org>2005-08-25 20:33:17 +0000
commit54a6a8f0ef2695423ce5e3e1583c97786a2449a5 (patch)
treed3b822efd1e52fc171cbc8d11a13b31e20339c31 /src/or/routerparse.c
parentf0893ddc8c6372b67200dad5ff4cc16fbe2ecc69 (diff)
downloadtor-54a6a8f0ef2695423ce5e3e1583c97786a2449a5.tar.gz
tor-54a6a8f0ef2695423ce5e3e1583c97786a2449a5.zip
Start implementing the server side of the new directory protocol.
Probably very buggy, since I can't actually run an authdir. Features - Generate and publish new network-status format - Code to cache and re-serve network-status objects generated by others. - Publish individual descriptors (by fingerprint, by "all", and by "tell me yours.") [Still needs compression logic] - Publish client and server recommended versions seprately. - Add digest of descriptor to routerinfo_t, so we can track them better, and length, so we can server them more easily. Cleanups - Unify code to sign directory-like things - Make resolve_my_address() able to tell you which name it wound up resolving. - Unify code to store and serve directory-like things so it all uses cached_dir_t. - Unify code to set the value of cached_dir_t objects. svn:r4835
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 73e2ca8f96..6ebd5ff296 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -179,6 +179,14 @@ router_get_runningrouters_hash(const char *s, char *digest)
"network-status","\ndirectory-signature");
}
+/** DOCDOC */
+int
+router_get_networkstatus_v2_hash(const char *s, char *digest)
+{
+ return router_get_hash_impl(s,digest,
+ "network-status-version","\ndirectory-signature");
+}
+
/**
* Find the first instance of "recommended-software ...\n" at the start of
* a line; return a newly allocated string containing the "..." portion.
@@ -857,6 +865,8 @@ router_parse_entry_from_string(const char *s, const char *end)
router = tor_malloc_zero(sizeof(routerinfo_t));
router->signed_descriptor = tor_strndup(s, end-s);
+ router->signed_descriptor_len = end-s;
+ crypto_digest(router->signed_descriptor_digest, s, end-s);
ports_set = bw_set = 0;
if (tok->n_args == 2 || tok->n_args == 5 || tok->n_args == 6) {