/*
This file is part of GNUnet.
- (C) 2009-2011 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009-2011 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
* @file fs/fs_tree.c
/**
* Function to call once we're done with processing.
*/
- GNUNET_SCHEDULER_Task cont;
+ GNUNET_SCHEDULER_TaskCallback cont;
/**
* Set to an error message (if we had an error).
GNUNET_FS_DataReader reader,
GNUNET_FS_TreeBlockProcessor proc,
GNUNET_FS_TreeProgressCallback progress,
- GNUNET_SCHEDULER_Task cont)
+ GNUNET_SCHEDULER_TaskCallback cont)
{
struct GNUNET_FS_TreeEncoder *te;
- te = GNUNET_malloc (sizeof (struct GNUNET_FS_TreeEncoder));
+ te = GNUNET_new (struct GNUNET_FS_TreeEncoder);
te->h = h;
te->size = size;
te->cls = cls;
uint16_t pt_size;
char iob[DBLOCK_SIZE];
char enc[DBLOCK_SIZE];
- struct GNUNET_CRYPTO_AesSessionKey sk;
- struct GNUNET_CRYPTO_AesInitializationVector iv;
+ struct GNUNET_CRYPTO_SymmetricSessionKey sk;
+ struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
unsigned int off;
GNUNET_assert (GNUNET_NO == te->in_next);
off = CHK_PER_INODE * (te->chk_tree_depth - 1);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TE done, reading CHK `%s' from %u\n",
GNUNET_h2s (&te->chk_tree[off].query), off);
- te->uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
+ te->uri = GNUNET_new (struct GNUNET_FS_Uri);
te->uri->type = GNUNET_FS_URI_CHK;
te->uri->data.chk.chk = te->chk_tree[off];
te->uri->data.chk.file_length = GNUNET_htonll (te->size);
te->in_next = GNUNET_NO;
- te->cont (te->cls, NULL);
+ te->cont (te->cls);
return;
}
if (0 == te->current_depth)
te->reader (te->cls, te->publish_offset, pt_size, iob, &te->emsg))
{
te->in_next = GNUNET_NO;
- te->cont (te->cls, NULL);
+ te->cont (te->cls);
return;
}
pt_block = iob;
mychk = &te->chk_tree[te->current_depth * CHK_PER_INODE + off];
GNUNET_CRYPTO_hash (pt_block, pt_size, &mychk->key);
GNUNET_CRYPTO_hash_to_aes_key (&mychk->key, &sk, &iv);
- GNUNET_CRYPTO_aes_encrypt (pt_block, pt_size, &sk, &iv, enc);
+ GNUNET_CRYPTO_symmetric_encrypt (pt_block, pt_size, &sk, &iv, enc);
GNUNET_CRYPTO_hash (enc, pt_size, &mychk->query);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"TE calculates query to be `%s', stored at %u\n",