Skip to content
Snippets Groups Projects
Commit 80b8abf7 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

r11618@Kushana: nickm | 2006-12-16 02:00:52 -0500

 Make router_is_me work without calling router_rebuild_descriptor.


svn:r9139
parent 9cd8feb6
Branches
Tags
No related merge requests found
......@@ -31,6 +31,7 @@ static time_t onionkey_set_at=0; /* When was onionkey last changed? */
static crypto_pk_env_t *onionkey=NULL;
static crypto_pk_env_t *lastonionkey=NULL;
static crypto_pk_env_t *identitykey=NULL;
static char identitykey_digest[DIGEST_LEN];
/** Replace the current onion key with <b>k</b>. Does not affect lastonionkey;
* to update onionkey correctly, call rotate_onion_key().
......@@ -90,6 +91,7 @@ set_identity_key(crypto_pk_env_t *k)
if (identitykey)
crypto_free_pk_env(identitykey);
identitykey = k;
crypto_pk_get_digest(identitykey, identitykey_digest);
}
/** Returns the current identity key; requires that the identity key has been
......@@ -717,10 +719,7 @@ router_compare_to_my_exit_policy(edge_connection_t *conn)
int
router_digest_is_me(const char *digest)
{
routerinfo_t *me = router_get_my_routerinfo();
if (!me || memcmp(me->cache_info.identity_digest, digest, DIGEST_LEN))
return 0;
return 1;
return identitykey && !memcmp(identitykey_digest, digest, DIGEST_LEN);
}
/** A wrapper around router_digest_is_me(). */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment