summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-09-11 16:08:17 +0000
committerChristian Grothoff <christian@grothoff.org>2016-09-11 16:08:17 +0000
commita74100a08e81f964453aafe41fc544895e3630f9 (patch)
treeeeb90b52b36bfe73fb8f27681c4a76715bdd4df2
parent6d0a1557ed3568b15af784f952cdc95c5fffa852 (diff)
fix and report version check
-rw-r--r--src/conversation/plugin_gnsrecord_conversation.c13
-rw-r--r--src/namestore/gnunet-namestore.c16
2 files changed, 20 insertions, 9 deletions
diff --git a/src/conversation/plugin_gnsrecord_conversation.c b/src/conversation/plugin_gnsrecord_conversation.c
index ecdcb2057..e2bcf7ec9 100644
--- a/src/conversation/plugin_gnsrecord_conversation.c
+++ b/src/conversation/plugin_gnsrecord_conversation.c
@@ -60,10 +60,18 @@ conversation_value_to_string (void *cls,
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 @@ conversation_string_to_value (void *cls,
size_t *data_size)
{
if (NULL == s)
+ {
+ GNUNET_break (0);
return GNUNET_SYSERR;
+ }
switch (type)
{
case GNUNET_GNSRECORD_TYPE_PHONE:
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 9e654cc34..8f0c14fa0 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -165,7 +165,7 @@ static uint32_t type;
static void *data;
/**
- * Number of bytes in 'data'.
+ * Number of bytes in #data.
*/
static size_t data_size;
@@ -933,8 +933,8 @@ testservice_task (void *cls,
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 @@ testservice_task (void *cls,
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)
{