diff options
-rw-r--r-- | auto_tests/onion_test.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/auto_tests/onion_test.c b/auto_tests/onion_test.c index b8145cc2..4489a894 100644 --- a/auto_tests/onion_test.c +++ b/auto_tests/onion_test.c | |||
@@ -176,10 +176,12 @@ START_TEST(test_basic) | |||
176 | ck_assert_msg((onion1_a != NULL) && (onion2_a != NULL), "Onion_Announce failed initializing."); | 176 | ck_assert_msg((onion1_a != NULL) && (onion2_a != NULL), "Onion_Announce failed initializing."); |
177 | uint8_t zeroes[64] = {0}; | 177 | uint8_t zeroes[64] = {0}; |
178 | randombytes(sb_data, sizeof(sb_data)); | 178 | randombytes(sb_data, sizeof(sb_data)); |
179 | uint64_t s; | ||
180 | memcpy(&s, sb_data, sizeof(uint64_t)); | ||
179 | memcpy(test_3_pub_key, nodes[3].client_id, crypto_box_PUBLICKEYBYTES); | 181 | memcpy(test_3_pub_key, nodes[3].client_id, crypto_box_PUBLICKEYBYTES); |
180 | ret = send_announce_request(onion1->net, &path, nodes[3], onion1->dht->self_public_key, | 182 | ret = send_announce_request(onion1->net, &path, nodes[3], onion1->dht->self_public_key, |
181 | onion1->dht->self_secret_key, | 183 | onion1->dht->self_secret_key, |
182 | zeroes, onion1->dht->self_public_key, onion1->dht->self_public_key, sb_data); | 184 | zeroes, onion1->dht->self_public_key, onion1->dht->self_public_key, s); |
183 | ck_assert_msg(ret == 0, "Failed to create/send onion announce_request packet."); | 185 | ck_assert_msg(ret == 0, "Failed to create/send onion announce_request packet."); |
184 | handled_test_3 = 0; | 186 | handled_test_3 = 0; |
185 | 187 | ||
@@ -190,11 +192,12 @@ START_TEST(test_basic) | |||
190 | } | 192 | } |
191 | 193 | ||
192 | randombytes(sb_data, sizeof(sb_data)); | 194 | randombytes(sb_data, sizeof(sb_data)); |
195 | memcpy(&s, sb_data, sizeof(uint64_t)); | ||
193 | memcpy(onion2_a->entries[1].public_key, onion2->dht->self_public_key, crypto_box_PUBLICKEYBYTES); | 196 | memcpy(onion2_a->entries[1].public_key, onion2->dht->self_public_key, crypto_box_PUBLICKEYBYTES); |
194 | onion2_a->entries[1].time = unix_time(); | 197 | onion2_a->entries[1].time = unix_time(); |
195 | networking_registerhandler(onion1->net, NET_PACKET_ONION_DATA_RESPONSE, &handle_test_4, onion1); | 198 | networking_registerhandler(onion1->net, NET_PACKET_ONION_DATA_RESPONSE, &handle_test_4, onion1); |
196 | send_announce_request(onion1->net, &path, nodes[3], onion1->dht->self_public_key, onion1->dht->self_secret_key, | 199 | send_announce_request(onion1->net, &path, nodes[3], onion1->dht->self_public_key, onion1->dht->self_secret_key, |
197 | test_3_ping_id, onion1->dht->self_public_key, onion1->dht->self_public_key, sb_data); | 200 | test_3_ping_id, onion1->dht->self_public_key, onion1->dht->self_public_key, s); |
198 | 201 | ||
199 | while (memcmp(onion2_a->entries[ONION_ANNOUNCE_MAX_ENTRIES - 2].public_key, onion1->dht->self_public_key, | 202 | while (memcmp(onion2_a->entries[ONION_ANNOUNCE_MAX_ENTRIES - 2].public_key, onion1->dht->self_public_key, |
200 | crypto_box_PUBLICKEYBYTES) != 0) { | 203 | crypto_box_PUBLICKEYBYTES) != 0) { |