diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-09-05 07:46:51 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-09-05 07:46:51 +0000 |
commit | 97b853d32b84fe5c26081c54cdc35631d3f55d00 (patch) | |
tree | b24302a3a8ce1ffbe30c650d724ba6316d8a70e7 /src | |
parent | 1a65488bb711161699075be1a3b4aa05eeffb522 (diff) | |
download | gnunet-97b853d32b84fe5c26081c54cdc35631d3f55d00.tar.gz gnunet-97b853d32b84fe5c26081c54cdc35631d3f55d00.zip |
use precomputed zonekeys
Diffstat (limited to 'src')
-rw-r--r-- | src/gns/Makefile.am | 10 | ||||
-rw-r--r-- | src/gns/test_gns_dht_three_peers.c | 19 |
2 files changed, 22 insertions, 7 deletions
diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am index 886859aac..6ca3dc644 100644 --- a/src/gns/Makefile.am +++ b/src/gns/Makefile.am | |||
@@ -54,16 +54,16 @@ check_PROGRAMS = \ | |||
54 | test_gns_simple_lookup \ | 54 | test_gns_simple_lookup \ |
55 | test_gns_simple_delegated_lookup \ | 55 | test_gns_simple_delegated_lookup \ |
56 | test_gns_simple_mx_lookup \ | 56 | test_gns_simple_mx_lookup \ |
57 | test_gns_simple_srv_lookup \ | 57 | test_gns_simple_srv_lookup \ |
58 | test_gns_simple_zkey_lookup \ | 58 | test_gns_simple_zkey_lookup \ |
59 | test_gns_dht_delegated_lookup \ | 59 | test_gns_dht_delegated_lookup \ |
60 | test_gns_pseu_shorten \ | 60 | test_gns_pseu_shorten \ |
61 | test_gns_max_queries \ | 61 | test_gns_max_queries \ |
62 | test_gns_cname_lookup \ | ||
63 | test_gns_ns_lookup \ | ||
64 | test_gns_revocation \ | ||
62 | test_gns_dht_three_peers \ | 65 | test_gns_dht_three_peers \ |
63 | test_gns_cname_lookup \ | 66 | test_gns_proxy |
64 | test_gns_ns_lookup \ | ||
65 | test_gns_revocation \ | ||
66 | test_gns_proxy | ||
67 | 67 | ||
68 | 68 | ||
69 | # test_gns_simple_lookup | 69 | # test_gns_simple_lookup |
diff --git a/src/gns/test_gns_dht_three_peers.c b/src/gns/test_gns_dht_three_peers.c index abadc73b4..7dff904dc 100644 --- a/src/gns/test_gns_dht_three_peers.c +++ b/src/gns/test_gns_dht_three_peers.c | |||
@@ -250,6 +250,7 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
250 | { | 250 | { |
251 | struct GNUNET_NAMESTORE_Handle *ns; | 251 | struct GNUNET_NAMESTORE_Handle *ns; |
252 | char* keyfile; | 252 | char* keyfile; |
253 | char* source; | ||
253 | struct GNUNET_CRYPTO_RsaPrivateKey *key; | 254 | struct GNUNET_CRYPTO_RsaPrivateKey *key; |
254 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; | 255 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; |
255 | struct in_addr *web; | 256 | struct in_addr *web; |
@@ -265,6 +266,10 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
265 | return GNUNET_SYSERR; | 266 | return GNUNET_SYSERR; |
266 | } | 267 | } |
267 | 268 | ||
269 | GNUNET_asprintf (&source, "zonefiles%s%s", DIR_SEPARATOR_STR, "test_zonekey"); | ||
270 | GNUNET_break (GNUNET_OK == GNUNET_DISK_file_copy (source, keyfile)); | ||
271 | GNUNET_free (source); | ||
272 | |||
268 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 273 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); |
269 | if (NULL == key) | 274 | if (NULL == key) |
270 | { | 275 | { |
@@ -313,6 +318,7 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
313 | { | 318 | { |
314 | struct GNUNET_NAMESTORE_Handle *ns; | 319 | struct GNUNET_NAMESTORE_Handle *ns; |
315 | char* keyfile; | 320 | char* keyfile; |
321 | char* source; | ||
316 | struct GNUNET_CRYPTO_RsaPrivateKey *key; | 322 | struct GNUNET_CRYPTO_RsaPrivateKey *key; |
317 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; | 323 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; |
318 | struct GNUNET_NAMESTORE_RecordData rd; | 324 | struct GNUNET_NAMESTORE_RecordData rd; |
@@ -327,6 +333,10 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
327 | return GNUNET_SYSERR; | 333 | return GNUNET_SYSERR; |
328 | } | 334 | } |
329 | 335 | ||
336 | GNUNET_asprintf (&source, "zonefiles%s%s", DIR_SEPARATOR_STR, "OEFL7A4VEF1B40QLEMTG5D8G1CN6EN16QUSG5R2DT71GRJN34LSG.zkey"); | ||
337 | GNUNET_break (GNUNET_OK == GNUNET_DISK_file_copy (source, keyfile)); | ||
338 | GNUNET_free (source); | ||
339 | |||
330 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 340 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); |
331 | if (NULL == key) | 341 | if (NULL == key) |
332 | { | 342 | { |
@@ -366,6 +376,7 @@ setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
366 | { | 376 | { |
367 | struct GNUNET_NAMESTORE_Handle *ns; | 377 | struct GNUNET_NAMESTORE_Handle *ns; |
368 | char* keyfile; | 378 | char* keyfile; |
379 | char* source; | ||
369 | struct GNUNET_CRYPTO_RsaPrivateKey *key; | 380 | struct GNUNET_CRYPTO_RsaPrivateKey *key; |
370 | struct GNUNET_NAMESTORE_RecordData rd; | 381 | struct GNUNET_NAMESTORE_RecordData rd; |
371 | 382 | ||
@@ -380,6 +391,10 @@ setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
380 | return GNUNET_SYSERR; | 391 | return GNUNET_SYSERR; |
381 | } | 392 | } |
382 | 393 | ||
394 | GNUNET_asprintf (&source, "zonefiles%s%s", DIR_SEPARATOR_STR, "188JSUMKEF25GVU8TTV0PBNNN8JVCPUEDFV1UHJJU884JD25V0T0.zkey"); | ||
395 | GNUNET_break (GNUNET_OK == GNUNET_DISK_file_copy (source, keyfile)); | ||
396 | GNUNET_free (source); | ||
397 | |||
383 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 398 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); |
384 | if (NULL == key) | 399 | if (NULL == key) |
385 | { | 400 | { |
@@ -405,8 +420,8 @@ setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
405 | 420 | ||
406 | GNUNET_NAMESTORE_record_create (ns, key, "bob", &rd, &cont_ns, ns); | 421 | GNUNET_NAMESTORE_record_create (ns, key, "bob", &rd, &cont_ns, ns); |
407 | 422 | ||
408 | GNUNET_CRYPTO_rsa_key_free(key); | 423 | GNUNET_CRYPTO_rsa_key_free (key); |
409 | GNUNET_free(keyfile); | 424 | GNUNET_free (keyfile); |
410 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up alice done\n"); | 425 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up alice done\n"); |
411 | return GNUNET_OK; | 426 | return GNUNET_OK; |
412 | } | 427 | } |