diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-12-15 07:18:16 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-12-15 07:18:16 +0000 |
commit | af860bf5336ea0cef8d4cba55e0e4d5391e9c672 (patch) | |
tree | cd1f2c53d6a829ae3963f992e6690150e42d3ce9 | |
parent | 034a0dbbfc45814cf26f7673015ced477c4a8a6d (diff) | |
download | gnunet-af860bf5336ea0cef8d4cba55e0e4d5391e9c672.tar.gz gnunet-af860bf5336ea0cef8d4cba55e0e4d5391e9c672.zip |
- check KX context at PONG
-rw-r--r-- | src/cadet/gnunet-service-cadet_tunnel.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index d08620500..1912ee9bf 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c | |||
@@ -1921,8 +1921,13 @@ handle_pong (struct CadetTunnel *t, | |||
1921 | GNUNET_STATISTICS_update (stats, "# duplicate PONG messages", 1, GNUNET_NO); | 1921 | GNUNET_STATISTICS_update (stats, "# duplicate PONG messages", 1, GNUNET_NO); |
1922 | return; | 1922 | return; |
1923 | } | 1923 | } |
1924 | t_decrypt (t, &challenge, &msg->nonce, sizeof (uint32_t), msg->iv); | 1924 | if (NULL == t->kx_ctx) |
1925 | { | ||
1926 | GNUNET_STATISTICS_update (stats, "# stray PONG messages", 1, GNUNET_NO); | ||
1927 | return; | ||
1928 | } | ||
1925 | 1929 | ||
1930 | t_decrypt (t, &challenge, &msg->nonce, sizeof (uint32_t), msg->iv); | ||
1926 | if (challenge != t->kx_ctx->challenge) | 1931 | if (challenge != t->kx_ctx->challenge) |
1927 | { | 1932 | { |
1928 | LOG (GNUNET_ERROR_TYPE_WARNING, "Wrong PONG challenge on %s\n", GCT_2s (t)); | 1933 | LOG (GNUNET_ERROR_TYPE_WARNING, "Wrong PONG challenge on %s\n", GCT_2s (t)); |