-removed obsolete functions
[oweals/gnunet.git] / src / fs / gnunet-service-fs_indexing.c
index 06c7eaf13ea1ab830e3a2b765a3b5692ede66769..0200cb9d41354a02da7f1c8a3492489d1f867d61 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009, 2010 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009, 2010 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      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.
 */
 
 /**
@@ -231,11 +231,12 @@ signal_index_ok (struct IndexInfo *ii)
   {
     ir = GNUNET_CONTAINER_multihashmap_get (ifm,
                                            &ii->file_id);
+    GNUNET_assert (NULL != ir);
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 _
                 ("Index request received for file `%s' is already indexed as `%s'.  Permitting anyway.\n"),
                 ii->filename,
-               ir->filename);           
+               ir->filename);
     GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0,
                                                 GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK);
     GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES);
@@ -467,7 +468,7 @@ GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client,
  * @param msg error message
  */
 static void
-remove_cont (void *cls, int success, 
+remove_cont (void *cls, int success,
             struct GNUNET_TIME_Absolute min_expiration,
             const char *msg)
 {
@@ -507,8 +508,8 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
 {
   const struct OnDemandBlock *odb;
   struct GNUNET_HashCode nkey;
-  struct GNUNET_CRYPTO_AesSessionKey skey;
-  struct GNUNET_CRYPTO_AesInitializationVector iv;
+  struct GNUNET_CRYPTO_SymmetricSessionKey skey;
+  struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
   struct GNUNET_HashCode query;
   ssize_t nsize;
   char ndata[DBLOCK_SIZE];
@@ -528,6 +529,11 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
   odb = (const struct OnDemandBlock *) data;
   off = GNUNET_ntohll (odb->offset);
   ii = GNUNET_CONTAINER_multihashmap_get (ifm, &odb->file_id);
+  if (NULL == ii)
+  {
+    GNUNET_break (0);
+    return GNUNET_SYSERR;
+  }
   fn = ii->filename;
   if ((NULL == fn) || (0 != ACCESS (fn, R_OK)))
   {
@@ -560,7 +566,7 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
   GNUNET_DISK_file_close (fh);
   GNUNET_CRYPTO_hash (ndata, nsize, &nkey);
   GNUNET_CRYPTO_hash_to_aes_key (&nkey, &skey, &iv);
-  GNUNET_CRYPTO_aes_encrypt (ndata, nsize, &skey, &iv, edata);
+  GNUNET_CRYPTO_symmetric_encrypt (ndata, nsize, &skey, &iv, edata);
   GNUNET_CRYPTO_hash (edata, nsize, &query);
   if (0 != memcmp (&query, key, sizeof (struct GNUNET_HashCode)))
   {