diff options
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.c')
-rw-r--r-- | src/gns/gnunet-service-gns_resolver.c | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 8aa9e8188..de9e7e014 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c | |||
@@ -491,6 +491,7 @@ process_pseu_lookup_ns (void *cls, | |||
491 | { | 491 | { |
492 | struct GetPseuAuthorityHandle *gph = cls; | 492 | struct GetPseuAuthorityHandle *gph = cls; |
493 | struct GNUNET_NAMESTORE_RecordData new_pkey; | 493 | struct GNUNET_NAMESTORE_RecordData new_pkey; |
494 | struct GNUNET_CRYPTO_EccPublicKey pub; | ||
494 | 495 | ||
495 | gph->namestore_task = NULL; | 496 | gph->namestore_task = NULL; |
496 | if (rd_count > 0) | 497 | if (rd_count > 0) |
@@ -502,14 +503,19 @@ process_pseu_lookup_ns (void *cls, | |||
502 | time, this time not using PSEU but the original label */ | 503 | time, this time not using PSEU but the original label */ |
503 | if (0 == strcmp (name, | 504 | if (0 == strcmp (name, |
504 | gph->label)) | 505 | gph->label)) |
506 | { | ||
505 | free_get_pseu_authority_handle (gph); | 507 | free_get_pseu_authority_handle (gph); |
508 | } | ||
506 | else | 509 | else |
510 | { | ||
511 | GNUNET_CRYPTO_ecc_key_get_public (&gph->shorten_zone_key, | ||
512 | &pub); | ||
507 | gph->namestore_task = GNUNET_NAMESTORE_lookup (namestore_handle, | 513 | gph->namestore_task = GNUNET_NAMESTORE_lookup (namestore_handle, |
508 | &gph->shorten_zone_key, | 514 | &pub, |
509 | gph->label, | 515 | gph->label, |
510 | GNUNET_NAMESTORE_TYPE_ANY, | ||
511 | &process_pseu_lookup_ns, | 516 | &process_pseu_lookup_ns, |
512 | gph); | 517 | gph); |
518 | } | ||
513 | return; | 519 | return; |
514 | } | 520 | } |
515 | /* name is available */ | 521 | /* name is available */ |
@@ -543,6 +549,10 @@ static void | |||
543 | process_pseu_result (struct GetPseuAuthorityHandle* gph, | 549 | process_pseu_result (struct GetPseuAuthorityHandle* gph, |
544 | const char *pseu) | 550 | const char *pseu) |
545 | { | 551 | { |
552 | struct GNUNET_CRYPTO_EccPublicKey pub; | ||
553 | |||
554 | GNUNET_CRYPTO_ecc_key_get_public (&gph->shorten_zone_key, | ||
555 | &pub); | ||
546 | if (NULL == pseu) | 556 | if (NULL == pseu) |
547 | { | 557 | { |
548 | /* no PSEU found, try original label */ | 558 | /* no PSEU found, try original label */ |
@@ -550,9 +560,8 @@ process_pseu_result (struct GetPseuAuthorityHandle* gph, | |||
550 | "No PSEU found, trying original label `%s' instead.\n", | 560 | "No PSEU found, trying original label `%s' instead.\n", |
551 | gph->label); | 561 | gph->label); |
552 | gph->namestore_task = GNUNET_NAMESTORE_lookup (namestore_handle, | 562 | gph->namestore_task = GNUNET_NAMESTORE_lookup (namestore_handle, |
553 | &gph->shorten_zone_key, | 563 | &pub, |
554 | gph->label, | 564 | gph->label, |
555 | GNUNET_NAMESTORE_TYPE_ANY, | ||
556 | &process_pseu_lookup_ns, | 565 | &process_pseu_lookup_ns, |
557 | gph); | 566 | gph); |
558 | return; | 567 | return; |
@@ -560,9 +569,8 @@ process_pseu_result (struct GetPseuAuthorityHandle* gph, | |||
560 | 569 | ||
561 | /* check if 'pseu' is taken */ | 570 | /* check if 'pseu' is taken */ |
562 | gph->namestore_task = GNUNET_NAMESTORE_lookup (namestore_handle, | 571 | gph->namestore_task = GNUNET_NAMESTORE_lookup (namestore_handle, |
563 | &gph->shorten_zone_key, | 572 | &pub, |
564 | pseu, | 573 | pseu, |
565 | GNUNET_NAMESTORE_TYPE_ANY, | ||
566 | &process_pseu_lookup_ns, | 574 | &process_pseu_lookup_ns, |
567 | gph); | 575 | gph); |
568 | } | 576 | } |
@@ -1927,12 +1935,12 @@ process_delegation_result_dht (void* cls, | |||
1927 | 1935 | ||
1928 | 1936 | ||
1929 | /* Check for key revocation and delegate */ | 1937 | /* Check for key revocation and delegate */ |
1930 | rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, | 1938 | rh->namestore_task = GNUNET_NAMESTORE_lookup (namestore_handle, |
1931 | &rh->authority, | 1939 | &rh->authority, |
1932 | GNUNET_GNS_MASTERZONE_STR, | 1940 | GNUNET_GNS_MASTERZONE_STR, |
1933 | GNUNET_NAMESTORE_TYPE_REV, | 1941 | GNUNET_NAMESTORE_TYPE_REV, |
1934 | &process_pkey_revocation_result_ns, | 1942 | &process_pkey_revocation_result_ns, |
1935 | rh); | 1943 | rh); |
1936 | 1944 | ||
1937 | return; | 1945 | return; |
1938 | } | 1946 | } |
@@ -2801,12 +2809,12 @@ process_delegation_result_ns (void* cls, | |||
2801 | memcpy ((void*)rh->rd.data, rd[i].data, rd[i].data_size); | 2809 | memcpy ((void*)rh->rd.data, rd[i].data, rd[i].data_size); |
2802 | rh->rd_count = 1; | 2810 | rh->rd_count = 1; |
2803 | /* Check for key revocation and delegate */ | 2811 | /* Check for key revocation and delegate */ |
2804 | rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, | 2812 | rh->namestore_task = GNUNET_NAMESTORE_lookup (namestore_handle, |
2805 | &rh->authority, | 2813 | &rh->authority, |
2806 | GNUNET_GNS_MASTERZONE_STR, | 2814 | GNUNET_GNS_MASTERZONE_STR, |
2807 | GNUNET_NAMESTORE_TYPE_REV, | 2815 | GNUNET_NAMESTORE_TYPE_REV, |
2808 | &process_pkey_revocation_result_ns, | 2816 | &process_pkey_revocation_result_ns, |
2809 | rh); | 2817 | rh); |
2810 | return; | 2818 | return; |
2811 | default: | 2819 | default: |
2812 | /* ignore, move to next result */ | 2820 | /* ignore, move to next result */ |
@@ -2867,12 +2875,11 @@ resolve_delegation_ns (struct ResolverHandle *rh) | |||
2867 | rh->name, | 2875 | rh->name, |
2868 | rh->authority_name, | 2876 | rh->authority_name, |
2869 | GNUNET_short_h2s (&rh->authority)); | 2877 | GNUNET_short_h2s (&rh->authority)); |
2870 | rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, | 2878 | rh->namestore_task = GNUNET_NAMESTORE_lookup (namestore_handle, |
2871 | &rh->authority, | 2879 | &rh->authority, |
2872 | rh->authority_name, | 2880 | rh->authority_name, |
2873 | GNUNET_DNSPARSER_TYPE_ANY, | 2881 | &process_delegation_result_ns, |
2874 | &process_delegation_result_ns, | 2882 | rh); |
2875 | rh); | ||
2876 | } | 2883 | } |
2877 | 2884 | ||
2878 | #endif | 2885 | #endif |