From: George Kadianakis Date: Tue, 26 Sep 2017 12:23:23 +0000 (+0300) Subject: prop224: Fix one last instance of get_time_period_num() with now. X-Git-Tag: tor-0.3.3.0-alpha-dev~8^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=178a2bbcff74b7f9df2a192f45f1f91f3a9f935d;p=thirdparty%2Ftor.git prop224: Fix one last instance of get_time_period_num() with now. When purging last HSDir requests, we used time(NULL) for computing the service blinded key but in all other places in our codebase we actually use the consensus times. That can cause wrong behavior if the consensus is in a different time period than time(NULL). This commit is required for proper purging of HSDir requests. --- diff --git a/src/or/hs_client.c b/src/or/hs_client.c index 201e808180..560ccf8499 100644 --- a/src/or/hs_client.c +++ b/src/or/hs_client.c @@ -100,7 +100,7 @@ purge_hid_serv_request(const ed25519_public_key_t *identity_pk) * from the previous time period. That is fine because they will expire at * some point and we don't care about those anymore. */ hs_build_blinded_pubkey(identity_pk, NULL, 0, - hs_get_time_period_num(approx_time()), &blinded_pk); + hs_get_time_period_num(0), &blinded_pk); if (BUG(ed25519_public_to_base64(base64_blinded_pk, &blinded_pk) < 0)) { return; }