aboutsummaryrefslogtreecommitdiff
path: root/src/test/hs_test_helpers.c
diff options
context:
space:
mode:
authorSuphanat Chunhapanya <haxx.pop@gmail.com>2018-04-22 01:13:50 +0700
committerDavid Goulet <dgoulet@torproject.org>2018-09-07 14:02:43 -0400
commit69fb25b0f6f3c2e7397b3f5e49213025ab1e8173 (patch)
tree73255e42b50e416b2d7022a199ff96c953f3b185 /src/test/hs_test_helpers.c
parent7acb720027dd702332fb5a539683742801443f00 (diff)
downloadtor-69fb25b0f6f3c2e7397b3f5e49213025ab1e8173.tar.gz
tor-69fb25b0f6f3c2e7397b3f5e49213025ab1e8173.zip
test: HS v3 descriptor decoding with client authorization
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/hs_test_helpers.c')
-rw-r--r--src/test/hs_test_helpers.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/hs_test_helpers.c b/src/test/hs_test_helpers.c
index bb2ba981f9..f8c582afc8 100644
--- a/src/test/hs_test_helpers.c
+++ b/src/test/hs_test_helpers.c
@@ -226,6 +226,32 @@ hs_helper_desc_equal(const hs_descriptor_t *desc1,
* encrypted blob. As contrast to the decoding process where we populate a
* descriptor object. */
+ /* Superencrypted data section. */
+ tt_mem_op(desc1->superencrypted_data.auth_ephemeral_pubkey.public_key, OP_EQ,
+ desc2->superencrypted_data.auth_ephemeral_pubkey.public_key,
+ CURVE25519_PUBKEY_LEN);
+
+ /* Auth clients. */
+ {
+ tt_assert(desc1->superencrypted_data.clients);
+ tt_assert(desc2->superencrypted_data.clients);
+ tt_int_op(smartlist_len(desc1->superencrypted_data.clients), ==,
+ smartlist_len(desc2->superencrypted_data.clients));
+ for (int i=0;
+ i < smartlist_len(desc1->superencrypted_data.clients);
+ i++) {
+ 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,
+ sizeof(client1->client_id));
+ tor_memeq(client1->iv, client2->iv,
+ sizeof(client1->iv));
+ tor_memeq(client1->encrypted_cookie, client2->encrypted_cookie,
+ sizeof(client1->encrypted_cookie));
+ }
+ }
+
/* Encrypted data section. */
tt_uint_op(desc1->encrypted_data.create2_ntor, ==,
desc2->encrypted_data.create2_ntor);