diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-13 12:00:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-13 12:00:01 +0000 |
commit | a35c5a11d32bdd0bc24f64de36fbc6b0d0b20aae (patch) | |
tree | b7768c5cb22e8a4f84d51cbd06dc04861fdb8510 /src/fs/fs_search.c | |
parent | 95d42fdcb47eedcf2747614a22dacd676bc7faae (diff) | |
download | gnunet-a35c5a11d32bdd0bc24f64de36fbc6b0d0b20aae.tar.gz gnunet-a35c5a11d32bdd0bc24f64de36fbc6b0d0b20aae.zip |
splitting 'struct GNUNET_CRYPTO_EccPublicKey' into one struct for signing and another for encryption
Diffstat (limited to 'src/fs/fs_search.c')
-rw-r--r-- | src/fs/fs_search.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 38bd55caa..09c260000 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -679,20 +679,20 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc, const char *id_update, | |||
679 | */ | 679 | */ |
680 | static int | 680 | static int |
681 | decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, | 681 | decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, |
682 | const struct GNUNET_CRYPTO_EccPublicKey *dpub, | 682 | const struct GNUNET_CRYPTO_EccPublicSignKey *dpub, |
683 | const void *edata, | 683 | const void *edata, |
684 | size_t edata_size, | 684 | size_t edata_size, |
685 | char *data) | 685 | char *data) |
686 | { | 686 | { |
687 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; | 687 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; |
688 | struct GNUNET_CRYPTO_EccPublicKey anon_pub; | 688 | struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; |
689 | unsigned int i; | 689 | unsigned int i; |
690 | 690 | ||
691 | /* find key */ | 691 | /* find key */ |
692 | for (i = 0; i < sc->uri->data.ksk.keywordCount; i++) | 692 | for (i = 0; i < sc->uri->data.ksk.keywordCount; i++) |
693 | if (0 == memcmp (dpub, | 693 | if (0 == memcmp (dpub, |
694 | &sc->requests[i].dpub, | 694 | &sc->requests[i].dpub, |
695 | sizeof (struct GNUNET_CRYPTO_EccPublicKey))) | 695 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) |
696 | break; | 696 | break; |
697 | if (i == sc->uri->data.ksk.keywordCount) | 697 | if (i == sc->uri->data.ksk.keywordCount) |
698 | { | 698 | { |
@@ -702,7 +702,7 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, | |||
702 | } | 702 | } |
703 | /* decrypt */ | 703 | /* decrypt */ |
704 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); | 704 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); |
705 | GNUNET_CRYPTO_ecc_key_get_public (anon, &anon_pub); | 705 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub); |
706 | GNUNET_FS_ublock_decrypt_ (edata, edata_size, | 706 | GNUNET_FS_ublock_decrypt_ (edata, edata_size, |
707 | &anon_pub, | 707 | &anon_pub, |
708 | sc->requests[i].keyword, | 708 | sc->requests[i].keyword, |
@@ -1035,7 +1035,7 @@ transmit_search_request (void *cls, size_t size, void *buf) | |||
1035 | struct MessageBuilderContext mbc; | 1035 | struct MessageBuilderContext mbc; |
1036 | size_t msize; | 1036 | size_t msize; |
1037 | struct SearchMessage *sm; | 1037 | struct SearchMessage *sm; |
1038 | struct GNUNET_CRYPTO_EccPublicKey dpub; | 1038 | struct GNUNET_CRYPTO_EccPublicSignKey dpub; |
1039 | unsigned int sqms; | 1039 | unsigned int sqms; |
1040 | uint32_t options; | 1040 | uint32_t options; |
1041 | 1041 | ||
@@ -1272,7 +1272,7 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1272 | unsigned int i; | 1272 | unsigned int i; |
1273 | const char *keyword; | 1273 | const char *keyword; |
1274 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; | 1274 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; |
1275 | struct GNUNET_CRYPTO_EccPublicKey anon_pub; | 1275 | struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; |
1276 | struct SearchRequestEntry *sre; | 1276 | struct SearchRequestEntry *sre; |
1277 | 1277 | ||
1278 | GNUNET_assert (NULL == sc->client); | 1278 | GNUNET_assert (NULL == sc->client); |
@@ -1280,7 +1280,7 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1280 | { | 1280 | { |
1281 | GNUNET_assert (0 != sc->uri->data.ksk.keywordCount); | 1281 | GNUNET_assert (0 != sc->uri->data.ksk.keywordCount); |
1282 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); | 1282 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); |
1283 | GNUNET_CRYPTO_ecc_key_get_public (anon, &anon_pub); | 1283 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub); |
1284 | sc->requests = | 1284 | sc->requests = |
1285 | GNUNET_malloc (sizeof (struct SearchRequestEntry) * | 1285 | GNUNET_malloc (sizeof (struct SearchRequestEntry) * |
1286 | sc->uri->data.ksk.keywordCount); | 1286 | sc->uri->data.ksk.keywordCount); |
@@ -1294,7 +1294,7 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1294 | "fs-ublock", | 1294 | "fs-ublock", |
1295 | &sre->dpub); | 1295 | &sre->dpub); |
1296 | GNUNET_CRYPTO_hash (&sre->dpub, | 1296 | GNUNET_CRYPTO_hash (&sre->dpub, |
1297 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 1297 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
1298 | &sre->uquery); | 1298 | &sre->uquery); |
1299 | sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); | 1299 | sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); |
1300 | if (sre->mandatory) | 1300 | if (sre->mandatory) |