mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
r14421@tombo: nickm | 2008-02-24 17:05:18 -0500
Patch from mwenge: always willingly serve our own extrainfo from the controlport svn:r13699
This commit is contained in:
parent
b8f1092077
commit
ee8dce3084
@ -55,6 +55,9 @@ Changes in version 0.2.0.20-?? - 2008-02-??
|
||||
get saved to disk by SAVECONF. Make Tor automatically convert
|
||||
"HashedControlPassword" to this new option but only when it's
|
||||
given on the command line. Partial fix for bug 586.
|
||||
- If we have an extra-info document for our server, always make
|
||||
it available on the control port, even if we haven't gotten
|
||||
a copy of it from an authority yet. Patch from mwenge.
|
||||
|
||||
o Minor features (logging):
|
||||
- When SafeLogging is disabled, log addresses along with all TLS
|
||||
|
@ -1523,8 +1523,17 @@ getinfo_helper_dir(control_connection_t *control_conn,
|
||||
if (strlen(question) == HEX_DIGEST_LEN) {
|
||||
char d[DIGEST_LEN];
|
||||
signed_descriptor_t *sd = NULL;
|
||||
if (base16_decode(d, sizeof(d), question, strlen(question))==0)
|
||||
if (base16_decode(d, sizeof(d), question, strlen(question))==0) {
|
||||
/* XXXX this test should move into extrainfo_get_by_descriptor_digest,
|
||||
* but I don't want to risk affecting other parts of the code,
|
||||
* especially since the rules for using our own extrainfo (including
|
||||
* when it might be freed) are different from those for using one
|
||||
* we have downloaded. */
|
||||
if (router_extrainfo_digest_is_me(d))
|
||||
sd = &(router_get_my_extrainfo()->cache_info);
|
||||
else
|
||||
sd = extrainfo_get_by_descriptor_digest(d);
|
||||
}
|
||||
if (sd) {
|
||||
const char *body = signed_descriptor_get_body(sd);
|
||||
if (body)
|
||||
|
@ -2673,6 +2673,7 @@ dirserv_get_routerdescs(smartlist_t *descs_out, const char *key,
|
||||
SMARTLIST_FOREACH(digests, const char *, d,
|
||||
{
|
||||
if (router_digest_is_me(d)) {
|
||||
if (router_get_my_routerinfo()) /* make sure desc_routerinfo exists */
|
||||
smartlist_add(descs_out, &(router_get_my_routerinfo()->cache_info));
|
||||
} else {
|
||||
routerinfo_t *ri = router_get_by_digest(d);
|
||||
|
@ -3794,6 +3794,7 @@ routerinfo_t *router_get_my_routerinfo(void);
|
||||
extrainfo_t *router_get_my_extrainfo(void);
|
||||
const char *router_get_my_descriptor(void);
|
||||
int router_digest_is_me(const char *digest);
|
||||
int router_extrainfo_digest_is_me(const char *digest);
|
||||
int router_is_me(routerinfo_t *router);
|
||||
int router_fingerprint_is_me(const char *fp);
|
||||
int router_pick_published_address(or_options_t *options, uint32_t *addr);
|
||||
|
@ -1094,6 +1094,19 @@ router_digest_is_me(const char *digest)
|
||||
return identitykey && !memcmp(identitykey_digest, digest, DIGEST_LEN);
|
||||
}
|
||||
|
||||
/** Return true iff I'm a server and <b>digest</b> is equal to
|
||||
* my identity digest. */
|
||||
int
|
||||
router_extrainfo_digest_is_me(const char *digest)
|
||||
{
|
||||
if (!router_get_my_extrainfo())
|
||||
return 0;
|
||||
|
||||
return !memcmp(digest,
|
||||
&(router_get_my_extrainfo()->cache_info).signed_descriptor_digest,
|
||||
DIGEST_LEN);
|
||||
}
|
||||
|
||||
/** A wrapper around router_digest_is_me(). */
|
||||
int
|
||||
router_is_me(routerinfo_t *router)
|
||||
|
Loading…
Reference in New Issue
Block a user