-fix docu
[oweals/gnunet.git] / src / core / gnunet-service-core_kx.c
index a2188dabee375a6a70ef2b0de75137dac7f61945..0cc3521acc9220ed6e795b9b94fce91c62808c3b 100644 (file)
@@ -462,7 +462,7 @@ derive_auth_key (struct GNUNET_CRYPTO_AuthKey *akey,
  * @param iv initialization vector to initialize
  * @param skey session key to use
  * @param seed seed to use
- * @param creation_time creation time to use
+ * @param identity identity of the other peer to use
  */
 static void
 derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv,
@@ -484,7 +484,7 @@ derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv,
  * @param iv initialization vector to initialize
  * @param skey session key to use
  * @param seed seed to use
- * @param creation_time creation time to use
+ * @param challenge nonce to use
  * @param identity identity of the other peer to use
  */
 static void
@@ -564,7 +564,8 @@ do_decrypt (struct GSC_KeyExchangeInfo *kx,
     return GNUNET_NO;
   }
   if ( (kx->status != KX_STATE_KEY_RECEIVED) && (kx->status != KX_STATE_UP) &&
-       (kx->status != KX_STATE_REKEY_SENT) )
+       (kx->status != KX_STATE_REKEY_SENT) &&
+       (kx->status != KX_STATE_REKEY) )
   {
     GNUNET_break_op (0);
     return GNUNET_SYSERR;
@@ -1285,7 +1286,11 @@ GSC_KX_handle_pong (struct GSC_KeyExchangeInfo *kx,
 static void
 send_key (struct GSC_KeyExchangeInfo *kx)
 {
-  GNUNET_assert (kx->retry_set_key_task == GNUNET_SCHEDULER_NO_TASK);
+  if (kx->retry_set_key_task != GNUNET_SCHEDULER_NO_TASK)
+  {
+     GNUNET_SCHEDULER_cancel (kx->retry_set_key_task);
+     kx->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK;
+  }
   if (KX_STATE_UP == kx->status)
     return;                     /* nothing to do */
   if (kx->public_key == NULL)