diff options
author | David Goulet <dgoulet@torproject.org> | 2016-05-10 11:37:28 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2016-07-01 14:01:41 -0400 |
commit | 8ac88f6f9739c5fd5fd5b47af63592faa80b8307 (patch) | |
tree | 0bd2da4e51557dda7a5a263f1b0f9e1c7f5efa4c /src/or/shared_random.h | |
parent | 056b6186adeb5ee92d0899f60b5e061bfc11a8ba (diff) | |
download | tor-8ac88f6f9739c5fd5fd5b47af63592faa80b8307.tar.gz tor-8ac88f6f9739c5fd5fd5b47af63592faa80b8307.zip |
prop250: Add a valid flag to sr_commit_t
We assert on it using the ASSERT_COMMIT_VALID() macro in critical places
where we use them expecting a commit to be valid.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/shared_random.h')
-rw-r--r-- | src/or/shared_random.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/shared_random.h b/src/or/shared_random.h index 573c499efc..f89f47a11b 100644 --- a/src/or/shared_random.h +++ b/src/or/shared_random.h @@ -48,6 +48,9 @@ #define SR_SRV_VALUE_BASE64_LEN \ (((DIGEST256_LEN - 1) / 3) * 4 + 4) +/* Assert if commit valid flag is not set. */ +#define ASSERT_COMMIT_VALID(c) tor_assert((c)->valid) + /* Protocol phase. */ typedef enum { /* Commitment phase */ @@ -68,6 +71,8 @@ typedef struct sr_srv_t { typedef struct sr_commit_t { /* Hashing algorithm used. */ digest_algorithm_t alg; + /* Indicate if this commit has been verified thus valid. */ + unsigned int valid:1; /* Commit owner info */ |