aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_search.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-03-25 13:11:50 +0000
committerChristian Grothoff <christian@grothoff.org>2010-03-25 13:11:50 +0000
commit18e04ae8f2e007445734bd68f47cc1dfe5a12134 (patch)
treeb5ee94654c5798c68682197ea25b3376fe700a40 /src/fs/fs_search.c
parentcafc404dcbb2c6aad2945e08e7d917a06f0e89c8 (diff)
downloadgnunet-18e04ae8f2e007445734bd68f47cc1dfe5a12134.tar.gz
gnunet-18e04ae8f2e007445734bd68f47cc1dfe5a12134.zip
only for ksk
Diffstat (limited to 'src/fs/fs_search.c')
-rw-r--r--src/fs/fs_search.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 8d9050051..a03e9becb 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -783,26 +783,28 @@ search_start (struct GNUNET_FS_Handle *h,
783 sc->parent = parent; 783 sc->parent = parent;
784 sc->master_result_map = GNUNET_CONTAINER_multihashmap_create (16); 784 sc->master_result_map = GNUNET_CONTAINER_multihashmap_create (16);
785 sc->client_info = cctx; 785 sc->client_info = cctx;
786 786 if (GNUNET_FS_uri_test_ksk (uri))
787 sc->requests = GNUNET_malloc (sizeof (struct SearchRequestEntry) *
788 sc->uri->data.ksk.keywordCount);
789 for (i=0;i<sc->uri->data.ksk.keywordCount;i++)
790 { 787 {
791 keyword = &sc->uri->data.ksk.keywords[i][1]; 788 sc->requests = GNUNET_malloc (sizeof (struct SearchRequestEntry) *
792 GNUNET_CRYPTO_hash (keyword, strlen (keyword), &hc); 789 sc->uri->data.ksk.keywordCount);
793 pk = GNUNET_CRYPTO_rsa_key_create_from_hash (&hc); 790 for (i=0;i<sc->uri->data.ksk.keywordCount;i++)
794 GNUNET_CRYPTO_rsa_key_get_public (pk, &pub); 791 {
795 GNUNET_CRYPTO_rsa_key_free (pk); 792 keyword = &sc->uri->data.ksk.keywords[i][1];
796 GNUNET_CRYPTO_hash (&pub, 793 GNUNET_CRYPTO_hash (keyword, strlen (keyword), &hc);
797 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), 794 pk = GNUNET_CRYPTO_rsa_key_create_from_hash (&hc);
798 &sc->requests[i].query); 795 GNUNET_CRYPTO_rsa_key_get_public (pk, &pub);
799 sc->requests[i].mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); 796 GNUNET_CRYPTO_rsa_key_free (pk);
800 if (sc->requests[i].mandatory) 797 GNUNET_CRYPTO_hash (&pub,
801 sc->mandatory_count++; 798 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
802 sc->requests[i].results = GNUNET_CONTAINER_multihashmap_create (4); 799 &sc->requests[i].query);
803 GNUNET_CRYPTO_hash (keyword, 800 sc->requests[i].mandatory = (sc->uri->data.ksk.keywords[i][0] == '+');
804 strlen (keyword), 801 if (sc->requests[i].mandatory)
805 &sc->requests[i].key); 802 sc->mandatory_count++;
803 sc->requests[i].results = GNUNET_CONTAINER_multihashmap_create (4);
804 GNUNET_CRYPTO_hash (keyword,
805 strlen (keyword),
806 &sc->requests[i].key);
807 }
806 } 808 }
807 if (NULL != parent) 809 if (NULL != parent)
808 { 810 {