mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 06:33:44 +01:00
vote: TROVE-2018-005 Make DirAuths omit misbehaving routers from their vote.
This commit is contained in:
parent
701c2b69f5
commit
3283619acf
@ -4358,6 +4358,12 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
|
|||||||
microdescriptors = smartlist_new();
|
microdescriptors = smartlist_new();
|
||||||
|
|
||||||
SMARTLIST_FOREACH_BEGIN(routers, routerinfo_t *, ri) {
|
SMARTLIST_FOREACH_BEGIN(routers, routerinfo_t *, ri) {
|
||||||
|
/* If it has a protover list and contains a protocol name greater than
|
||||||
|
* MAX_PROTOCOL_NAME_LENGTH, skip it. */
|
||||||
|
if (ri->protocol_list &&
|
||||||
|
protover_contains_long_protocol_names(ri->protocol_list)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (ri->cache_info.published_on >= cutoff) {
|
if (ri->cache_info.published_on >= cutoff) {
|
||||||
routerstatus_t *rs;
|
routerstatus_t *rs;
|
||||||
vote_routerstatus_t *vrs;
|
vote_routerstatus_t *vrs;
|
||||||
|
@ -276,6 +276,18 @@ parse_protocol_list(const char *s)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the unparsed protover in <b>s</b> would contain a protocol
|
||||||
|
* name longer than MAX_PROTOCOL_NAME_LENGTH, and false otherwise.
|
||||||
|
*/
|
||||||
|
bool
|
||||||
|
protover_contains_long_protocol_names(const char *s)
|
||||||
|
{
|
||||||
|
if (!parse_protocol_list(s))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a protocol type and version number, return true iff we know
|
* Given a protocol type and version number, return true iff we know
|
||||||
* how to speak that protocol.
|
* how to speak that protocol.
|
||||||
|
@ -42,6 +42,7 @@ typedef enum protocol_type_t {
|
|||||||
PRT_CONS,
|
PRT_CONS,
|
||||||
} protocol_type_t;
|
} protocol_type_t;
|
||||||
|
|
||||||
|
bool protover_contains_long_protocol_names(const char *s);
|
||||||
int protover_all_supported(const char *s, char **missing);
|
int protover_all_supported(const char *s, char **missing);
|
||||||
int protover_is_supported_here(protocol_type_t pr, uint32_t ver);
|
int protover_is_supported_here(protocol_type_t pr, uint32_t ver);
|
||||||
const char *protover_get_supported_protocols(void);
|
const char *protover_get_supported_protocols(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user