summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-30 12:07:59 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-30 12:07:59 -0500
commitcef844d0179e7ef6721795ef1c449f5e4ed24e73 (patch)
treeaf863c7b215293d1eef3873e5d8e9a2d976e3c68 /src/or
parent6c355d576354a252c642ff6f3e7781580c007c48 (diff)
parentfd73a168ca5bf8ea6a0fa01878dd16d356d14cfa (diff)
downloadtor-cef844d0179e7ef6721795ef1c449f5e4ed24e73.tar.gz
tor-cef844d0179e7ef6721795ef1c449f5e4ed24e73.zip
Merge branch 'maint-0.3.2'
Diffstat (limited to 'src/or')
-rw-r--r--src/or/entrynodes.c3
-rw-r--r--src/or/protover.c5
-rw-r--r--src/or/rendservice.c8
-rw-r--r--src/or/routerlist.c5
4 files changed, 18 insertions, 3 deletions
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 21505ed13a..f9438361f0 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -740,7 +740,8 @@ node_is_possible_guard(const node_t *node)
node->is_stable &&
node->is_fast &&
node->is_valid &&
- node_is_dir(node));
+ node_is_dir(node) &&
+ !router_digest_is_me(node->identity));
}
/**
diff --git a/src/or/protover.c b/src/or/protover.c
index d6d14b24a2..748c0c2f50 100644
--- a/src/or/protover.c
+++ b/src/or/protover.c
@@ -737,6 +737,11 @@ protocol_list_contains(const smartlist_t *protos,
const char *
protover_compute_for_old_tor(const char *version)
{
+ if (version == NULL) {
+ /* No known version; guess the oldest series that is still supported. */
+ version = "0.2.5.15";
+ }
+
if (tor_version_as_new_as(version,
FIRST_TOR_VERSION_TO_ADVERTISE_PROTOCOLS)) {
return "";
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 60234a5c1f..f6ce907637 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1829,6 +1829,7 @@ rend_service_receive_introduction(origin_circuit_t *circuit,
time_t now = time(NULL);
time_t elapsed;
int replay;
+ size_t keylen;
/* Do some initial validation and logging before we parse the cell */
if (circuit->base_.purpose != CIRCUIT_PURPOSE_S_INTRO) {
@@ -1903,9 +1904,10 @@ rend_service_receive_introduction(origin_circuit_t *circuit,
}
/* check for replay of PK-encrypted portion. */
+ keylen = crypto_pk_keysize(intro_key);
replay = replaycache_add_test_and_elapsed(
intro_point->accepted_intro_rsa_parts,
- parsed_req->ciphertext, parsed_req->ciphertext_len,
+ parsed_req->ciphertext, MIN(parsed_req->ciphertext_len, keylen),
&elapsed);
if (replay) {
@@ -3912,6 +3914,10 @@ remove_invalid_intro_points(rend_service_t *service,
log_info(LD_REND, "Expiring %s as intro point for %s.",
safe_str_client(extend_info_describe(intro->extend_info)),
safe_str_client(service->service_id));
+ /* We might have put it in the retry list if so, undo. */
+ if (retry_nodes) {
+ smartlist_remove(retry_nodes, intro);
+ }
smartlist_add(service->expiring_nodes, intro);
SMARTLIST_DEL_CURRENT(service->intro_nodes, intro);
/* Intro point is expired, we need a new one thus don't consider it
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index ef1538279a..e92de77cc7 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2839,7 +2839,10 @@ router_choose_random_node(smartlist_t *excludedsmartlist,
}
} SMARTLIST_FOREACH_END(node);
- if ((r = routerlist_find_my_routerinfo()))
+ /* If the node_t is not found we won't be to exclude ourself but we
+ * won't be able to pick ourself in router_choose_random_node() so
+ * this is fine to at least try with our routerinfo_t object. */
+ if ((r = router_get_my_routerinfo()))
routerlist_add_node_and_family(excludednodes, r);
router_add_running_nodes_to_smartlist(sl, need_uptime, need_capacity,