aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-09-20 11:01:10 -0400
committerNick Mathewson <nickm@torproject.org>2013-09-20 11:01:10 -0400
commit6178aaea0698d7f62754c2aa1574ad7fd4fa781d (patch)
treed60df65fdf156d8caffb572acb79ff76a37c47d1 /src/or/rendclient.c
parentee01e41937947eb77c02f552d59090c0ea280f98 (diff)
parent07bb17185681f875be461c4fea6c661fae2dfde9 (diff)
downloadtor-6178aaea0698d7f62754c2aa1574ad7fd4fa781d.tar
tor-6178aaea0698d7f62754c2aa1574ad7fd4fa781d.tar.gz
Merge remote-tracking branch 'origin/maint-0.2.4'
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r--src/or/rendclient.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 8b8c0e505..b1d4bf31d 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -16,6 +16,7 @@
#include "connection_edge.h"
#include "directory.h"
#include "main.h"
+#include "networkstatus.h"
#include "nodelist.h"
#include "relay.h"
#include "rendclient.h"
@@ -127,6 +128,16 @@ rend_client_reextend_intro_circuit(origin_circuit_t *circ)
return result;
}
+/** Return true iff we should send timestamps in our INTRODUCE1 cells */
+static int
+rend_client_should_send_timestamp(void)
+{
+ if (get_options()->Support022HiddenServices >= 0)
+ return get_options()->Support022HiddenServices;
+
+ return networkstatus_get_param(NULL, "Support022HiddenServices", 1, 0, 1);
+}
+
/** Called when we're trying to connect an ap conn; sends an INTRODUCE1 cell
* down introcirc if possible.
*/
@@ -238,7 +249,14 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
REND_DESC_COOKIE_LEN);
v3_shift += 2+REND_DESC_COOKIE_LEN;
}
- set_uint32(tmp+v3_shift+1, htonl((uint32_t)time(NULL)));
+ if (rend_client_should_send_timestamp()) {
+ time_t now = (uint32_t)time(NULL);
+ now += 300;
+ now -= now % 600;
+ set_uint32(tmp+v3_shift+1, htonl(now));
+ } else {
+ set_uint32(tmp+v3_shift+1, 0);
+ }
v3_shift += 4;
} /* if version 2 only write version number */
else if (entry->parsed->protocols & (1<<2)) {