summaryrefslogtreecommitdiffstats
path: root/src/method_xsalsa20_poly1305.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/method_xsalsa20_poly1305.c')
-rw-r--r--src/method_xsalsa20_poly1305.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/method_xsalsa20_poly1305.c b/src/method_xsalsa20_poly1305.c
index 655f61b..4cadca9 100644
--- a/src/method_xsalsa20_poly1305.c
+++ b/src/method_xsalsa20_poly1305.c
@@ -102,7 +102,7 @@ static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx, u
session->valid_till.tv_sec += ctx->conf->key_valid;
session->refresh_after = ctx->now;
- session->refresh_after.tv_sec += ctx->conf->key_refresh;
+ session->refresh_after.tv_sec += ctx->conf->key_refresh - fastd_rand(ctx, 0, ctx->conf->key_refresh_splay);
memcpy(session->key, secret, crypto_secretbox_xsalsa20poly1305_KEYBYTES);