diff options
Diffstat (limited to 'auto_tests/dht_test.c')
-rw-r--r-- | auto_tests/dht_test.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/auto_tests/dht_test.c b/auto_tests/dht_test.c index 479eb330..32985bca 100644 --- a/auto_tests/dht_test.c +++ b/auto_tests/dht_test.c | |||
@@ -85,7 +85,7 @@ void test_addto_lists_update(DHT *dht, | |||
85 | { | 85 | { |
86 | int used, test, test1, test2, found; | 86 | int used, test, test1, test2, found; |
87 | IP_Port test_ipp; | 87 | IP_Port test_ipp; |
88 | uint8_t test_id[CLIENT_ID_SIZE]; | 88 | uint8_t test_id[crypto_box_PUBLICKEYBYTES]; |
89 | uint8_t ipv6 = ip_port->ip.family == AF_INET6 ? 1 : 0; | 89 | uint8_t ipv6 = ip_port->ip.family == AF_INET6 ? 1 : 0; |
90 | 90 | ||
91 | // check id update for existing ip_port | 91 | // check id update for existing ip_port |
@@ -153,7 +153,7 @@ void test_addto_lists_bad(DHT *dht, | |||
153 | { | 153 | { |
154 | // check "bad" clients replacement | 154 | // check "bad" clients replacement |
155 | int used, test1, test2, test3; | 155 | int used, test1, test2, test3; |
156 | uint8_t public_key[CLIENT_ID_SIZE], test_id1[CLIENT_ID_SIZE], test_id2[CLIENT_ID_SIZE], test_id3[CLIENT_ID_SIZE]; | 156 | uint8_t public_key[crypto_box_PUBLICKEYBYTES], test_id1[crypto_box_PUBLICKEYBYTES], test_id2[crypto_box_PUBLICKEYBYTES], test_id3[crypto_box_PUBLICKEYBYTES]; |
157 | uint8_t ipv6 = ip_port->ip.family == AF_INET6 ? 1 : 0; | 157 | uint8_t ipv6 = ip_port->ip.family == AF_INET6 ? 1 : 0; |
158 | 158 | ||
159 | randombytes(public_key, sizeof(public_key)); | 159 | randombytes(public_key, sizeof(public_key)); |
@@ -196,7 +196,7 @@ void test_addto_lists_possible_bad(DHT *dht, | |||
196 | { | 196 | { |
197 | // check "possibly bad" clients replacement | 197 | // check "possibly bad" clients replacement |
198 | int used, test1, test2, test3; | 198 | int used, test1, test2, test3; |
199 | uint8_t public_key[CLIENT_ID_SIZE], test_id1[CLIENT_ID_SIZE], test_id2[CLIENT_ID_SIZE], test_id3[CLIENT_ID_SIZE]; | 199 | uint8_t public_key[crypto_box_PUBLICKEYBYTES], test_id1[crypto_box_PUBLICKEYBYTES], test_id2[crypto_box_PUBLICKEYBYTES], test_id3[crypto_box_PUBLICKEYBYTES]; |
200 | uint8_t ipv6 = ip_port->ip.family == AF_INET6 ? 1 : 0; | 200 | uint8_t ipv6 = ip_port->ip.family == AF_INET6 ? 1 : 0; |
201 | 201 | ||
202 | randombytes(public_key, sizeof(public_key)); | 202 | randombytes(public_key, sizeof(public_key)); |
@@ -258,7 +258,7 @@ void test_addto_lists_good(DHT *dht, | |||
258 | IP_Port *ip_port, | 258 | IP_Port *ip_port, |
259 | const uint8_t *comp_client_id) | 259 | const uint8_t *comp_client_id) |
260 | { | 260 | { |
261 | uint8_t public_key[CLIENT_ID_SIZE]; | 261 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; |
262 | uint8_t ipv6 = ip_port->ip.family == AF_INET6 ? 1 : 0; | 262 | uint8_t ipv6 = ip_port->ip.family == AF_INET6 ? 1 : 0; |
263 | 263 | ||
264 | mark_all_good(list, length, ipv6); | 264 | mark_all_good(list, length, ipv6); |
@@ -291,7 +291,7 @@ void test_addto_lists(IP ip) | |||
291 | ck_assert_msg(dht != 0, "Failed to create DHT"); | 291 | ck_assert_msg(dht != 0, "Failed to create DHT"); |
292 | 292 | ||
293 | IP_Port ip_port = { .ip = ip, .port = TOX_PORT_DEFAULT }; | 293 | IP_Port ip_port = { .ip = ip, .port = TOX_PORT_DEFAULT }; |
294 | uint8_t public_key[CLIENT_ID_SIZE]; | 294 | uint8_t public_key[crypto_box_PUBLICKEYBYTES]; |
295 | int i, used; | 295 | int i, used; |
296 | 296 | ||
297 | // check lists filling | 297 | // check lists filling |