-use short hashs in fcfsd
authorChristian Grothoff <christian@grothoff.org>
Mon, 19 Mar 2012 19:22:34 +0000 (19:22 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 19 Mar 2012 19:22:34 +0000 (19:22 +0000)
src/gns/gnunet-gns-fcfsd.c

index 8cc9ba1574cfb1e6c541d1c7650a5dc4bfd8a048..0d400011dbf50cc1754b310320a9768016f2b7b3 100644 (file)
@@ -133,7 +133,7 @@ struct Request
   /**
    * Public key submitted via form.
    */
-  char public_key[1024];
+  char public_key[64];
 
 };
 
@@ -368,12 +368,12 @@ lookup_result_processor (void *cls,
 {
   struct Request *request = cls;
   struct GNUNET_NAMESTORE_RecordData r;
-  GNUNET_HashCode pub;
+  struct GNUNET_CRYPTO_ShortHashCode pub;
   
   GNUNET_assert (GNUNET_OK ==
-                GNUNET_CRYPTO_hash_from_string2 (request->public_key,
-                                                 strlen (request->public_key),
-                                                 &pub));
+                GNUNET_CRYPTO_short_hash_from_string2 (request->public_key,
+                                                       strlen (request->public_key),
+                                                       &pub));
   request->qe = NULL;
   if (0 != rd_count)
   {
@@ -435,7 +435,7 @@ create_response (void *cls,
   struct MHD_Response *response;
   struct Request *request;
   int ret;
-  GNUNET_HashCode pub;
+  struct GNUNET_CRYPTO_ShortHashCode pub;
 
   if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) ||
        (0 == strcmp (method, MHD_HTTP_METHOD_HEAD)) )
@@ -481,9 +481,9 @@ create_response (void *cls,
        request->pp = NULL;
       }
       if (GNUNET_OK !=
-         GNUNET_CRYPTO_hash_from_string2 (request->public_key,
-                                          strlen (request->public_key),
-                                          &pub))
+         GNUNET_CRYPTO_short_hash_from_string2 (request->public_key,
+                                                strlen (request->public_key),
+                                                &pub))
       {
        /* parse error */
        return fill_s_reply ("Failed to parse given public key",