summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-04-01 04:31:32 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-04-01 04:31:32 +0200
commitdba817c84f3dab4f7cd4a449ab16fed4d3cc1fa8 (patch)
treea0243c657434df31019a528ca63dd79579936aaa /src
parentb5efe8ac07194d6e2447bef423292fa5909cf2fd (diff)
downloadfastd-dba817c84f3dab4f7cd4a449ab16fed4d3cc1fa8.tar
fastd-dba817c84f3dab4f7cd4a449ab16fed4d3cc1fa8.zip
Don't refresh a session before old handshakes are cleaned up
Diffstat (limited to 'src')
-rw-r--r--src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c b/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
index 886a372..0376239 100644
--- a/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
+++ b/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
@@ -674,8 +674,6 @@ static void protocol_handle_recv(fastd_context *ctx, fastd_peer *peer, fastd_buf
goto end;
}
- check_session_refresh(ctx, peer);
-
uint8_t nonce[crypto_secretbox_xsalsa20poly1305_NONCEBYTES];
memcpy(nonce, buffer.data, NONCEBYTES);
memset(nonce+NONCEBYTES, 0, crypto_secretbox_xsalsa20poly1305_NONCEBYTES-NONCEBYTES);
@@ -716,6 +714,8 @@ static void protocol_handle_recv(fastd_context *ctx, fastd_peer *peer, fastd_buf
pr_debug(ctx, "invalidating old session with %P", peer);
memset(&peer->protocol_state->old_session, 0, sizeof(protocol_session));
}
+
+ check_session_refresh(ctx, peer);
}
else {
pr_debug(ctx, "verification failed for packet received from %P", peer);