-round expiration times to full seconds
[oweals/gnunet.git] / src / fs / fs_unindex.c
index 17c3731fead1abd55b3c4a700df191f44bc7fd1e..5a956b0b5f3ff772932805b2dc4d8d9cedd64dd5 100644 (file)
@@ -89,8 +89,8 @@ GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
   pi->value.unindex.duration =
       GNUNET_TIME_absolute_get_duration (uc->start_time);
   pi->value.unindex.completed = offset;
+  pi->fsh = uc->h;
   uc->client_info = uc->h->upcb (uc->h->upcb_cls, pi);
-
 }
 
 
@@ -553,10 +553,9 @@ void
 GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc)
 {
   const char *keyword;
-  struct GNUNET_PseudonymHandle *ph;
-  struct GNUNET_PseudonymIdentifier anon;
-  struct GNUNET_PseudonymIdentifier verification_key;
-  struct GNUNET_HashCode signing_key;
+  const struct GNUNET_CRYPTO_EccPrivateKey *anon;
+  struct GNUNET_CRYPTO_EccPublicKey anon_pub;
+  struct GNUNET_CRYPTO_EccPublicKey dpub;
 
   if (NULL == uc->dsh)
     uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg);
@@ -574,18 +573,15 @@ GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc)
     unindex_finish (uc);
     return;
   }
-  /* FIXME: code duplication with fs_search.c here... */
-  ph = GNUNET_PSEUDONYM_get_anonymous_pseudonym_handle ();
-  GNUNET_PSEUDONYM_get_identifier (ph, &anon);
-  GNUNET_PSEUDONYM_destroy (ph);
+  anon = GNUNET_CRYPTO_ecc_key_get_anonymous ();
+  GNUNET_CRYPTO_ecc_key_get_public (anon, &anon_pub);
   keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1];
-  GNUNET_CRYPTO_hash (keyword, strlen (keyword), &uc->ukey);
-  GNUNET_CRYPTO_hash (&uc->ukey, sizeof (struct GNUNET_HashCode), &signing_key);
-  GNUNET_PSEUDONYM_derive_verification_key (&anon, 
-                                           &signing_key,
-                                           &verification_key);
-  GNUNET_CRYPTO_hash (&verification_key,
-                     sizeof (struct GNUNET_PseudonymIdentifier),
+  GNUNET_CRYPTO_ecc_public_key_derive (&anon_pub,
+                                      keyword,
+                                      "fs-ublock",
+                                      &dpub);
+  GNUNET_CRYPTO_hash (&dpub,
+                     sizeof (dpub),
                      &uc->uquery);
   uc->first_uid = 0;
   uc->dqe = GNUNET_DATASTORE_get_key (uc->dsh,