aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dirauth
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-10-23 15:38:15 -0400
committerNick Mathewson <nickm@torproject.org>2019-10-24 20:30:32 -0400
commitdc6d7f072d7307c21df80b982c1d1f98130d3286 (patch)
tree93298a500138ab9c332c0fb16492188205241bcc /src/feature/dirauth
parent0cb42385378d539185a20ce8899cdc16cf46145c (diff)
downloadtor-dc6d7f072d7307c21df80b982c1d1f98130d3286.tar.gz
tor-dc6d7f072d7307c21df80b982c1d1f98130d3286.zip
Make foo_validate() functions call config_validate().
The former foo_validate() functions are now toplevel legacy_validate_fn callbacks. The new foo_validate() functions now call them. This change lets us remove the old shared_random disk state validation callback entirely.
Diffstat (limited to 'src/feature/dirauth')
-rw-r--r--src/feature/dirauth/shared_random_state.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/feature/dirauth/shared_random_state.c b/src/feature/dirauth/shared_random_state.c
index eeb005d477..e548eb4028 100644
--- a/src/feature/dirauth/shared_random_state.c
+++ b/src/feature/dirauth/shared_random_state.c
@@ -59,9 +59,6 @@ DUMMY_TYPECHECK_INSTANCE(sr_disk_state_t);
/** Our persistent state magic number. */
#define SR_DISK_STATE_MAGIC 0x98AB1254
-static int
-disk_state_validate_cb(const void *old_state, void *state, char **msg);
-
/** Array of variables that are saved to disk as a persistent state. */
static const config_var_t state_vars[] = {
V(Version, POSINT, "0"),
@@ -94,7 +91,6 @@ static const config_format_t state_format = {
offsetof(sr_disk_state_t, magic_),
},
.vars = state_vars,
- .legacy_validate_fn = disk_state_validate_cb,
.extra = &state_extra_var,
.config_suite_offset = -1,
};
@@ -339,21 +335,6 @@ disk_state_validate(const sr_disk_state_t *state)
return -1;
}
-/** Validate the disk state (NOP for now). */
-static int
-disk_state_validate_cb(const void *old_state, void *state, char **msg)
-{
- /* We don't use these; only options do. */
- (void) old_state;
-
- /* This is called by config_dump which is just before we are about to
- * write it to disk. At that point, our global memory state has been
- * copied to the disk state so it's fair to assume it's trustable. */
- (void) state;
- (void) msg;
- return 0;
-}
-
/** Parse the Commit line(s) in the disk state and translate them to the
* the memory state. Return 0 on success else -1 on error. */
static int