[tor-commits] [tor/master] Move AuthDirSharedRandomness to dirauth module.
nickm at torproject.org
nickm at torproject.org
Fri Jan 17 13:37:45 UTC 2020
commit f4f70e1f13bc66558926b3255a8783e3bdca5f66
Author: Nick Mathewson <nickm at torproject.org>
Date: Thu Dec 19 09:34:27 2019 -0500
Move AuthDirSharedRandomness to dirauth module.
---
src/app/config/config.c | 1 -
src/app/config/or_options_st.h | 6 ------
src/feature/dirauth/dirauth_options.inc | 6 ++++++
src/feature/dirauth/shared_random.c | 6 ++++--
4 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 02ab2f2f8..5ce5174da 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -679,7 +679,6 @@ static const config_var_t option_vars_[] = {
OBSOLETE("UseNTorHandshake"),
V_IMMUTABLE(User, STRING, NULL),
OBSOLETE("UserspaceIOCPBuffers"),
- V(AuthDirSharedRandomness, BOOL, "1"),
V(AuthDirTestEd25519LinkKeys, BOOL, "1"),
OBSOLETE("V1AuthoritativeDirectory"),
OBSOLETE("V2AuthoritativeDirectory"),
diff --git a/src/app/config/or_options_st.h b/src/app/config/or_options_st.h
index b55c364c2..dc36c4056 100644
--- a/src/app/config/or_options_st.h
+++ b/src/app/config/or_options_st.h
@@ -979,12 +979,6 @@ struct or_options_t {
*/
uint64_t MaxUnparseableDescSizeToLog;
- /** Bool (default: 1): Switch for the shared random protocol. Only
- * relevant to a directory authority. If off, the authority won't
- * participate in the protocol. If on (default), a flag is added to the
- * vote indicating participation. */
- int AuthDirSharedRandomness;
-
/** If 1, we skip all OOS checks. */
int DisableOOSCheck;
diff --git a/src/feature/dirauth/dirauth_options.inc b/src/feature/dirauth/dirauth_options.inc
index dddb53898..ec4d997f9 100644
--- a/src/feature/dirauth/dirauth_options.inc
+++ b/src/feature/dirauth/dirauth_options.inc
@@ -33,6 +33,12 @@ CONF_VAR(AuthDirMaxServersPerAddr, POSINT, 0, "2")
/** Boolean: Do we enforce key-pinning? */
CONF_VAR(AuthDirPinKeys, BOOL, 0, "1")
+/** Bool (default: 1): Switch for the shared random protocol. Only
+ * relevant to a directory authority. If off, the authority won't
+ * participate in the protocol. If on (default), a flag is added to the
+ * vote indicating participation. */
+CONF_VAR(AuthDirSharedRandomness, BOOL, 0, "1")
+
/** Which versions of tor should we tell users to run? */
CONF_VAR(RecommendedVersions, LINELIST, 0, NULL)
diff --git a/src/feature/dirauth/shared_random.c b/src/feature/dirauth/shared_random.c
index ebc595e51..f91a3a3e2 100644
--- a/src/feature/dirauth/shared_random.c
+++ b/src/feature/dirauth/shared_random.c
@@ -103,7 +103,9 @@
#include "feature/dirauth/dirvote.h"
#include "feature/dirauth/authmode.h"
+#include "feature/dirauth/dirauth_sys.h"
+#include "feature/dirauth/dirauth_options_st.h"
#include "feature/nodelist/authority_cert_st.h"
#include "feature/nodelist/networkstatus_st.h"
@@ -1130,7 +1132,7 @@ sr_get_string_for_vote(void)
char *vote_str = NULL;
digestmap_t *state_commits;
smartlist_t *chunks = smartlist_new();
- const or_options_t *options = get_options();
+ const dirauth_options_t *options = dirauth_get_options();
/* Are we participating in the protocol? */
if (!options->AuthDirSharedRandomness) {
@@ -1195,7 +1197,7 @@ sr_get_string_for_consensus(const smartlist_t *votes,
int32_t num_srv_agreements)
{
char *srv_str;
- const or_options_t *options = get_options();
+ const dirauth_options_t *options = dirauth_get_options();
tor_assert(votes);
More information about the tor-commits
mailing list