summaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
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
commit5fc0587c040339357bc3fc37f1b5474f1c3d1a33 (patch)
treea8b8d67d703f07590495e659957573f012ac5ec8 /src/or/rendservice.c
parentd459c08b7d5cb1766bda5443ea2750bca160212d (diff)
parent7e2b012b46a4ade2818e47be15d76255cf6f121e (diff)
downloadtor-5fc0587c040339357bc3fc37f1b5474f1c3d1a33.tar.gz
tor-5fc0587c040339357bc3fc37f1b5474f1c3d1a33.zip
Merge branch 'maint-0.2.9' into maint-0.3.0
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 8087e88499..67a94f7021 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1879,6 +1879,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) {
@@ -1953,9 +1954,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) {
@@ -3974,6 +3976,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