diff options
author | David Goulet <dgoulet@ev0ke.net> | 2016-05-09 18:58:19 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2016-07-01 14:01:41 -0400 |
commit | 056b6186adeb5ee92d0899f60b5e061bfc11a8ba (patch) | |
tree | b5af60e5a17611ab0242add80aa9f35694e8a529 /src/or/shared_random_state.c | |
parent | c0cec2ffd3d5f965413f56e93f89fabf81a2c3a0 (diff) | |
download | tor-056b6186adeb5ee92d0899f60b5e061bfc11a8ba.tar.gz tor-056b6186adeb5ee92d0899f60b5e061bfc11a8ba.zip |
prop250: Use RSA identity digest instead of fingerprint
The prop250 code used the RSA identity key fingerprint to index commit in a
digestmap instead of using the digest.
To behavior change except the fact that we are actually using digestmap
correctly.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/shared_random_state.c')
-rw-r--r-- | src/or/shared_random_state.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/or/shared_random_state.c b/src/or/shared_random_state.c index 7c75431040..326b8c9cf0 100644 --- a/src/or/shared_random_state.c +++ b/src/or/shared_random_state.c @@ -218,14 +218,14 @@ commit_add_to_state(sr_commit_t *commit, sr_state_t *state) tor_assert(commit); tor_assert(state); - saved_commit = digestmap_set(state->commits, commit->rsa_identity_fpr, + saved_commit = digestmap_set(state->commits, commit->rsa_identity, commit); if (saved_commit != NULL) { /* This means we already have that commit in our state so adding twice * the same commit is either a code flow error, a corrupted disk state * or some new unknown issue. */ log_warn(LD_DIR, "SR: Commit from %s exists in our state while " - "adding it: '%s'", commit->rsa_identity_fpr, + "adding it: '%s'", sr_commit_get_rsa_fpr(commit), commit->encoded_commit); sr_commit_free(saved_commit); } @@ -562,7 +562,7 @@ disk_state_put_commit_line(const sr_commit_t *commit, config_line_t *line) } tor_asprintf(&line->value, "%s %s %s%s", crypto_digest_algorithm_get_name(commit->alg), - commit->rsa_identity_fpr, + sr_commit_get_rsa_fpr(commit), commit->encoded_commit, reveal_str != NULL ? reveal_str : ""); if (reveal_str != NULL) { @@ -1124,17 +1124,17 @@ sr_state_update(time_t valid_after) } } -/* Return commit object from the given authority digest <b>identity</b>. +/* Return commit object from the given authority digest <b>rsa_identity</b>. * Return NULL if not found. */ sr_commit_t * -sr_state_get_commit(const char *rsa_fpr) +sr_state_get_commit(const char *rsa_identity) { sr_commit_t *commit; - tor_assert(rsa_fpr); + tor_assert(rsa_identity); state_query(SR_STATE_ACTION_GET, SR_STATE_OBJ_COMMIT, - (void *) rsa_fpr, (void *) &commit); + (void *) rsa_identity, (void *) &commit); return commit; } @@ -1150,7 +1150,7 @@ sr_state_add_commit(sr_commit_t *commit) (void *) commit, NULL); log_debug(LD_DIR, "SR: Commit from %s has been added to our state.", - commit->rsa_identity_fpr); + sr_commit_get_rsa_fpr(commit)); } /* Remove all commits from our state. */ @@ -1178,7 +1178,7 @@ sr_state_copy_reveal_info(sr_commit_t *saved_commit, const sr_commit_t *commit) state_query(SR_STATE_ACTION_SAVE, 0, NULL, NULL); log_debug(LD_DIR, "SR: Reveal value learned %s (for commit %s) from %s", saved_commit->encoded_reveal, saved_commit->encoded_commit, - saved_commit->rsa_identity_fpr); + sr_commit_get_rsa_fpr(saved_commit)); } /* Set the fresh SRV flag from our state. This doesn't need to trigger a |