aboutsummaryrefslogtreecommitdiff
path: root/src/cadet
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2015-10-02 03:37:53 +0000
committerBart Polot <bart@net.in.tum.de>2015-10-02 03:37:53 +0000
commit3d4a65d3eab9af4ddde2721e377402a4c60c4469 (patch)
tree93ba11bfe20a218f46af980fba337bc03d5f708d /src/cadet
parenta101e9b37474e82102637b09de03c5d602201983 (diff)
downloadgnunet-3d4a65d3eab9af4ddde2721e377402a4c60c4469.tar.gz
gnunet-3d4a65d3eab9af4ddde2721e377402a4c60c4469.zip
Don't reset axolotl state on receipt of a pseudo-duplicate AX key exchange.
Pseudo duplicate means same handshake key but different ratchet key. This can happen if Alice's first KX message is lost, she receives Bob's KX and send a payload message herself, advancing her ratchet. If Bob doesn't send a payload message fast enough, or it gets lost, Alice will retransmit her KX message, this time with a different ratchet key. If Bob only checks the ratchet key (the handshake keys are discarded) it could reset the Axolotl status and re-use keys for messages that got lost/delayed.
Diffstat (limited to 'src/cadet')
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index 67f770246..8986113e1 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -3019,6 +3019,11 @@ handle_kx_ax (struct CadetTunnel *t, const struct GNUNET_CADET_AX_KX *msg)
3019 salt, sizeof (salt), 3019 salt, sizeof (salt),
3020 &key_material, sizeof (key_material), NULL); 3020 &key_material, sizeof (key_material), NULL);
3021 3021
3022 if (0 == memcmp (&ax->RK, &keys[0], sizeof(ax->RK)))
3023 {
3024 LOG (GNUNET_ERROR_TYPE_INFO, " known handshake key, exit\n");
3025 return;
3026 }
3022 ax->RK = keys[0]; 3027 ax->RK = keys[0];
3023 if (GNUNET_YES == am_I_alice) 3028 if (GNUNET_YES == am_I_alice)
3024 { 3029 {