summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-04-04 20:27:04 -0400
committerNick Mathewson <nickm@torproject.org>2019-04-04 20:27:04 -0400
commit0e7b34354a1789ff3b2d39a98ca8ebcb37ef4664 (patch)
tree6e059f489b3c155e4c98ead6a76d1a2e14ed7b23 /src
parent0b6769a99e4493a0b69fcbedda3febc6028391fb (diff)
parentd016bbaa7dfb3586c682c0070b79e174e8a73c19 (diff)
downloadtor-0e7b34354a1789ff3b2d39a98ca8ebcb37ef4664.tar.gz
tor-0e7b34354a1789ff3b2d39a98ca8ebcb37ef4664.zip
Merge branch 'maint-0.4.0'
Diffstat (limited to 'src')
-rw-r--r--src/feature/dirauth/dirvote.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c
index ba7b2f1de6..29f5d04509 100644
--- a/src/feature/dirauth/dirvote.c
+++ b/src/feature/dirauth/dirvote.c
@@ -320,18 +320,17 @@ format_networkstatus_vote(crypto_pk_t *private_signing_key,
if (!tor_digest256_is_zero((const char *)v3_ns->bw_file_digest256)) {
/* Encode the digest. */
char b64_digest_bw_file[BASE64_DIGEST256_LEN+1] = {0};
- if (digest256_to_base64(b64_digest_bw_file,
- (const char *)v3_ns->bw_file_digest256)>0) {
- /* "bandwidth-file-digest" 1*(SP algorithm "=" digest) NL */
- char *digest_algo_b64_digest_bw_file = NULL;
- tor_asprintf(&digest_algo_b64_digest_bw_file, "%s=%s",
- crypto_digest_algorithm_get_name(DIGEST_ALG_BW_FILE),
- b64_digest_bw_file);
- /* No need for tor_strdup(""), format_line_if_present does it. */
- bw_file_digest = format_line_if_present(
+ digest256_to_base64(b64_digest_bw_file,
+ (const char *)v3_ns->bw_file_digest256);
+ /* "bandwidth-file-digest" 1*(SP algorithm "=" digest) NL */
+ char *digest_algo_b64_digest_bw_file = NULL;
+ tor_asprintf(&digest_algo_b64_digest_bw_file, "%s=%s",
+ crypto_digest_algorithm_get_name(DIGEST_ALG_BW_FILE),
+ b64_digest_bw_file);
+ /* No need for tor_strdup(""), format_line_if_present does it. */
+ bw_file_digest = format_line_if_present(
"bandwidth-file-digest", digest_algo_b64_digest_bw_file);
- tor_free(digest_algo_b64_digest_bw_file);
- }
+ tor_free(digest_algo_b64_digest_bw_file);
}
smartlist_add_asprintf(chunks,