From 75865261ebd5d2b70048273447c740a1629c89cb Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 28 Jan 2015 15:56:49 +0000 Subject: Adopt tweetnacl for rspamd. --- src/libutil/CMakeLists.txt | 1 + src/libutil/util.c | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'src') 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 @@ -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); +} -- cgit v1.2.3