aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fs/fs_publish_ublock.c2
-rw-r--r--src/fs/fs_search.c4
-rw-r--r--src/fs/fs_unindex.c25
3 files changed, 16 insertions, 15 deletions
diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c
index 252268e24..1c46f0d29 100644
--- a/src/fs/fs_publish_ublock.c
+++ b/src/fs/fs_publish_ublock.c
@@ -65,7 +65,7 @@ derive_ublock_encryption_key (struct GNUNET_CRYPTO_AesSessionKey *skey,
65 * Decrypt the given UBlock, storing the result in output. 65 * Decrypt the given UBlock, storing the result in output.
66 * 66 *
67 * @param input input data 67 * @param input input data
68 * @param input_len number of bytes in input 68 * @param input_len number of bytes in @a input
69 * @param ns public key under which the UBlock was stored 69 * @param ns public key under which the UBlock was stored
70 * @param label label under which the UBlock was stored 70 * @param label label under which the UBlock was stored
71 * @param output where to write the result, has input_len bytes 71 * @param output where to write the result, has input_len bytes
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 09c260000..2e09c1e22 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -672,9 +672,9 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc, const char *id_update,
672 * @param sc search context with the keywords 672 * @param sc search context with the keywords
673 * @param dpub derived public key used for the search 673 * @param dpub derived public key used for the search
674 * @param edata encrypted data 674 * @param edata encrypted data
675 * @param edata_size number of bytes in 'edata' (and 'data') 675 * @param edata_size number of bytes in @a edata (and @a data)
676 * @param data where to store the plaintext 676 * @param data where to store the plaintext
677 * @return keyword index on success, GNUNET_SYSERR on error (no such 677 * @return keyword index on success, #GNUNET_SYSERR on error (no such
678 * keyword, internal error) 678 * keyword, internal error)
679 */ 679 */
680static int 680static int
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index 6c4ee6696..bb3accb82 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -31,6 +31,7 @@
31#include "fs_api.h" 31#include "fs_api.h"
32#include "fs_tree.h" 32#include "fs_tree.h"
33#include "block_fs.h" 33#include "block_fs.h"
34#include "fs_publish_ublock.h"
34 35
35 36
36/** 37/**
@@ -492,17 +493,16 @@ process_kblock_for_unindex (void *cls,
492 } 493 }
493 { 494 {
494 char pt[size - sizeof (struct UBlock)]; 495 char pt[size - sizeof (struct UBlock)];
495 struct GNUNET_CRYPTO_AesSessionKey skey; 496 struct GNUNET_CRYPTO_EccPublicSignKey anon_pub;
496 struct GNUNET_CRYPTO_AesInitializationVector iv; 497 const char *keyword;
497 498
498 GNUNET_CRYPTO_hash_to_aes_key (&uc->ukey, &skey, &iv); 499 GNUNET_CRYPTO_ecc_key_get_public_for_signature (GNUNET_CRYPTO_ecc_key_get_anonymous (),
499 if (-1 == 500 &anon_pub);
500 GNUNET_CRYPTO_aes_decrypt (&ub[1], size - sizeof (struct UBlock), &skey, 501 keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1];
501 &iv, pt)) 502 GNUNET_FS_ublock_decrypt_ (&ub[1], size - sizeof (struct UBlock),
502 { 503 &anon_pub,
503 GNUNET_break (0); 504 keyword,
504 goto get_next; 505 pt);
505 }
506 if (NULL == memchr (&pt[1], 0, sizeof (pt) - 1)) 506 if (NULL == memchr (&pt[1], 0, sizeof (pt) - 1))
507 { 507 {
508 GNUNET_break_op (0); /* malformed UBlock */ 508 GNUNET_break_op (0); /* malformed UBlock */
@@ -689,7 +689,7 @@ GNUNET_FS_unindex_process_hash_ (void *cls, const struct GNUNET_HashCode * file_
689 * Create SUSPEND event for the given unindex operation 689 * Create SUSPEND event for the given unindex operation
690 * and then clean up our state (without stop signal). 690 * and then clean up our state (without stop signal).
691 * 691 *
692 * @param cls the 'struct GNUNET_FS_UnindexContext' to signal for 692 * @param cls the `struct GNUNET_FS_UnindexContext` to signal for
693 */ 693 */
694void 694void
695GNUNET_FS_unindex_signal_suspend_ (void *cls) 695GNUNET_FS_unindex_signal_suspend_ (void *cls)
@@ -760,7 +760,8 @@ GNUNET_FS_unindex_signal_suspend_ (void *cls)
760 * @return NULL on error, otherwise handle 760 * @return NULL on error, otherwise handle
761 */ 761 */
762struct GNUNET_FS_UnindexContext * 762struct GNUNET_FS_UnindexContext *
763GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, const char *filename, 763GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h,
764 const char *filename,
764 void *cctx) 765 void *cctx)
765{ 766{
766 struct GNUNET_FS_UnindexContext *ret; 767 struct GNUNET_FS_UnindexContext *ret;