summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2015-06-26 10:07:07 +0000
committerBart Polot <bart@net.in.tum.de>2015-06-26 10:07:07 +0000
commite9a7ca0fc5b07c4f2cd48bf61540aa189b1ee781 (patch)
tree55eaf4312fb46940c63260ab0910a5face3a46c4 /src
parent4c6c3ef78b6e5875b15d9b0258508ca4f0263835 (diff)
- don't log old mesh versions as errors
Diffstat (limited to 'src')
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index 6cda9f7ff..e540a6ce8 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -773,17 +773,35 @@ check_ephemeral (struct CadetTunnel *t,
{
/* Check message size */
if (ntohs (msg->header.size) != sizeof (struct GNUNET_CADET_KX_Ephemeral))
+ {
+ /* This is probably an old "MESH" version. */
+ LOG (GNUNET_ERROR_TYPE_INFO,
+ "Expected ephemeral of size %u, got %u\n",
+ sizeof (struct GNUNET_CADET_KX_Ephemeral),
+ ntohs (msg->header.size));
return GNUNET_SYSERR;
+ }
/* Check signature size */
if (ntohl (msg->purpose.size) != ephemeral_purpose_size ())
+ {
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ "Expected signature purpose of size %u, got %u\n",
+ ephemeral_purpose_size (),
+ ntohs (msg->purpose.size));
return GNUNET_SYSERR;
+ }
/* Check origin */
if (0 != memcmp (&msg->origin_identity,
GCP_get_id (t->peer),
sizeof (struct GNUNET_PeerIdentity)))
+ {
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ "Unexpected origin, got %s\n",
+ GNUNET_i2s (&msg->origin_identity));
return GNUNET_SYSERR;
+ }
/* Check signature */
if (GNUNET_OK !=
@@ -791,7 +809,10 @@ check_ephemeral (struct CadetTunnel *t,
&msg->purpose,
&msg->signature,
&msg->origin_identity.public_key))
+ {
+ LOG (GNUNET_ERROR_TYPE_WARNING, "Signature invalid\n");
return GNUNET_SYSERR;
+ }
return GNUNET_OK;
}
@@ -2711,11 +2732,9 @@ handle_ephemeral (struct CadetTunnel *t,
{
LOG (GNUNET_ERROR_TYPE_INFO, "<=== EPHM for %s\n", GCT_2s (t));
+ /* Some old versions are still around, don't log as error. */
if (GNUNET_OK != check_ephemeral (t, msg))
- {
- GNUNET_break_op (0);
return;
- }
/* If we get a proper OTR-style ephemeral, fallback to old crypto. */
if (NULL != t->ax)