aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-07-01 01:16:59 +0000
committerNick Mathewson <nickm@torproject.org>2004-07-01 01:16:59 +0000
commit541add90a16a2b7b75e5aa3a54071f3a5db00502 (patch)
treee6fbde49f0a12931e102a5211651fd014d06f9b9 /src/or/or.h
parentf42f04c859a68dab45d021dd4197da816ec72b07 (diff)
downloadtor-541add90a16a2b7b75e5aa3a54071f3a5db00502.tar
tor-541add90a16a2b7b75e5aa3a54071f3a5db00502.tar.gz
Track routers by hash of identity key; use hex hash of identity key in place of nickname; accept (and use) hash of identity key in EXTEND cells.
svn:r1994
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 496109a31..12503e05d 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -493,8 +493,9 @@ struct connection_t {
char *address; /**< FQDN (or IP) of the guy on the other end.
* strdup into this, because free_connection frees it.
*/
- crypto_pk_env_t *identity_pkey; /**> Public RSA key for the other side's
+ crypto_pk_env_t *identity_pkey; /**< Public RSA key for the other side's
* signing key. */
+ char identity_digest[DIGEST_LEN]; /**< Hash of identity_pkey */
char *nickname; /**< Nickname of OR on other side (if any). */
/* Used only by OR connections: */
@@ -569,7 +570,7 @@ typedef struct {
crypto_pk_env_t *onion_pkey; /**< Public RSA key for onions. */
crypto_pk_env_t *identity_pkey; /**< Public RSA key for signing. */
-
+ char identity_digest[DIGEST_LEN]; /** Digest of identity key */
char *platform; /**< What software/operating system is this OR using? */
@@ -633,6 +634,8 @@ struct crypt_path_t {
uint32_t addr;
/** Port of the OR at this step. */
uint16_t port;
+ /** Identity key digest of the OR at this step. */
+ char identity_digest[DIGEST_LEN];
/** Is the circuit built to this step? Must be one of:
* - CPATH_STATE_CLOSED (The circuit has not been extended to this step)
@@ -1044,6 +1047,7 @@ void connection_write_to_buf(const char *string, int len, connection_t *conn);
connection_t *connection_twin_get_by_addr_port(uint32_t addr, uint16_t port);
connection_t *connection_exact_get_by_addr_port(uint32_t addr, uint16_t port);
+connection_t *connection_get_by_identity_digest(const char *digest, int type);
connection_t *connection_get_by_type(int type);
connection_t *connection_get_by_type_state(int type, int state);
@@ -1341,7 +1345,9 @@ void router_add_running_routers_to_smartlist(struct smartlist_t *sl);
routerinfo_t *router_choose_random_node(char *preferred, char *excluded,
struct smartlist_t *excludedsmartlist);
routerinfo_t *router_get_by_addr_port(uint32_t addr, uint16_t port);
-routerinfo_t *router_get_by_nickname(char *nickname);
+routerinfo_t *router_get_by_nickname(const char *nickname);
+routerinfo_t *router_get_by_hexdigest(const char *hexdigest);
+routerinfo_t *router_get_by_digest(const char *digest);
void router_get_routerlist(routerlist_t **prouterlist);
void routerlist_free(routerlist_t *routerlist);
void routerlist_clear_trusted_directories(void);