aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-02-02 15:38:47 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-02-02 15:38:47 +0000
commit86c404040221355da70c368c1283473825957235 (patch)
tree2a4898de52ce93fea0c2c85290c3c68d078f5893 /src
parentecc513e64ef9bd992162b7ce375799427a570c29 (diff)
downloadrspamd-86c404040221355da70c368c1283473825957235.tar.gz
rspamd-86c404040221355da70c368c1283473825957235.zip
Fix issue with random numbers generator in dns.
Diffstat (limited to 'src')
-rw-r--r--src/dns.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dns.c b/src/dns.c
index ce2467da4..375ec9811 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -48,11 +48,11 @@ static void
dns_permutor_init (struct dns_permutor *p)
{
/* Init random key and IV */
- rspamd_random_bytes (p->perm_buf, sizeof (p->perm_buf));
+ rspamd_random_bytes (p->perm_buf, PERMUTOR_KSIZE + PERMUTOR_IVSIZE);
/* Setup ctx */
chacha_keysetup (&p->ctx, p->perm_buf, PERMUTOR_KSIZE * 8, 0);
- chacha_ivsetup (&p->ctx, p->perm_buf + PERMUTOR_KSIZE);
+ chacha_ivsetup (&p->ctx, p->perm_buf + PERMUTOR_KSIZE * 8);
chacha_encrypt_bytes (&p->ctx, p->perm_buf, p->perm_buf, sizeof (p->perm_buf));