tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 328bcbf30568b811cedd8deb8a38d6b4bbe80130
parent a7d0cbd4626a75e9b90ae50a042e59a7034949af
Author: Nick Mathewson <nickm@torproject.org>
Date:   Tue, 11 Sep 2018 12:23:21 -0400

Merge remote-tracking branch 'tor-github/pr/313'

Diffstat:
Msrc/feature/hs/hs_client.c | 7+++----
Msrc/feature/hs/hs_service.c | 7+++----
Msrc/test/hs_test_helpers.c | 6+++---
Msrc/test/test_hs_descriptor.c | 2++
Msrc/test/test_hs_service.c | 4+---
5 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c @@ -1524,10 +1524,9 @@ parse_auth_file_content(const char *client_key_str) if (seckey_b32) { memwipe(seckey_b32, 0, strlen(seckey_b32)); } - if (fields) { - SMARTLIST_FOREACH(fields, char *, s, tor_free(s)); - smartlist_free(fields); - } + tor_assert(fields); + SMARTLIST_FOREACH(fields, char *, s, tor_free(s)); + smartlist_free(fields); return auth; } diff --git a/src/feature/hs/hs_service.c b/src/feature/hs/hs_service.c @@ -1192,10 +1192,9 @@ parse_authorized_client(const char *client_key_str) if (pubkey_b32) { memwipe(pubkey_b32, 0, strlen(pubkey_b32)); } - if (fields) { - SMARTLIST_FOREACH(fields, char *, s, tor_free(s)); - smartlist_free(fields); - } + tor_assert(fields); + SMARTLIST_FOREACH(fields, char *, s, tor_free(s)); + smartlist_free(fields); return client; } diff --git a/src/test/hs_test_helpers.c b/src/test/hs_test_helpers.c @@ -241,11 +241,11 @@ hs_helper_desc_equal(const hs_descriptor_t *desc1, hs_desc_authorized_client_t *client1 = smartlist_get(desc1->superencrypted_data.clients, i), *client2 = smartlist_get(desc2->superencrypted_data.clients, i); - tor_memeq(client1->client_id, client2->client_id, + tt_mem_op(client1->client_id, OP_EQ, client2->client_id, sizeof(client1->client_id)); - tor_memeq(client1->iv, client2->iv, + tt_mem_op(client1->iv, OP_EQ, client2->iv, sizeof(client1->iv)); - tor_memeq(client1->encrypted_cookie, client2->encrypted_cookie, + tt_mem_op(client1->encrypted_cookie, OP_EQ, client2->encrypted_cookie, sizeof(client1->encrypted_cookie)); } } diff --git a/src/test/test_hs_descriptor.c b/src/test/test_hs_descriptor.c @@ -675,6 +675,8 @@ test_decode_bad_signature(void *arg) (void) arg; + memset(&desc_plaintext, 0, sizeof(desc_plaintext)); + /* Update approx time to dodge cert expiration */ update_approx_time(1502661599); diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c @@ -563,9 +563,7 @@ test_load_keys_with_client_auth(void *arg) } SMARTLIST_FOREACH_END(pubkey_b32); done: - if (pubkey_b32_list) { - SMARTLIST_FOREACH(pubkey_b32_list, char *, s, tor_free(s)); - } + SMARTLIST_FOREACH(pubkey_b32_list, char *, s, tor_free(s)); smartlist_free(pubkey_b32_list); tor_free(hsdir_v3); hs_free_all();