[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31463 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31463 - gnunet/src/mesh |
Date: |
Tue, 17 Dec 2013 05:41:27 +0100 |
Author: bartpolot
Date: 2013-12-17 05:41:27 +0100 (Tue, 17 Dec 2013)
New Revision: 31463
Modified:
gnunet/src/mesh/gnunet-service-mesh_connection.c
gnunet/src/mesh/gnunet-service-mesh_tunnel.c
Log:
- use tunnel encryption state to select decryption key
Modified: gnunet/src/mesh/gnunet-service-mesh_connection.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_connection.c 2013-12-17 04:19:11 UTC
(rev 31462)
+++ gnunet/src/mesh/gnunet-service-mesh_connection.c 2013-12-17 04:41:27 UTC
(rev 31463)
@@ -1699,6 +1699,8 @@
return GNUNET_OK;
}
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " on connection %s\n", GMC_2s (c));
+
/* Check if origin is as expected */
neighbor = get_prev_hop (c);
peer_id = GNUNET_PEER_search (peer);
Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.c 2013-12-17 04:19:11 UTC
(rev 31462)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.c 2013-12-17 04:41:27 UTC
(rev 31463)
@@ -525,9 +525,27 @@
size_t size, uint32_t iv)
{
struct GNUNET_CRYPTO_SymmetricInitializationVector siv;
+ struct GNUNET_CRYPTO_SymmetricSessionKey *key;
- GNUNET_CRYPTO_symmetric_derive_iv (&siv, &t->d_key, &iv, sizeof (uint32_t),
NULL);
- return GNUNET_CRYPTO_symmetric_decrypt (src, size, &t->d_key, &siv, dst);
+ if (t->estate == MESH_TUNNEL3_KEY_OK)
+ {
+ key = &t->d_key;
+ }
+ else if (NULL != t->kx_ctx)
+ {
+ key = &t->kx_ctx->d_key_old;
+ }
+ else
+ {
+ GNUNET_STATISTICS_update (stats, "# non decryptable data", 1, GNUNET_NO);
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "WARNING got data on %s without a valid key\n",
+ GMT_2s (t));
+ return 0;
+ }
+
+ GNUNET_CRYPTO_symmetric_derive_iv (&siv, key, &iv, sizeof (uint32_t), NULL);
+ return GNUNET_CRYPTO_symmetric_decrypt (src, size, key, &siv, dst);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31463 - gnunet/src/mesh,
gnunet <=