aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_hs_ob.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-01-16 18:27:25 -0500
committerNick Mathewson <nickm@torproject.org>2020-01-21 10:31:29 -0500
commit4532c7ef6aa96d502412cbc61da91369bc3eaa44 (patch)
treeaef8b0cd5b94a5ab7d7967e9d3f90f963b5d737d /src/test/test_hs_ob.c
parent3484608bda4d8c329ad886ddf98087d775c43a72 (diff)
downloadtor-4532c7ef6aa96d502412cbc61da91369bc3eaa44.tar.gz
tor-4532c7ef6aa96d502412cbc61da91369bc3eaa44.zip
Turn hs_subcredential_t into a proper struct.
Diffstat (limited to 'src/test/test_hs_ob.c')
-rw-r--r--src/test/test_hs_ob.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/test/test_hs_ob.c b/src/test/test_hs_ob.c
index 37c57f795e..848a488be2 100644
--- a/src/test/test_hs_ob.c
+++ b/src/test/test_hs_ob.c
@@ -190,7 +190,7 @@ test_get_subcredentials(void *arg)
ed25519_keypair_generate(&onion_addr_kp_1, 0);
smartlist_add(config.ob_master_pubkeys, &onion_addr_kp_1.pubkey);
- uint8_t *subcreds = NULL;
+ hs_subcredential_t *subcreds = NULL;
size_t num = hs_ob_get_subcredentials(&config, &subcreds);
tt_uint_op(num, OP_EQ, 3);
@@ -200,14 +200,14 @@ test_get_subcredentials(void *arg)
const int steps[3] = {0, -1, 1};
for (unsigned int i = 0; i < num; i++) {
- uint8_t subcredential[DIGEST256_LEN];
+ hs_subcredential_t subcredential;
ed25519_public_key_t blinded_pubkey;
hs_build_blinded_pubkey(&onion_addr_kp_1.pubkey, NULL, 0, tp + steps[i],
&blinded_pubkey);
hs_get_subcredential(&onion_addr_kp_1.pubkey, &blinded_pubkey,
- subcredential);
- tt_mem_op(&(subcreds[i * sizeof(subcredential)]), OP_EQ, subcredential,
- sizeof(subcredential));
+ &subcredential);
+ tt_mem_op(subcreds[i].subcred, OP_EQ, subcredential.subcred,
+ SUBCRED_LEN);
}
done:
@@ -228,4 +228,3 @@ struct testcase_t hs_ob_tests[] = {
END_OF_TESTCASES
};
-