aboutsummaryrefslogtreecommitdiff
path: root/src/or/onion.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-10-28 11:15:21 -0400
committerNick Mathewson <nickm@torproject.org>2016-12-08 16:47:58 -0500
commit9e840e6c7d10a3dfa188d2186ce3c67ca1d698f5 (patch)
tree9361f0c7dc0663997200df0366bac68984916afd /src/or/onion.c
parent6788418f28930467121537f31c4b43f981ae6ca8 (diff)
downloadtor-9e840e6c7d10a3dfa188d2186ce3c67ca1d698f5.tar.gz
tor-9e840e6c7d10a3dfa188d2186ce3c67ca1d698f5.zip
Add ExtendByEd25519ID consensus parameter/torrc option
I need to be able to turn on Ed25519 support in client generation of extend cells so I can test it, but leave it off-by-default until enough clients support it for us to turn it on for a bunch at once. This is part of #15056 / prop#220.
Diffstat (limited to 'src/or/onion.c')
-rw-r--r--src/or/onion.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index f49707f07a..8e0896f360 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -1170,6 +1170,21 @@ created_cell_format(cell_t *cell_out, const created_cell_t *cell_in)
return 0;
}
+/** Return true iff we are configured (by torrc or by the networkstatus
+ * parameters) to use Ed25519 identities in our Extend2 cells. */
+static int
+should_include_ed25519_id_extend_cells(const networkstatus_t *ns,
+ const or_options_t *options)
+{
+ if (options->ExtendByEd25519ID != -1)
+ return options->ExtendByEd25519ID; /* The user has an opinion. */
+
+ return (int) networkstatus_get_param(ns, "ExtendByEd25519ID",
+ 0 /* default */,
+ 0 /* min */,
+ 1 /*max*/);
+}
+
/** Format the EXTEND{,2} cell in <b>cell_in</b>, storing its relay payload in
* <b>payload_out</b>, the number of bytes used in *<b>len_out</b>, and the
* relay command in *<b>command_out</b>. The <b>payload_out</b> must have