diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-11-30 12:07:59 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-11-30 12:07:59 -0500 |
commit | fd73a168ca5bf8ea6a0fa01878dd16d356d14cfa (patch) | |
tree | 1bb4b3739bd2db84ca5bc5752b7eb833c83964eb /src/or/rendservice.c | |
parent | 25d50decb275854c312c8ee4ce5fd7e3f2945e5c (diff) | |
parent | ee48eb1eb5e643cd8af2a32df3cf8c48965f6ce4 (diff) | |
download | tor-fd73a168ca5bf8ea6a0fa01878dd16d356d14cfa.tar.gz tor-fd73a168ca5bf8ea6a0fa01878dd16d356d14cfa.zip |
Merge branch 'maint-0.3.1' into maint-0.3.2
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r-- | src/or/rendservice.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 |