diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-06-17 12:13:32 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-06-17 12:13:32 +0000 |
commit | 187e76e43f5b7c18086490b8c7233ebdc8a004dd (patch) | |
tree | c7a50042e154e4b305882ee56a774cbf89320e84 /src/cadet/gnunet-service-cadet_tunnel.c | |
parent | 23d6fc8a35b168370bca63cbc918f1ac817dd8f9 (diff) | |
download | gnunet-187e76e43f5b7c18086490b8c7233ebdc8a004dd.tar.gz gnunet-187e76e43f5b7c18086490b8c7233ebdc8a004dd.zip |
- only create keys on new ephemeral info
Diffstat (limited to 'src/cadet/gnunet-service-cadet_tunnel.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet_tunnel.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index adc3eb342..227c29fd6 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c | |||
@@ -400,7 +400,7 @@ is_ready (struct CadetTunnel *t) | |||
400 | int ready; | 400 | int ready; |
401 | 401 | ||
402 | GCT_debug (t, GNUNET_ERROR_TYPE_DEBUG); | 402 | GCT_debug (t, GNUNET_ERROR_TYPE_DEBUG); |
403 | ready = (CADET_TUNNEL3_READY == t->cstate && CADET_TUNNEL3_KEY_OK == t->estate); | 403 | ready = CADET_TUNNEL3_READY == t->cstate && CADET_TUNNEL3_KEY_OK == t->estate; |
404 | ready = ready || GCT_is_loopback (t); | 404 | ready = ready || GCT_is_loopback (t); |
405 | return ready; | 405 | return ready; |
406 | } | 406 | } |
@@ -1704,8 +1704,12 @@ handle_ephemeral (struct CadetTunnel *t, | |||
1704 | t->kx_ctx->challenge = | 1704 | t->kx_ctx->challenge = |
1705 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, UINT32_MAX); | 1705 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, UINT32_MAX); |
1706 | } | 1706 | } |
1707 | t->peers_ephemeral_key = msg->ephemeral_key; | 1707 | if (0 != memcmp (&t->peers_ephemeral_key, &msg->ephemeral_key, |
1708 | create_keys (t); | 1708 | sizeof (msg->ephemeral_key))) |
1709 | { | ||
1710 | t->peers_ephemeral_key = msg->ephemeral_key; | ||
1711 | create_keys (t); | ||
1712 | } | ||
1709 | if (CADET_TUNNEL3_KEY_SENT == t->estate) | 1713 | if (CADET_TUNNEL3_KEY_SENT == t->estate) |
1710 | { | 1714 | { |
1711 | LOG (GNUNET_ERROR_TYPE_DEBUG, " our key was sent, sending ping\n"); | 1715 | LOG (GNUNET_ERROR_TYPE_DEBUG, " our key was sent, sending ping\n"); |