|
@@ -425,7 +425,7 @@ test_service_intro_point(void *arg)
|
|
/* Test functions that uses a service intropoints map with that previously
|
|
/* Test functions that uses a service intropoints map with that previously
|
|
* created object (non legacy). */
|
|
* created object (non legacy). */
|
|
{
|
|
{
|
|
- uint8_t garbage[DIGEST256_LEN] = {0};
|
|
|
|
|
|
+ ed25519_public_key_t garbage = { {0} };
|
|
hs_service_intro_point_t *query;
|
|
hs_service_intro_point_t *query;
|
|
|
|
|
|
service = hs_service_new(get_options());
|
|
service = hs_service_new(get_options());
|
|
@@ -436,8 +436,7 @@ test_service_intro_point(void *arg)
|
|
service_intro_point_add(service->desc_current->intro_points.map, ip);
|
|
service_intro_point_add(service->desc_current->intro_points.map, ip);
|
|
query = service_intro_point_find(service, &ip->auth_key_kp.pubkey);
|
|
query = service_intro_point_find(service, &ip->auth_key_kp.pubkey);
|
|
tt_mem_op(query, OP_EQ, ip, sizeof(hs_service_intro_point_t));
|
|
tt_mem_op(query, OP_EQ, ip, sizeof(hs_service_intro_point_t));
|
|
- query = service_intro_point_find(service,
|
|
|
|
- (const ed25519_public_key_t *) garbage);
|
|
|
|
|
|
+ query = service_intro_point_find(service, &garbage);
|
|
tt_ptr_op(query, OP_EQ, NULL);
|
|
tt_ptr_op(query, OP_EQ, NULL);
|
|
|
|
|
|
/* While at it, can I find the descriptor with the intro point? */
|
|
/* While at it, can I find the descriptor with the intro point? */
|
|
@@ -677,6 +676,8 @@ test_intro_established(void *arg)
|
|
|
|
|
|
circ = helper_create_origin_circuit(CIRCUIT_PURPOSE_S_ESTABLISH_INTRO,
|
|
circ = helper_create_origin_circuit(CIRCUIT_PURPOSE_S_ESTABLISH_INTRO,
|
|
flags);
|
|
flags);
|
|
|
|
+ tt_assert(circ);
|
|
|
|
+
|
|
/* Test a wrong purpose. */
|
|
/* Test a wrong purpose. */
|
|
TO_CIRCUIT(circ)->purpose = CIRCUIT_PURPOSE_S_INTRO;
|
|
TO_CIRCUIT(circ)->purpose = CIRCUIT_PURPOSE_S_INTRO;
|
|
setup_full_capture_of_logs(LOG_WARN);
|
|
setup_full_capture_of_logs(LOG_WARN);
|
|
@@ -724,7 +725,8 @@ test_intro_established(void *arg)
|
|
tt_int_op(TO_CIRCUIT(circ)->purpose, OP_EQ, CIRCUIT_PURPOSE_S_INTRO);
|
|
tt_int_op(TO_CIRCUIT(circ)->purpose, OP_EQ, CIRCUIT_PURPOSE_S_INTRO);
|
|
|
|
|
|
done:
|
|
done:
|
|
- circuit_free(TO_CIRCUIT(circ));
|
|
|
|
|
|
+ if (circ)
|
|
|
|
+ circuit_free(TO_CIRCUIT(circ));
|
|
hs_free_all();
|
|
hs_free_all();
|
|
UNMOCK(circuit_mark_for_close_);
|
|
UNMOCK(circuit_mark_for_close_);
|
|
}
|
|
}
|
|
@@ -793,6 +795,7 @@ test_introduce2(void *arg)
|
|
dummy_state = tor_malloc_zero(sizeof(or_state_t));
|
|
dummy_state = tor_malloc_zero(sizeof(or_state_t));
|
|
|
|
|
|
circ = helper_create_origin_circuit(CIRCUIT_PURPOSE_S_INTRO, flags);
|
|
circ = helper_create_origin_circuit(CIRCUIT_PURPOSE_S_INTRO, flags);
|
|
|
|
+ tt_assert(circ);
|
|
|
|
|
|
/* Test a wrong purpose. */
|
|
/* Test a wrong purpose. */
|
|
TO_CIRCUIT(circ)->purpose = CIRCUIT_PURPOSE_S_ESTABLISH_INTRO;
|
|
TO_CIRCUIT(circ)->purpose = CIRCUIT_PURPOSE_S_ESTABLISH_INTRO;
|
|
@@ -844,7 +847,8 @@ test_introduce2(void *arg)
|
|
done:
|
|
done:
|
|
or_state_free(dummy_state);
|
|
or_state_free(dummy_state);
|
|
dummy_state = NULL;
|
|
dummy_state = NULL;
|
|
- circuit_free(TO_CIRCUIT(circ));
|
|
|
|
|
|
+ if (circ)
|
|
|
|
+ circuit_free(TO_CIRCUIT(circ));
|
|
hs_free_all();
|
|
hs_free_all();
|
|
UNMOCK(circuit_mark_for_close_);
|
|
UNMOCK(circuit_mark_for_close_);
|
|
}
|
|
}
|
|
@@ -1264,6 +1268,7 @@ test_upload_descriptors(void *arg)
|
|
|
|
|
|
ret = parse_rfc1123_time("Sat, 26 Oct 1985 13:00:00 UTC",
|
|
ret = parse_rfc1123_time("Sat, 26 Oct 1985 13:00:00 UTC",
|
|
&mock_ns.valid_after);
|
|
&mock_ns.valid_after);
|
|
|
|
+ tt_int_op(ret, OP_EQ, 0);
|
|
ret = parse_rfc1123_time("Sat, 26 Oct 1985 14:00:00 UTC",
|
|
ret = parse_rfc1123_time("Sat, 26 Oct 1985 14:00:00 UTC",
|
|
&mock_ns.fresh_until);
|
|
&mock_ns.fresh_until);
|
|
tt_int_op(ret, OP_EQ, 0);
|
|
tt_int_op(ret, OP_EQ, 0);
|
|
@@ -1339,6 +1344,7 @@ test_revision_counter_state(void *arg)
|
|
&desc_two->blinded_kp.pubkey,
|
|
&desc_two->blinded_kp.pubkey,
|
|
&service_found);
|
|
&service_found);
|
|
tt_int_op(service_found, OP_EQ, 0);
|
|
tt_int_op(service_found, OP_EQ, 0);
|
|
|
|
+ tt_u64_op(cached_rev_counter, OP_EQ, 0);
|
|
|
|
|
|
/* Now let's try with the right pubkeys */
|
|
/* Now let's try with the right pubkeys */
|
|
cached_rev_counter =check_state_line_for_service_rev_counter(state_line_one,
|
|
cached_rev_counter =check_state_line_for_service_rev_counter(state_line_one,
|