diff options
author | David Goulet <dgoulet@torproject.org> | 2016-08-25 11:52:29 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2016-11-04 10:32:50 -0400 |
commit | 1517a8a2ebeb645669531b53bad52879d6da39d2 (patch) | |
tree | 4d77ab174e780286b5ea2e908ac158b812fee5bf /src/or/hs_common.c | |
parent | d795ed5871010b8ad6d216f5f4381e4191cb147c (diff) | |
download | tor-1517a8a2ebeb645669531b53bad52879d6da39d2.tar.gz tor-1517a8a2ebeb645669531b53bad52879d6da39d2.zip |
Add EnableOnionServicesV3 consensus parameter
This parameter controls if onion services version 3 (first version of prop224)
is enabled or not. If disabled, the tor daemon will not support the protocol
for all components such as relay, directory, service and client. If the
parameter is not found, it's enabled by default.
Closes #19899
Signed-off-by: David Goulet <dgoulet@torproject.org>
Signed-off-by: George Kadianakis <desnacked@riseup.net>
Diffstat (limited to 'src/or/hs_common.c')
-rw-r--r-- | src/or/hs_common.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/or/hs_common.c b/src/or/hs_common.c index c78af531a7..448bf5b800 100644 --- a/src/or/hs_common.c +++ b/src/or/hs_common.c @@ -11,6 +11,8 @@ #include "or.h" +#include "config.h" +#include "networkstatus.h" #include "hs_common.h" #include "rendcommon.h" @@ -263,3 +265,16 @@ rend_data_get_pk_digest(const rend_data_t *rend_data, size_t *len_out) } } +/* Return true iff the Onion Services protocol version 3 is enabled. This only + * considers the consensus parameter. If the parameter is not found, the + * default is that it's enabled. */ +int +hs_v3_protocol_is_enabled(void) +{ + /* This consensus param controls if the the onion services version 3 is + * enabled or not which is the first version of the next generation + * (proposal 224). If this option is set to 0, the tor daemon won't support + * the protocol as either a relay, directory, service or client. By default, + * it's enabled if the parameter is not found. */ + return networkstatus_get_param(NULL, "EnableOnionServicesV3", 1, 0, 1); +} |