aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-28 15:56:49 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-28 15:56:49 +0000
commit75865261ebd5d2b70048273447c740a1629c89cb (patch)
tree92dc166c5fbdef40e4b6fe5f55a661ca33c04a65 /src/libutil
parentb45251c41666e7c21d8b956d5b543805bee4f6ba (diff)
downloadrspamd-75865261ebd5d2b70048273447c740a1629c89cb.tar.gz
rspamd-75865261ebd5d2b70048273447c740a1629c89cb.zip
Adopt tweetnacl for rspamd.
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/CMakeLists.txt1
-rw-r--r--src/libutil/util.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/libutil/CMakeLists.txt b/src/libutil/CMakeLists.txt
index 655b34487..ddfb5cf30 100644
--- a/src/libutil/CMakeLists.txt
+++ b/src/libutil/CMakeLists.txt
@@ -33,6 +33,7 @@ TARGET_LINK_LIBRARIES(rspamd-util event)
TARGET_LINK_LIBRARIES(rspamd-util xxhash)
TARGET_LINK_LIBRARIES(rspamd-util siphash)
TARGET_LINK_LIBRARIES(rspamd-util blake2)
+TARGET_LINK_LIBRARIES(rspamd-util tweetnacl)
TARGET_LINK_LIBRARIES(rspamd-util rdns)
IF(OPENSSL_FOUND)
TARGET_LINK_LIBRARIES(rspamd-util ${OPENSSL_LIBRARIES})
diff --git a/src/libutil/util.c b/src/libutil/util.c
index 1b0e08b9f..102bfc107 100644
--- a/src/libutil/util.c
+++ b/src/libutil/util.c
@@ -31,6 +31,7 @@
#include "message.h"
#include "xxhash.h"
+#include "ottery.h"
#ifdef HAVE_OPENSSL
#include <openssl/rand.h>
@@ -2115,3 +2116,10 @@ rspamd_encode_base32 (guchar *in, gsize inlen)
return out;
}
+
+
+void
+randombytes (guchar *buf, guint64 len)
+{
+ ottery_rand_bytes (buf, (size_t)len);
+}