aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-11 12:23:21 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-11 12:23:21 -0400
commit328bcbf30568b811cedd8deb8a38d6b4bbe80130 (patch)
tree2222f64442958874f279ee57f714989edd0bf7fa /src
parenta7d0cbd4626a75e9b90ae50a042e59a7034949af (diff)
parent7ff67d0e90d1cdf206747649df79dbb88a7467a8 (diff)
downloadtor-328bcbf30568b811cedd8deb8a38d6b4bbe80130.tar.gz
tor-328bcbf30568b811cedd8deb8a38d6b4bbe80130.zip
Merge remote-tracking branch 'tor-github/pr/313'
Diffstat (limited to 'src')
-rw-r--r--src/feature/hs/hs_client.c7
-rw-r--r--src/feature/hs/hs_service.c7
-rw-r--r--src/test/hs_test_helpers.c6
-rw-r--r--src/test/test_hs_descriptor.c2
-rw-r--r--src/test/test_hs_service.c4
5 files changed, 12 insertions, 14 deletions
diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c
index 6f031eb3b9..a6384b87a3 100644
--- 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
index 43e5626a57..30d23eb771 100644
--- 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
index 4e13ba43a7..dcec1b9d48 100644
--- 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
index 4889281cb1..90f2be2906 100644
--- 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
index 6a061eaea4..bceeafd149 100644
--- 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();