gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r20543 - gnunet-gtk/src/gns


From: gnunet
Subject: [GNUnet-SVN] r20543 - gnunet-gtk/src/gns
Date: Thu, 15 Mar 2012 18:10:19 +0100

Author: wachs
Date: 2012-03-15 18:10:19 +0100 (Thu, 15 Mar 2012)
New Revision: 20543

Modified:
   gnunet-gtk/src/gns/gnunet-gns-gtk.c
   gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c
Log:
- moving crypto key to ctx


Modified: gnunet-gtk/src/gns/gnunet-gns-gtk.c
===================================================================
--- gnunet-gtk/src/gns/gnunet-gns-gtk.c 2012-03-15 16:51:59 UTC (rev 20542)
+++ gnunet-gtk/src/gns/gnunet-gns-gtk.c 2012-03-15 17:10:19 UTC (rev 20543)
@@ -36,10 +36,6 @@
  */
 static int tray_only;
 
-/**
- * Hash of the public key of our zone.
- */
-static GNUNET_HashCode zone;
 
 /**
  * Private key for the our zone.
@@ -69,7 +65,13 @@
 
   GtkBuilder *builder;
 
+  struct GNUNET_CRYPTO_RsaPrivateKey *pkey;
+  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey;
 
+  GNUNET_HashCode zone;
+
+
+
 };
 
 
@@ -336,12 +338,12 @@
 static void
 run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub;
   struct GNUNET_GNS_Context *gns = GNUNET_malloc (sizeof (struct 
GNUNET_GNS_Context));
   char *keyfile;
   char *label;
 
   ml = cls;
+  /*
   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (get_configuration 
(),
                                                             "gns",
                                                             
"ZONEKEY_DIRECTORY",
@@ -351,7 +353,7 @@
                 _("Option `%s' missing in section `%s'\n"),
                 "ZONEKEY_DIRECTORY", "namestore");
     return;
-  }
+  }*/
 
   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (get_configuration 
(),
                                                            "gns",
@@ -363,18 +365,19 @@
                "ZONEKEY", "gns");
     return;
   }
-  zone_pkey = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile);
+  gns->pkey = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile);
   GNUNET_free (keyfile);
   keyfile = NULL;
-  if (NULL == zone_pkey)
+  if (NULL == gns->pkey)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                _("Failed to read or create private zone key\n"));
     return;
   }
-  GNUNET_CRYPTO_rsa_key_get_public (zone_pkey, &pub);
-  GNUNET_CRYPTO_hash (&pub, sizeof (pub), &zone);
+  GNUNET_CRYPTO_rsa_key_get_public (gns->pkey, &gns->pubkey);
+  GNUNET_CRYPTO_hash (&gns->pubkey, sizeof (struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &gns->zone);
 
+
   gns->ns = GNUNET_NAMESTORE_connect (get_configuration ());
   if (NULL == gns->ns)
   {
@@ -392,7 +395,7 @@
   }
   gns->builder = GNUNET_GTK_main_loop_get_builder(ml);
 
-  zone_as_string = GNUNET_strdup (GNUNET_h2s_full (&zone));
+  zone_as_string = GNUNET_strdup (GNUNET_h2s_full (&gns->zone));
   label = g_markup_printf_escaped (_("<b>Editing zone %s</b>"),
                                   zone_as_string);
   gtk_label_set_markup (GTK_LABEL (get_object ("GNUNET_GNS_GTK_zone_label")),
@@ -408,16 +411,6 @@
                                "gnunet-gtk" /* FIXME: different icon? */ ,
                                "gnunet-gns-gtk");
 
-  /*
-  struct ZoneIteration_Context * zc_ctx = GNUNET_malloc (sizeof (struct 
ZoneIteration_Context));
-  zc_ctx->zone = zone;
-  GNUNET_NAMESTORE_zone_iteration_start(gns->ns, &zone,
-      GNUNET_NAMESTORE_RF_NONE,
-      GNUNET_NAMESTORE_RF_NONE,
-      &zone_iteration_proc,
-      zc_ctx);
-   */
-
   /* make GUI visible */
   if (!tray_only)
   {

Modified: gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c
===================================================================
--- gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c    2012-03-15 16:51:59 UTC (rev 
20542)
+++ gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c    2012-03-15 17:10:19 UTC (rev 
20543)
@@ -165,6 +165,17 @@
   /* Append a top level row and leave it empty */
   gtk_tree_store_append(ts, &toplevel, NULL);
 
+  /*
+  struct ZoneIteration_Context * zc_ctx = GNUNET_malloc (sizeof (struct 
ZoneIteration_Context));
+  zc_ctx->zone = zone;
+  GNUNET_NAMESTORE_zone_iteration_start(gns->ns, &zone,
+      GNUNET_NAMESTORE_RF_NONE,
+      GNUNET_NAMESTORE_RF_NONE,
+      &zone_iteration_proc,
+      zc_ctx);
+   */
+
+
   GNUNET_break (0);
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]