From dc6d7f072d7307c21df80b982c1d1f98130d3286 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 23 Oct 2019 15:38:15 -0400 Subject: 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. --- src/feature/dirauth/shared_random_state.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src/feature/dirauth/shared_random_state.c') 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 -- cgit v1.2.3-54-g00ecf