diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-09-25 05:17:11 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-09-25 05:17:11 +0000 |
commit | 3d4ccb781ae5d74f0e16a63c89e08459d15cccf1 (patch) | |
tree | 3e9f214701c4a09bc45b453374bd6806f253a1a4 /src/or/onion.c | |
parent | a3bd8b5483bfb3813ba814c8d73840ca993e0298 (diff) | |
download | tor-3d4ccb781ae5d74f0e16a63c89e08459d15cccf1.tar tor-3d4ccb781ae5d74f0e16a63c89e08459d15cccf1.tar.gz |
Refactor buffers; implement descriptors.
'buf_t' is now an opaque type defined in buffers.c .
Router descriptors now include all keys; routers generate keys as
needed on startup (in a newly defined "data directory"), and generate
their own descriptors. Descriptors are now self-signed.
Implementation is not complete: descriptors are never published; and
upon receiving a descriptor, the directory doesn't do anything with
it.
At least "routers.or" and orkeygen are now obsolete, BTW.
svn:r483
Diffstat (limited to 'src/or/onion.c')
-rw-r--r-- | src/or/onion.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/onion.c b/src/or/onion.c index 1c6f605a8..d884b983a 100644 --- a/src/or/onion.c +++ b/src/or/onion.c @@ -231,7 +231,7 @@ static unsigned int *new_route(double cw, routerinfo_t **rarray, int rarray_len, choice = choice % rarray_len; log(LOG_DEBUG,"new_route(): Contemplating router %u.",choice); if(choice == oldchoice || - (oldchoice < rarray_len && !crypto_pk_cmp_keys(rarray[choice]->pkey, rarray[oldchoice]->pkey)) || + (oldchoice < rarray_len && !crypto_pk_cmp_keys(rarray[choice]->onion_pkey, rarray[oldchoice]->onion_pkey)) || (options.OnionRouter && !connection_twin_get_by_addr_port(rarray[choice]->addr, rarray[choice]->or_port))) { /* Same router as last choice, or router twin, * or no routers with that key are connected to us. @@ -263,7 +263,7 @@ static int count_acceptable_routers(routerinfo_t **rarray, int rarray_len) { } } for(j=0;j<i;j++) { - if(!crypto_pk_cmp_keys(rarray[i]->pkey, rarray[j]->pkey)) { + if(!crypto_pk_cmp_keys(rarray[i]->onion_pkey, rarray[j]->onion_pkey)) { /* these guys are twins. so we've already counted him. */ log(LOG_DEBUG,"Nope, %d is a twin of %d.",i,j); goto next_i_loop; @@ -311,8 +311,8 @@ crypt_path_t *onion_generate_cpath(routerinfo_t **firsthop) { log(LOG_DEBUG,"onion_generate_cpath(): %u : %s:%u, %u/%u",routelen-i, inet_ntoa(netaddr), (rarray[route[i]])->or_port, - (int) (rarray[route[i]])->pkey, - crypto_pk_keysize((rarray[route[i]])->pkey)); + (int) (rarray[route[i]])->onion_pkey, + crypto_pk_keysize((rarray[route[i]])->onion_pkey)); } /* create the cpath layer by layer, starting at the last hop */ |