gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r37909 - in gnunet/src: conversation namestore


From: gnunet
Subject: [GNUnet-SVN] r37909 - in gnunet/src: conversation namestore
Date: Sun, 11 Sep 2016 18:08:17 +0200

Author: grothoff
Date: 2016-09-11 18:08:17 +0200 (Sun, 11 Sep 2016)
New Revision: 37909

Modified:
   gnunet/src/conversation/plugin_gnsrecord_conversation.c
   gnunet/src/namestore/gnunet-namestore.c
Log:
fix and report version check


Modified: gnunet/src/conversation/plugin_gnsrecord_conversation.c
===================================================================
--- gnunet/src/conversation/plugin_gnsrecord_conversation.c     2016-09-11 
15:46:08 UTC (rev 37908)
+++ gnunet/src/conversation/plugin_gnsrecord_conversation.c     2016-09-11 
16:08:17 UTC (rev 37909)
@@ -60,10 +60,18 @@
       char *pkey;
 
       if (data_size != sizeof (struct GNUNET_CONVERSATION_PhoneRecord))
+      {
+       GNUNET_break_op (0);
        return NULL;
+      }
       pr = data;
-      if (0 != ntohl (pr->version))
+      if (1 != ntohl (pr->version))
+      {
+       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                   _("PHONE version %u not supported\n"),
+                   ntohl (pr->version));
        return NULL;
+      }
       pkey = GNUNET_CRYPTO_eddsa_public_key_to_string (&pr->peer.public_key);
       s = GNUNET_STRINGS_data_to_string_alloc (&pr->line_port,
                                                sizeof (struct 
GNUNET_HashCode));
@@ -101,7 +109,10 @@
                               size_t *data_size)
 {
   if (NULL == s)
+  {
+    GNUNET_break (0);
     return GNUNET_SYSERR;
+  }
   switch (type)
   {
   case GNUNET_GNSRECORD_TYPE_PHONE:

Modified: gnunet/src/namestore/gnunet-namestore.c
===================================================================
--- gnunet/src/namestore/gnunet-namestore.c     2016-09-11 15:46:08 UTC (rev 
37908)
+++ gnunet/src/namestore/gnunet-namestore.c     2016-09-11 16:08:17 UTC (rev 
37909)
@@ -165,7 +165,7 @@
 static void *data;
 
 /**
- * Number of bytes in 'data'.
+ * Number of bytes in #data.
  */
 static size_t data_size;
 
@@ -933,8 +933,8 @@
 
     if (GNUNET_OK !=
         GNUNET_CRYPTO_ecdsa_public_key_from_string (reverse_pkey,
-                                                       strlen (reverse_pkey),
-                                                       &pubkey))
+                                                   strlen (reverse_pkey),
+                                                   &pubkey))
     {
       fprintf (stderr,
                _("Invalid public key for reverse lookup `%s'\n"),
@@ -1007,11 +1007,11 @@
       ret = 1;
       return;
     }
-    add_qe_uri = GNUNET_NAMESTORE_set_nick(ns,
-                                           &zone_pkey,
-                                           nickstring,
-                                           &add_continuation,
-                                           &add_qe_uri);
+    add_qe_uri = GNUNET_NAMESTORE_set_nick (ns,
+                                           &zone_pkey,
+                                           nickstring,
+                                           &add_continuation,
+                                           &add_qe_uri);
   }
   if (monitor)
   {




reply via email to

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