From: Bart Polot Date: Tue, 17 Jun 2014 12:13:20 +0000 (+0000) Subject: - intialize a new kx_ctx on receipt of a new ephemeral key if none exists X-Git-Tag: initial-import-from-subversion-38251~3736 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f5161894998919be90c0e9dce3eab05e33780625;p=oweals%2Fgnunet.git - intialize a new kx_ctx on receipt of a new ephemeral key if none exists --- diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index 6c4d949e3..bcb7eb873 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c @@ -1668,6 +1668,15 @@ handle_ephemeral (struct CadetTunnel *t, GNUNET_break_op (0); return; } + if (NULL == t->kx_ctx) + { + t->kx_ctx = GNUNET_new (struct CadetTunnelKXCtx); + t->kx_ctx->rekey_start_time = GNUNET_TIME_absolute_get (); + t->kx_ctx->e_key_old = t->e_key; + t->kx_ctx->d_key_old = t->d_key; + t->kx_ctx->challenge = + GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, UINT32_MAX); + } t->peers_ephemeral_key = msg->ephemeral_key; create_keys (t); if (CADET_TUNNEL3_KEY_SENT == t->estate)